I have a video that is 13 seconds long. I padded it front and back for 5 seconds with Tpad filter making the entire video 23 seconds long. I copied null audio to the front for 5 seconds so that now I have a video with 5 seconds silence(during the cloned/subtitled portion), 13 seconds original that syncs with the video. But anything I join to it moves the second videos audio up to fill the gap at the end of the first video, causing sync problems.
I have looked everywhere for some way to pad the end of the first videos 18 seconds to achieve a total of 23 seconds that matches with the video (5 seconds silence, 18 seconds original audio, 5 seconds silent audio). Nothing works since none of the hits I have found want to add at the end.
So far I have tried from examples:
apad=pad_len=1024
apad=whole_len=10000
ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT
Mediainfo says 18 seconds audio no matter what I try.
Does anyone know a way to add silent audio to the end of the first, or join a second video without losing sync as mentioned anove, preferably with ffmpeg.?
Thank you
+ Reply to Thread
Results 1 to 5 of 5
-
-
Just concat with an ACTUAL clip of silence. 2 second search found "random noise generator" online, which you could generate noise for 5 sec & save as wav file. The trick: use 0% volume.
Scott -
I'm hopeless with ffmpeg, but in Avisynth, if I understand correctly.
Audio = FFAudioSource("E:\Video.mkv")
Silence = BlankClip(Audio)
NewAudio = \
Silence.AudioTrim(0, 5.000)\
+Audio.AudioTrim(0, 0)\
+Silence.AudioTrim(0, 5.000)
return NewAudio
Foobar2000 while converting, with the Affix Silence DSP in the conversion chain (screenshot below).
Budman1,
I received your PM but haven't managed to look at your links yet. I'm finally getting over some bug I picked up and I've had a few other distractions, but I thought I'd let you know I'm not ignoring it. Hopefully by tomorrow my brain will be working again.
Cheers. -
Thank you Cornucopia. The problem with that is that my intentions are to freeze frame the 1st and last frames for 5 seconds and embed subtitles in them to be read for 5 seconds.
If I use a blank 'Clip' it will actually be a video that's added, which I did not wish. I also tried creating a silent AAC for 5 seconds but that is a lor of effort and causes encoding multiple times (one to clone, once to add silence, maybe once to add subtitles. I found a way to do all at once.
I finally, after much trial and error,found what works. My video is 13.247 seconds so I pull the stats and create the following string;
Code:ffmpeg -i "C:\Users\Bud\Documents\Applian\Replay Media Catcher\Segments\Video.mp4" -vf scale=w=854:h=480:force_original_aspect_ratio=1,pad=854:480:(ow-iw)/2:(oh-ih)/2,tpad=start_mode=clone:start_duration=5,tpad=stop_mode=clone:stop_duration=10,"subtitles='C\:\\Users\\Bud\\Desktop\\TrimNMerge\\TrimNMerge\\bin\\Debug\\work\\Subtitles.srt':force_style=FontName='Arial,PrimaryColour=&H00FFFFFF,Fontsize=30,Alignment=10'" -af "adelay=5000|5000,apad=whole_dur=23.247" -vcodec libx264 -crf 20 -b:v 400K -bufsize:v 400K -r 29.97 -acodec aac -ab 129k -ar 44.1k -max_muxing_queue_size 9999 "C:\Users\Bud\Documents\Applian\Replay Media Catcher\Segments\Subbed_Resized_5_10_Video.mp4"
Code:Only '-vf scale=w=854:h=480:force_original_aspect_ratio=1,pad=854:480:(ow-iw)/2:(oh-ih)/2,tpad=start_mode=clone:start_duration=5,tpad=stop_mode=clone:stop_durat ion=10,subtitles='C\:\\Users\\Bud\\Desktop\\TrimNMerge\\TrimNMerge\\bin\\Debug\\work\\Subtitles.srt':force_style=FontName='Arial,PrimaryColour=&H00FFFFFF,Fontsi ze=30,Alignment=10'' read, ignoring remaining -vf options: Use ',' to separate filters Only '-af adelay=5000|5000,apad=whole_dur=23.247' read, ignoring remaining -af o ptions: Use ',' to separate filters
Similar Threads
-
Audio out of sync, how to determine delay needed.
By mattstan in forum Authoring (DVD)Replies: 9Last Post: 23rd Dec 2019, 02:26 -
Audio Codec Bitrate Comparisons Help Needed
By VideoFanatic in forum AudioReplies: 22Last Post: 8th Apr 2019, 08:06 -
Crop and Pad a Blu Ray rip?
By jcwillia1 in forum Blu-ray RippingReplies: 4Last Post: 31st May 2018, 08:02 -
Low end system high end hevc compression
By Delibit in forum Video ConversionReplies: 3Last Post: 21st Jun 2016, 17:51 -
What hardware needed to capture audio from STB in 5.1?
By Wam7 in forum AudioReplies: 3Last Post: 13th Jan 2016, 15:28