For example to remux an MP4 file containing an H.264 stream to mpegts format with ffmpeg, you can use the command:

ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
For example to remux an MP4 file containing an H.264 stream to mpegts format with ffmpeg, you can use the command:

ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
For example to remux an MP4 file containing an H.264 stream to mpegts format with ffmpeg, you can use the command:

ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
For example to remux an MP4 file containing an H.264 stream to mpegts format with ffmpeg, you can use the command:

ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
For example to remux an MP4 file containing an HEVC stream to mpegts format with ffmpeg, you can use the command:

ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
Drop one second of audio every 10 seconds and add some random noise to the rest.

ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(t\,10)\,9\,10)' output.mkv
You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio for NTSC frame rate using the frame_rate option.

ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
Set Rec709 colorspace for each frame of the file

ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
Set Hybrid Log-Gamma parameters for each frame of the file

ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov
This bitstream filter patches the header of frames extracted from an MJPEG stream (carrying the AVI1 header ID and lacking a DHT segment) to produce fully qualified JPEG images.

ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
exiftran -i -9 frame*.jpg
ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
For example the following ffmpeg command forces a global header (thus disabling individual packet headers) in the H.264 packets generated by the libx264 encoder, but corrects them by adding the header stored in extradata to the key packets:

ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts

Recommend

FFMPEG ffprobe Documentation 13 Bitstream Filters 13.10 hapqa_extract

FFMPEG ffprobe Documentation 13 Bitstream Filters 13.9 filter_units

FFMPEG ffprobe Documentation 13 Bitstream Filters 13.5 dump_extra

FFMPEG ffprobe Documentation 13 Bitstream Filters

FFMPEG ffprobe Documentation 8 Codec Options

FFMPEG ffprobe Documentation 7 Expression Evaluation

FFMPEG ffprobe Documentation 6 Syntax 6.3 Time duration

FFMPEG ffprobe Documentation 6 Syntax 6.2 Date

FFMPEG ffprobe Documentation 6 Syntax 6.1 Quoting and escaping 6.1.1 Examples

FFMPEG ffprobe Documentation 4 Writers 4.2 compact, csv

FFMPEG ffprobe Documentation 4 Writers 4.1 default

FFMPEG ffprobe Documentation 3 Options 3.4 Main options

FFMPEG ffprobe Documentation 3 Options 3.3 AVOptions

FFMPEG ffprobe Documentation 3 Options 3.2 Generic options

FFMPEG FFmpeg FAQ 4 Development 4.8 I’m using FFmpeg from within my C application but the linker complains about missing symbols from the libraries themselves.

FFMPEG FFmpeg FAQ 3 Usage 3.19 How do I run ffmpeg as a background task?

FFMPEG FFmpeg FAQ 3 Usage 3.18 I have a stretched video, why does scaling does not fix it?

FFMPEG FFmpeg FAQ 3 Usage 3.15 Using -f lavfi, audio becomes mono for no apparent reason.

FFMPEG FFmpeg FAQ 3 Usage 3.14 How can I concatenate video files? 3.14.4 Concatenating using raw audio and video

FFMPEG FFmpeg FAQ 3 Usage 3.14 How can I concatenate video files? 3.14.3 Concatenating using the concat protocol (file level)

FFMPEG FFmpeg FAQ 3 Usage 3.12 How can I read DirectShow files?

FFMPEG FFmpeg FAQ 3 Usage 3.3 How do I encode movie to single pictures?

FFMPEG FFmpeg FAQ 3 Usage 3.2 How do I encode single pictures into movies?

FFMPEG FFmpeg FAQ 2 Compilation 2.4 How do I use pkg-config when cross-compiling?

FFMPEG FFmpeg FAQ 2 Compilation 2.3 How do I make pkg-config find my libraries?

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.43 zmq

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.42 unix

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.41 udp 3.41.1 Examples

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.41 udp

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.40 tls

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.39 tcp

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.38 tee

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.37 subfile

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.35 srt

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.34 sctp

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.33 sap 3.33.2 Demuxer

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.33 sap 3.33.1 Muxer

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.32 rtsp 3.32.1 Examples

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.32 rtsp

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.30 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.29 libssh

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.22 rtmp

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.20 prompeg

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.19 pipe

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.18 md5

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.17 mmsh

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.15 Icecast

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.14 http 3.14.1 HTTP Cookies

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.14 http

FFMPEG FFmpeg Protocols Documentation 3 Protocols 3.13 hls