VideoHelp Forum

+ Reply to Thread
Results 1 to 11 of 11
Thread
  1. Member
    Join Date
    Aug 2022
    Location
    Long Island, NY
    Search PM
    EDIT - RESOLUTION is I'm an idiot. Your answer isn't here, unless you are possibly looking at the wrong output file? Double check it. Are you sure you're looking at the right output file? Duh.

    ------

    I've been using AVIsynth and ffmpeg to convert some old music videos that were on a bunch of videocassettes. I create one two-hour capture file, then just use the Trim(xxx,xxx) command through AVIsynth to encode only the section of video/audio that I want.

    Before today, when I ran ffmpeg - whether using atrack through avisynth or inputting as a separate file - the audio and video used to be sync'd up to the trimmed video segment. It worked like this for years. I didn't have to do anything, it just matched the audio to whatever video section I "trimmed" in the avisynth file.

    Starting today, when encoding a video file trimmed in avisynth, the audio always starts at the beginning of the capture/source track instead of starting at the beginning of the trimmed section.

    I even tried to use some of my old scripts that worked, and they no longer work.

    Any idea what I could have done? The only functional files I think I overrode today were FFTW and a few plugins.

    Thanks for any leads.
    Last edited by spg900ny; 20th Sep 2022 at 01:25.
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Post your complete script and FFmpeg command
    Last edited by davexnet; 19th Sep 2022 at 23:31. Reason: typo
    Quote Quote  
  3. Member
    Join Date
    Aug 2022
    Location
    Long Island, NY
    Search PM
    Sample AVS script (video1.avs):
    Code:
    LoadPlugin("D:\VIDEOTOOLS\avisynthuniv\AVSPLUS370_x64\plugins\D2VSource.dll")
    DirectShowSource("D:\VIDEOTOOLS\capture1.avi")
    ConvertToYV12(interlaced=true)
    AssumeTFF()
    QTGMC( Preset="Slow" )
    nnedi3_rpow2(rfactor=2, cshift="spline64resize",fwidth=1440,fheight=1080)
    Crop(4,4,-4,-16) 
    AddBorders(4,4,4,16) 
    Levels(10, 1, 245, 2, 255)
    LimitedSharpenFaster(Smode=4, strength=75) 
    Trim(42605,55205)
    Sample ffmpeg command:
    Code:
    ffmpeg -i "D:\VIDEOTOOLS\video1.avs" -i "D:\VIDEOTOOLS\capture1.avi" -map 0:0 -metadata title="The Gits - Seaweed" -metadata:s:v:0 language=eng -c:v libx265 -crf 18 -preset slow -map 1:a:0 -metadata:s:a:0 language=eng -c:a aac -b:a 256k "C:\Users\volsw\Desktop\The Gits - Seaweed.mkv"
    Quote Quote  
  4. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    AS you have probably guessed the problem is in the ffmpeg command.
    why are you opening the script and the original file in the command?
    Quote Quote  
  5. Member
    Join Date
    Aug 2022
    Location
    Long Island, NY
    Search PM
    I did that because it's a recycled script from a DVD upscale/encoding I did with dual audio tracks and I was lazy and just kept a similar ffmpeg command. I did also try the following command earlier tonight (using FFmpegSource2 and atrack=1 as source line in avisynth) and it did the same thing. I thought since I was specifying the trim of audio and video together in avisynth, it might work - even though this has never been an issue in the past using the original video file for the audio input.

    Code:
    ffmpeg -i "D:\VIDEOTOOLS\video1.avs" -map 0:0 -metadata title="The Gits - Seaweed" -metadata:s:v:0 language=eng -c:v libx265 -crf 18 -preset slow -map 0:a:0 -metadata:s:a:0 language=eng -c:a aac -b:a 256k "C:\Users\volsw\Desktop\The Gits - Seaweed.mkv"
    ^^ does the same thing
    Quote Quote  
  6. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    It works fine for me with your modified FFmpeg line.

    Directshowsource is known not to be frame accurate and is not recommended.
    Quote Quote  
  7. Member
    Join Date
    Aug 2022
    Location
    Long Island, NY
    Search PM
    Thanks. Will stick with FFmpegSource from now on if I can. Still not sure why this issue is happening, but I guess good to know it works for you.

    Maybe I should re-install everything. Ugh.
    Quote Quote  
  8. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    The version of FFmpegsource I had was 32-bit, so this worked fine with the 32 bit version of FFmpeg

    Code:
    LoadCPlugin("C:\Program Files (x86)\AVStoDVD\Lib\ffms2.dll")
    Aud = FFAudioSource("C:\Users\davex\Desktop\alone.mpg", track=-1)
    Vid = FFVideoSource("C:\Users\davex\Desktop\alone.mpg", track=-1, fpsnum=2997, fpsden=100, colorspace="YV12", seekmode=0)
    audiodub(vid,aud)
    Quote Quote  
  9. Member
    Join Date
    Aug 2022
    Location
    Long Island, NY
    Search PM
    That worked, and in putting the script together as you had listed, I realized my error.

    I usually write output to that VIDEOTOOLS directory with my ffmpeg script. When I looked at the script again, I realized at some point I had switched the output file to my Desktop.

    I've been looking at the wrong output file this whole time. I must have made a mistake at some point, and then when I went to fix it, I changed the file location.

    Sorry to have wasted your time. I'm going to edit the subject if I can. Thanks for helping.
    Quote Quote  
  10. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    You're welcome. Sometimes all it takes is another set of eyes
    to create some discussion and get to the bottom of it
    Quote Quote  
  11. Member
    Join Date
    Aug 2022
    Location
    Long Island, NY
    Search PM
    Really appreciate it. Cheers.
    Quote Quote  



Similar Threads