XDCAM HD 50Mbps in QuickTime (for Final Cut Pro import)
DVCAM / DVCPRO25 / DVCPRO50
MPEG-2 I-frame only in Highest Quality
D10 into QuickTime (for Final Cut Pro import)
Audio Volume Modification
Make a Video File from a Single Frame
1-pass encoding:
ffmpeg -i <input_file> -vcodec libx264 -b <video_bitrate> -g <gop_size> -bf 3 -b_strategy 1 -coder 1 -qmin 10 -qmax 51 -sc_threshold 40 -flags +loop -cmp +chroma -me_range 16 -me_method hex -subq 5 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -directpred 1 -flags2 +fastpskip -dts_delta_threshold 1 -acodec libfaac -ab <audio_bitrate> output.mp4
2-pass encoding:
ffmpeg -y -i <input_file> -pass 1 -vcodec libx264 -b <video_bitrate> -g <gop_size> -bf 3 -refs 6 -b_strategy 1 -coder 1 -qmin 10 -qmax 51 -sc_threshold 40 -flags +loop -cmp +chroma -me_range 16 -me_method umh -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -directpred 3 -flags2 +dct8x8+wpred+bpyramid+mixed_refs -trellis 1 -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -acodec libfaac -ab <audio_bitrate> output.mp4
ffmpeg -y -i <input_file> -pass 2 -vcodec libx264 -b <video_bitrate> -g <gop_size> -bf 3 -refs 6 -b_strategy 1 -coder 1 -qmin 10 -qmax 51 -sc_threshold 40 -flags +loop -cmp +chroma -me_range 16 -me_method umh -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -directpred 3 -flags2 +dct8x8+wpred+bpyramid+mixed_refs -trellis 1 -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -acodec libfaac -ab <audio_bitrate> output.mp4
D10 (aka Sony IMX) Encoding
ffmpeg -i <input_file> -vcodec mpeg2video -r 25 -pix_fmt yuv422p -minrate 50000k -maxrate 50000k -b 50000k -intra -flags +ildct+low_delay -dc 10 -flags2 +ivlc+non_linear_q -ps 1 -qmin 1 -qmax 3 -top 1 -bufsize 2000000 -rc_init_occupancy 2000000 -rc_buf_aggressivity 0.25 -an output.m2v
Notes :
- Only works for 25 fps content.
- Change minrate, maxrate and b values to 30000k / 40000k / 50000k in order to produce 30/40/50 Mbps D10 essence.
- Set bufsize and rc_init_occupancy values to 1200000 / 1600000 / 2000000 for 30/40/50 Mbps D10 essence.
- Set qmax value to 8 / 3 / 3 for 30/40/50 Mbps D10 essence.
- Add the -padtop 32 option if you want to produce a 720x608 D10 image size from a 720x576 source.
XDCAM HD 50Mbps in QuickTime (for Final Cut Pro import)
ffmpeg -i <input_file> -pix_fmt yuv422p -vcodec mpeg2video -flags +ildct+ilme -top 1 -dc 10 -flags2 +ivlc+non_linear_q -qmin 1 -lmin '1*QP2LAMBDA' -vtag xd5c -rc_max_vbv_use 1 -rc_min_vbv_use 1 -b 50000k -minrate 50000k -maxrate 50000k -bufsize 36408333 -bf 2 -aspect 16:9 -acodec pcm_s16be -f mov output.mov -newaudio
DVCAM / DVCPRO25 / DVCPRO50 Encoding
ffmpeg -i <input_file> -pix_fmt yuv420p output_DVCAM.dv
ffmpeg -i <input_file> -pix_fmt yuv411p output_DVCPRO25.dv
ffmpeg -i <input_file> -pix_fmt yuv422p output_DVCPRO50.dv
VC-3 (aka Avid DNxHD) Encoding
ffmpeg -i <input_file> -vcodec dnxhd -b <bitrate> -an output.mov
Notes :
- <bitrate> can take the following values : 36M, 60M, 90M, 120M, 185M ( please refer to the following table ).
- Add the following option for interlaced modes : -flags +ildct
- Add the following option for best quality mode ( very slow ! ) : -mbd rd
Supported Resolutions :
Project FormatResolutionFrame SizeBitsFPS<bitrate>1080i / 59.94DNxHD 2201920 x 1080829.97220M1080i / 59.94DNxHD 1451920 x 1080829.97145M1080i / 50DNxHD 1851920 x 1080825185M1080i / 50DNxHD 1201920 x 1080825120M1080p / 25DNxHD 1851920 x 1080825185M1080p / 25DNxHD 1201920 x 1080825120M1080p / 25DNxHD 361920 x 108082536M1080p / 24DNxHD 1751920 x 1080824175M1080p / 24DNxHD 1151920 x 1080824115M1080p / 24DNxHD 361920 x 108082436M1080p / 23.976DNxHD 1751920 x 1080823.976175M1080p / 23.976DNxHD 1151920 x 1080823.976115M1080p / 23.976DNxHD 361920 x 1080823.97636M1080p / 29.7DNxHD 451920 x 1080829.9745M720p / 59.94DNxHD 2201280x720859.94220M720p / 59.94DNxHD 1451280x720859.94145M720p / 50DNxHD 1751280x720850175M720p / 50DNxHD 1151280x720850115M720p / 23.976DNxHD 901280x720823.97690M720p / 23.976DNxHD 601280x720823.97660M
MPEG-2 I-frame only Highest Quality Encoding
ffmpeg -i <input_file> -vcodec mpeg2video -pix_fmt yuv422p -qscale 1 -qmin 1 -intra -an output.m2v
ffmpeg -i <input_file> -vcodec mpeg2video -b <video_bitrate> -g <gop_size> -bf 2 -b_strategy 1 -acodec mp2 -ab <audio_bitrate> -f vob output.mpg
ffmpeg -i <input_file> -vcodec mjpeg -qscale 1 -an output.avi
D10 into QuickTime Wrapping
ffmpeg -i <input_file> -vcodec copy -acodec pcm_s16le -vtag mx5p -vbsf imxdump output.mov
Notes :
- This feature needs a patched version of FFmpeg not available in the current SVN, please contact Baptiste Coudurier for more information.
- Set -vtag to mx3p / mx4p / mx5p for D10 30/40/50 PAL or mx3n / mx4n / mx5n for D10 30/40/50 NTSC.
- Input D10 image size must be 720x608 ( use -padtop 32 option during D10 encoding if the original image size is 720x576 ).
- Final Cut Pro compliant.
MPEG-2 Program Stream Muxing
ffmpeg -genpts 1 -i ES_Video.m2v -i ES_Audio.mp2 -vcodec copy -acodec copy -f vob output.mpg
Note : In order to mux multiple audio tracks into the same file :
ffmpeg -genpts 1 -i ES_Video.m2v -i ES_Audio1.mp2 -i ES_Audio2.mp2 -vcodec copy -acodec copy -f vob output.mpg -newaudio
Note : In order to remux a PS file with multiple audio tracks :
ffmpeg -i input.mpg -vcodec copy -acodec copy -f vob output.mpg -acodec copy -newaudio
MPEG-2 Program Stream Demuxing
ffmpeg -i input.mpg -vcodec copy -f mpeg2video ES_Video.m2v -acodec copy -f mp2 ES_Audio.mp2
Note : This also works for files containing multiple audio tracks :
ffmpeg -i input.mpg -vcodec copy -f mpeg2video ES_Video.m2v -acodec copy -f mp2 ES_Audio1.mp2 -acodec copy -f mp2 ES_Audio2.mp2
ffmpeg -i <input_file> -timecode_frame_start <start_timecode> -vcodec mpeg2video -an output.m2v
Note : Start timecode is set as number of frames. For instance, if you want to start at 18:12:36:15, you will have to set -timecode_frame_start to 1638915 ( for 25 fps content ).
Audio Volume Modification
ffmpeg -i <input_file> -vol <audio_volume> -acodec <audio_codec> <output_file>
ffmpeg -i input.vob -map 0:2 -acodec aac -ab <audio_bitrate> -vn output.mp4
Transcode audio stream #0:2.
ffmpeg -i <input_file> -ss <timecode> -t <timecode> -vcodec copy -acodec copy <output_file>
Make a Video File from a Single Frame
ffmpeg -loop_input -vframes <number_of_frames> -i <input_file> <output_file>
Sponsor: SmartJog
Please submit new command lines to Olivier Amato