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.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
-
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:
Code: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
https://ffmpeg.org/ffmpeg-filters.html#loop
https://ffmpeg.org/ffmpeg-filters.html#adelay -
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):
Code: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
Code:BlankClip(last, length=round(framerate*1.5))+last
Last edited by jagabo; 9th Aug 2022 at 18:46.
Similar Threads
-
x264 BD encodes - suddenly getting timebase mismatch with 1st pass
By TenementLady in forum MacReplies: 0Last Post: 19th Sep 2021, 05:35 -
add 5 second image to start of video
By Budman1 in forum Video ConversionReplies: 2Last Post: 10th Aug 2021, 04:47 -
Add mp4 output on x264 compile
By naoto89 in forum Newbie / General discussionsReplies: 17Last Post: 9th Jul 2020, 16:56 -
OBS Add On That Encodes Text as Barcode?
By pone44 in forum Newbie / General discussionsReplies: 0Last Post: 7th Jul 2018, 01:37 -
Is there a reason my NVENC encodes look better than my x264 ones?
By CursedLemon in forum Newbie / General discussionsReplies: 13Last Post: 20th Aug 2017, 01:59