lkakmi.blogg.se

Ffmpeg command line samples
Ffmpeg command line samples










ffmpeg command line samples ffmpeg command line samples ffmpeg command line samples

Use the libass library (make sure your ffmpeg install has the library in the configuration -enable-libass).įirst convert the subtitles to. Then, run ffmpeg: ffmpeg -f concat -i list.txt -c copy out.mp4ĭelay video by 3.84 seconds: ffmpeg -i in.mp4 -itsoffset 3.84 -i in.mp4 -map 1:v -map 0:a -vcodec copy -acodec copy out.mp4ĭelay audio by 3.84 seconds: ffmpeg -i in.mp4 -itsoffset 3.84 -i in.mp4 -map 0:v -map 1:a -vcodec copy -acodec copy out.mp4 See the -map option documentation for more info.The -shortest option will cause the output duration to match the duration of the shortest input stream.If you want to re-encode, see FFmpeg Wiki: H.264 Encoding Guide. With -c copy the streams will be stream copied, not re-encoded, so there will be no quality loss.To copy the video from in0.mp4 and audio from in1.mp4: ffmpeg -i in0.mp4 -i in1.mp4 -c copy -map 0:0 -map 1:1 -shortest out.mp4 For high quality video and audio, read the x264 Encoding Guide and the AAC Encoding Guide, respectively.įor example: ffmpeg -ss -i in.mp4 -t -c:v libx264 -c:a aac -strict experimental -b:a 128k out.mp4 If you leave out the -c copy option, ffmpeg will automatically re-encode the output video and audio according to the format you chose. This won't harm the quality and make the command run within seconds. -c copy copies the first video, audio, and subtitle bitstream from the input to the output file without re-encoding them.Recent ffmpeg also has a flag to supply the end time with -to.-t specifies the duration of the clip (same format).Without re-encoding: ffmpeg -ss -i in.mp4 -t -c copy out.mp4 Additional info: ffmpeg -i in.mp4 -preset slower -crf 18 out.mp4 Use the preset parameter to control the speed of the compression process. The default value is 23, and visually lossless compression corresponds to -crf 18. The lower crf, the higher the quality (range: 0-51). Use the crf (Constant Rate Factor) parameter to control the output quality. Remux an MKV file into MP4 ffmpeg -i in.mkv -c:v copy -c:a copy out.mp4 A list of useful commands for the ffmpeg command line tool.įull documentation: Basic conversion ffmpeg -i in.mp4 out.avi












Ffmpeg command line samples