FFmpeg Commands

Make FastStart MP4 for internet video

ffmpeg -i in.mp4 -vcodec copy -movflags faststart out.mp4

RTSP to RTMP

ffmpeg -rtsp_transport tcp -i rtsp://user:password@localhost:554/rtsp -vcodec copy -f flv -r 25 -s 1920x1080 -an "rtmp://localhost/rtmp"

-an: Disable audio

-f: Force format

-r: Frame rate

-s: Video resolution

-vcodec: Set the video codec. "copy" means no decoding/encoding.

Capture RTSP video stream

ffmpeg -rtsp_transport tcp -i rtsp://user:password@localhost:554/rtsp -vcodec copy -an cap.mp4

-rtsp_transport: Specify RTSP transport protocol, TCP is more reliable and supports large frames

-vcodec: copy the original video codec