Does anybody know if it is possible to script the addition of 1 second of black to the start of a video file whilst encoding via x264/ffmpeg?
It would also be useful if there was a way of scripting chapter markers to the correct the right I-frame.
+ Reply to Thread
Results 1 to 5 of 5
If the first frame of your video is black you can use ffmpeg's loop filter to repeat that first frame N (one second) times, and the adelay filter to delay the audio by the same amount of time (inserts silent audio). Assuming a 24 fps video:
ffmpeg -i input.mp4 -vf loop=loop=24:size=1:start=0 -af adelay=1000:all=1 -c:v libx264 -c:a aac output.mp4
By the way, here's a mod of davexnet's AviSynth script which automatically generates the correct number of blank frames based on the video's frame rate (rather than manually specifying the number of frames):
vid=lwlibavVideosource("S:\misc film\shorts\test.mp4") aud=lwlibavAudiosource("S:\misc film\shorts\test.mp4") audiodub(vid,aud) BlankClip(last, length=round(framerate))+last
Last edited by jagabo; 9th Aug 2022 at 18:46.
Thanks for the suggestions, will give them a try out.