I have a video that is downloaded with youtube-dl. I want to create a video that is made out of an image and the downloaded video, using
ffmpeg and the loop function.
./ffmpeg -f concat -safe 0 -i list.txt -c copy merged.mp4
Inside of my list.txt file is
file word_img.jpg file youtube_video.mp4
Running the command at the bottom creates a new video. It's just that the it's the same exact thing as the youtube video. The other image never gets added. Could this have to do with the encoding?
I also tried another approach which went something like this.
./ffmpeg -t 125 -async 1 -i youtube_video.mp4\ -t 5 -i word_img.jpg \ -filter_complex "loop=149:1:0[bgheld5]; \ loop=149:1:0[fgheld5]; \ [bgheld5][fgheld5]overlay=eof_action=pass" out.mp4
This sort of works. There is a static image that get displayed for 5 seconds and then the 30 second youtube video gets played. The problems is that the audio and the video of the youtube video are out of sync by about 5 seconds.
./ffmpeg -i img.jpg returns the following
Input #0, image2, from 'img.jpg': Duration: 00:00:00.04, start: 0.000000, bitrate: 1258 kb/s Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 640x356 [SAR 96:96 DAR 160:89], 25 tbr, 25 tbn, 25 tbc
./ffmpeg -i video.mp4 returns the following
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.26.101 Duration: 00:02:00.04, start: 0.000000, bitrate: 575 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x356 [SAR 1:1 DAR 160:89], 440 kb/s, 24.98 fps, 24.98 tbr, 25k tbn, 49.95 tbc (default) Metadata: handler_name : ISO Media file produced by Google Inc. Created on: 10/28/2018. Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : ISO Media file produced by Google Inc. Created on: 10/28/2018