0

i use ffmpeg to encode my videos to be ready for mpeg dash process:

ffmpeg -y -i legend.mp4 -c:a copy -c:v libx264 -x264opts 'keyint=48:min-keyint=48:no-scenecut' -r 24 -b:v 1500k -maxrate 1500k -bufsize 1000k -vf "scale=-1:816" out.mp4

This command line work fine, and i wonder to know how to create a mp4 encoded file like above from a sequence of videos? I try to get a faster process, and i think that i don't need to encode separately all videos and after create a sequence (a big video) with post production software.. I wish to resolve all by a sigle command line, Is there a way to give a playlist for input to get only one output video within the sequence of the playlist all with the same encoding assuming that all videos have same frame rate and same resolution? Thanks, Dan

1 Answers1

0

#1 Create a text file with the list of your videos.

file first.mp4
file second.mp4
...
file nth.mp4

#2 Concat them

ffmpeg -f concat -i list.txt -c:a copy -c:v libx264 -x264opts 'keyint=48:min-keyint=48:no-scenecut' -r 24 -b:v 1500k -maxrate 1500k -bufsize 1000k -vf "scale=-2:816" out.mp4

This method requires that all videos have the same resolution. If audio is present, all of them should have same codec, no. of channels and sampling rate. If not, re-encode the audio as well and force same parameters e.g. -ar 48000 -ac 2

Gyan
  • 85,394
  • 9
  • 169
  • 201
  • Hello Mulvya cuold i ask you why with the following: "ffmpeg -f concat -i playlist.sh -c:a aac -b:a 384k -ar 48000 -ac 2 -c:v libx264 -x264opts 'keyint=50:min-keyint=50:no-scenecut' -r 25 -b:v 2400k -maxrate 2400k -bufsize 1200k -vf "scale=-1:432 " out.mp4" It give me this message, the first video is ok, after there is an empty space and after 10 minutes arrive the second video, this is the relevant message: "More than 10000 frames duplicated" – Massimo Vantaggio Jan 24 '18 at 17:47
  • All videos need to have same timebase. Share details of your videos. – Gyan Jan 24 '18 at 18:07
  • Hi Mulvya, Thanks for support, may i ask what you mean for time base? i can't find it. However i move the question about video conformance here https://stackoverflow.com/questions/48428756/ffmpeg-how-generate-a-sequence-of-videos-with-bash If you want help a little more :) Thanks Massimo – Massimo Vantaggio Jan 26 '18 at 18:45