How to concatenate two MP4 files using FFmpeg? on the FFmpeg Bug Tracker and Wiki Then, using FFmpeg: # The -safe 0 is not required if the paths are relativeįfmpeg -f concat -safe 0 -i text_file.txt -c copy output.mp3Ĭoncatenating media files on Stackoverflow Either of the following would generate a file containing every *.mp3 in the working directory: # with a bash for loop for f in *.mp3 do echo "file ' $f'" > text_file.txt done # or with printf printf "file '%s'\n" *.mp3 > mylist.txt It is possible to generate this file with a bash for loop, or using printf. What you wanna do is create a text file with all the files (whose paths can be either relative or absolute) you want to have concatenated in the following form: file '/path/to/file1.mp3' If this isn't the case, see this page on the FFmpeg Bug Tracker and Wiki. The assumption here is that you want to concatenate files with the same codecs. Speed up video x1.5 but keep all frames on. How to speed up / slow down a video on the FFmpeg Bug Tracker and Wiki. In English, # if you're speeding up the video 2x, divide 1 by 2 to get 0.5 for the video, then # use 2.0 as the factor for the audio tempo (this is 1 divided by video factor)įfmpeg -i input.mp4 -filter_complex "setpts=0.5*PTS atempo=2.0" -map "" -map "" output.mp4 If you wanna speed up video and audio at the same time: # note here that the audio tempo is the inverse of the factor modifying frame timestamps. If the value is above 1.0, then you're making your video slowerįfmpeg -i input.mp4 -filter:v "setpts=0.5*PTS" output.mp4 I could speed up the video and hence reduce its overall time to, say 2.5 minutes: # the 0.5 here means we're reducing the video to half the original time. I find this useful in situations where I record a screen capture (no audio) while doing a demo, and I end up with, say, a 5-minute video that has several periods of no activity (e.g. # if you don't have libx265, you can use the libx264 codecįfmpeg -i input.mp4 -vcodec libx264 -crf 28 output.mp4įor more info
0 Comments
Leave a Reply. |