VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    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
    Quote Quote  
  2. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    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
    Quote Quote  
  3. 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.
    Image Attached Thumbnails Click image for larger version

Name:	Affix Silence.jpg
Views:	9
Size:	16.6 KB
ID:	51917  

    Quote Quote  
  4. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    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"
    The stop duration of clone is 5 seconds but has to be adjusted to 10 seconds (also noted in the name) because FFMPEG uses TOTAL padding (5 front + 5 end = 10). All single quotes and double quotes are necessary or it fails. As it is it throws some kind of error about reading only the -VF and -AF and disregarding others but it works anyway. NOt sure what it means since they are separated with ',' and they are the only ones???

    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
    Quote Quote  



Similar Threads