VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. Member
    Join Date
    Mar 2010
    Location
    Berlin
    Search PM
    Hey

    I am using the actual versions of VirtualDub and AviSynth + ffmpeg.

    For videos with variable bit rate audio streams I am using this script:

    Code:
    ffmpegsource2("E:\video.avi", atrack=-1)
    ConvertToYV12()
    With this, the file gets opened in VDub without problems. I can select frames and render without asynchronity issues and other problems. But very often, I get an error, which causes I have to reload the AVS to be able again to edit the video in VDub. The Error gets displayed in the status bar of VDub:

    "Error reading source frame 3801: Avisynth read error: CAVIStreamSynth: System exception - Access Violation at 0x201f8d0, readin"

    This happens with all formats and codecs, but only with those using VBR audio. And it does not happen replicable. Sometimes it happens on frame 10000, the next time on frame 550, next time on 3844... . I don't get errors at renderings, only if I edit the video / jump around with the frame bar.

    I hope you can help me as this is the only way I got VBR audio synchron with VDub...
    Image Attached Thumbnails Click image for larger version

Name:	2011-07-27 21-51-10_.png
Views:	353
Size:	12.9 KB
ID:	7953  

    Quote Quote  
  2. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by klischee View Post
    I hope you can help me as this is the only way I got VBR audio synchron with VDub...
    There is another way:

    Code:
    AVISource("E:\video.avi")
    EnsureVBRMP3sync()
    It keeps sync (and not just for MP3), but any time you jump along the timeline it has to seek through from the beginning, so it can take several seconds before it's ready to play.

    So I also often use ffmpegsource2() when I need to fiddle around with trims and audio, as it's much more responsive.

    Too much zipping back and forth though seems to overflow the Avisynth cache (my guess) and then you get the crashes you noticed. So just save your script after every change and restart if it crashes.
    Quote Quote  
  3. Member
    Join Date
    Mar 2010
    Location
    Berlin
    Search PM
    Thanks for your support. I will check this for the next video the error occurs, the last one I edited in AviDemux. You'll hear from me if your solution does not help :P
    Quote Quote  
  4. Member
    Join Date
    Mar 2010
    Location
    Berlin
    Search PM
    Originally Posted by AlanHK View Post
    Code:
    AVISource("E:\video.avi")
    EnsureVBRMP3sync()
    It keeps sync (and not just for MP3), but any time you jump along the timeline it has to seek through from the beginning, so it can take several seconds before it's ready to play.
    This only works for avi?

    I still have the problem, but as I also work a lot with other input file types than only avi, this does not really help.
    Quote Quote  
  5. what version of ffms2 ? try updating to the latest if you are not using it already

    If it only occurs on VBR audio files, you can try converting those to CBR first
    Quote Quote  
  6. Member
    Join Date
    Mar 2010
    Location
    Berlin
    Search PM
    I use the latest (r517)

    Do you mean I should convert (reenocde) the whole vid before I edit it, or do you mean an AVS on-the-fly-convertion?
    Quote Quote  
  7. I mean stream copy the video, but re-encode the audio using a different decoder, maybe to wav. And then use avisynth on that new video

    ffms2 has known isses with non linear seeks (if you're moving all over the place) with MP3 and AC3 (because of ffmpeg)

    from the documentation:
    Seeking should be sample-accurate with most codecs in AVI, MKV, MP4 and FLV with two notable exceptions, namely MP3 and AC3 where FFmpeg's decoders seem to be completely broken (with MP3 in particular you can feed the decoder the same encoded data three times in a row and get a different decoded result every time). Still, results should usually be "good enough" for most purposes. Decoding linearly will almost always work correctly.
    You can also try seekmode=0, it might help, but navigation will be slower

    ffmpegsource2("E:\video.avi", atrack=-1, seekmode=0)
    Quote Quote  
  8. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by klischee View Post
    Originally Posted by AlanHK View Post
    Code:
    AVISource("E:\video.avi")
    EnsureVBRMP3sync()
    It keeps sync (and not just for MP3), but any time you jump along the timeline it has to seek through from the beginning, so it can take several seconds before it's ready to play.
    This only works for avi?
    Why would you think that?

    It works for any input.

    Once I worked that out I was able to cut and join (using Trim and ++) with gay abandon and keep sync.


    Originally Posted by poisondeathray View Post
    You can also try seekmode=0, it might help, but navigation will be slower

    ffmpegsource2("E:\video.avi", atrack=-1, seekmode=0)
    I'm pretty sure that seekmode setting is the same effect as EnsureVBRMP3sync() (which is not only for MP3).

    Also I rarely have any sync issues with ffms2.
    It may help to use
    FFmpegSource2("E:\video.avi",atrack=-1,fpsnum=-1,fpsden=1)
    which locks down the framerate. (The -1 gives you the default rate read from the file, you can override that if you want, or need to adjust it slightly.)
    Last edited by AlanHK; 20th Aug 2011 at 11:40.
    Quote Quote  
  9. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by poisondeathray View Post
    You can also try seekmode=0, it might help, but navigation will be slower

    ffmpegsource2("E:\video.avi", atrack=-1, seekmode=0)
    I'm not sure that seekmode has any effect on audio.
    Note that seekmode is passed to ffvideosource, but not to ffaudiosource.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!