VideoHelp Forum




+ Reply to Thread
Results 1 to 16 of 16
  1. Hi. The WMV9 video I'd like to edit is in sync when played. Unfortunately, like many a WMV, the sync goes when edited/recoded with MeGUI. I've tried all the different Indexers but nothing works so I've converted the video with Xmedia Recode using a low CQ factor. The new file is an mkv/265/AAC and plays in sync.

    I'd have thought that editing the new file with MeGUI would have been a breeze but it behaves just like the wmv – the sync goes. Any idea why this should be given that the video and audio are 'brand new'?

    And can anyone suggest how I might use avisynth on the new file so that it stays in sync? Thank you.
    Quote Quote  
  2. File could be variable framerate (VFR).

    To convert to CFR AviSynth e.g.:
    ffvideosource("source.mkv", fpsnum=30000, fpsden=1001)
    or
    DirectShowSource("source.mkv", fps=29.97, convertfps=true)

    Change fps according to your source. If you want more options/help try a forum search about variable framerate. It comes up often.

    Alternatively: extract timecodes from source and use them to remux MeGUI's output. Then file can be sync again.
    Quote Quote  
  3. How does it go out of sync when you encode it with MeGUI ? Does it start in sync and then goes out of sync after a couple minutes have passed or does it start out of sync and stay out of sync with a fixed relative delay ?
    Quote Quote  
  4. Hello sneaker and leonsk. My avisynth scripts on the original file DID have the 'convert to CFR' command but the output file always had a sync issue. Not by much, though (100ms or so) and it began very early, less than a minute into the clip.

    In the last half hour, I seem to have found a workaround based on what I described in the first post – same thing but this time instead of leaving Framerate as 'keep original', I tell xmediarecode to make it 29.970. The resultant file makes it through the MeGUI process without any problems. Nice...

    As a matter of interest, sneaker, could you expand on “Alternatively: extract timecodes from source and use them to remux MeGUI's output. Then file can be sync again.” Sounds interesting but I can't fathom the mechanics of it.

    Many thanks.
    Quote Quote  
  5. Not by much, though (100ms or so) and it began very early, less than a minute into the clip.
    Is this consistent ?

    “Alternatively: extract timecodes from source and use them to remux MeGUI's output. Then file can be sync again.”
    You should really wait for "sneaker" to elaborate on that, but in the meanwhile you can try something like this:

    1. Remux the WMV with MKVToolNix
    2. Extract the timecodes from the MKV (I use MKVcleaver for this)
    3. Encode the WMV with MeGUI
    4. When muxing to MKV you can then feed the timecodes to MKVToolNix
    Last edited by leonsk; 25th Apr 2018 at 12:48.
    Quote Quote  
  6. "Remux the WMV with MKVToolNix" - do you mean mkvtoolnix-gui.exe (which is what I use)? It always tells me that WMV is unsupported...
    Quote Quote  
  7. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Can you post the mediainfo report (text view) for the file
    Quote Quote  
  8. Well, you ignored my question regarding the consistency of that sync issue which could help to determine whether the WMV is VFR or in fact just has an initial delay.

    It always tells me that WMV is unsupported...
    I didn't know about that, I don't have any WMVs. I guess in that case you have to extract the timecodes from the original WMV, something which I've never done before.
    Quote Quote  
  9. Sorry, leonsk. Yeah, I'd say it's consistent.

    General
    Complete name : E:\0000-0358.7.wmv
    Format : Windows Media
    File size : 34.5 MiB
    Duration : 3 min 58 s
    Overall bit rate mode : Constant
    Overall bit rate : 1 213 kb/s
    Maximum Overall bit rate : 1 219 kb/s
    Encoded date : UTC 2007-02-05 10:24:41.140

    Video
    ID : 2
    Format : VC-1
    Format profile : Main
    Codec ID : WMV3
    Codec ID/Info : Windows Media Video 9
    Codec ID/Hint : WMV3
    Duration : 3 min 58 s
    Bit rate mode : Constant
    Bit rate : 1 190 kb/s
    Width : 640 pixels
    Height : 480 pixels
    Display aspect ratio : 4:3
    Frame rate : 29.970 (29970/1000) FPS
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 0.129
    Stream size : 33.8 MiB (98%)

    Audio
    ID : 1
    Format : WMA
    Format version : Version 2
    Codec ID : 161
    Codec ID/Info : Windows Media Audio
    Duration : 3 min 58 s
    Bit rate mode : Constant
    Bit rate : 16.0 kb/s
    Channel(s) : 1 channel
    Sampling rate : 22.05 kHz
    Bit depth : 16 bits
    Stream size : 467 KiB (1%)
    Quote Quote  
  10. ffvideosource("sourcefile", timecodes="whatever.txt") creates a timestamp file. To mux: https://mkvtoolnix.download/doc/mkvmerge.html#mkvmerge.external_timestamp_files

    But if delay is constant it doesn't point to VFR (except in a very strict sense of the word).
    Quote Quote  
  11. Yeah, I'd say it's consistent.
    Then apply a delay to the audio track when muxing with MKVToolNix. If there's someone talking in the WMV then use that as reference to determine whether the audio track plays earlier or later, that's what I do when the delay value from mediainfo doesn't help.
    Quote Quote  
  12. Marsia Mariner
    Guest
    Originally Posted by leonsk View Post
    You should really wait for "sneaker" to elaborate on that, but in the meanwhile you can try something like this:

    1. Remux the WMV with MKVToolNix

    mkvmerge doesn't support the ASF container
    But the DirectShow Matroska muxer from the MPC-BE filters package does.

    Anyway: there is a CLI application named WMVtimes.exe

    Code:
    WMVTIMES version 0.2 (c) 2006 by fccHandler
    
    Usage is: WMVTIMES inputfile[.asf][.wmv] [outputfile[.txt]]
    
    Dumps the time codes from a Windows Media file in Timecode format v2.
    If not given, outputfile is the same as inputfile with ".txt" extension.
    Quote Quote  
  13. Well, that's me now out of my depth... I had already tried using 'delayaudio(0.1)' but it didn't work for the whole clip. As mentioned above, encoding with xmediarecode set to ' FPS 29.970' (as opposed to 'keep original') gives me a file that CAN be put through MeGUI and stay in sync. That seems to be telling us 'VFR issue', no?

    Encoding twice – xmediarecode followed by MeGUI – is not the neatest solution so I'd be interested in learning a way to get this clip avisynthed in a single step, preferably using MeGUI as it's what I've always used. I was able to create the timestamp file using sneaker's 'whatever' command but can't work out what to do with it next – use it with toolnix, use it within an avisynth script, I just don't know. If someone could offer some tuition, that'd be great. Thanks to all for your time.
    Quote Quote  
  14. mkvmerge doesn't support the ASF container
    Already got that

    Encode the WMV using MeGUI without changing the frame rate or adding DelayAudio() to the script then mux and check the MKV to see whether the sync issue is consistent throughout the clip, if yes then I'm positive it's not VFR, and you could fix this by adding a delay to the audio track when muxing with MKVToolNix which I've described before.
    If it's not consistent then it's VFR, and you should do what "sneaker" has suggested, everything you need has been said before, just use the link in his post to add the extracted timecodes when muxing with MKVToolNix
    Quote Quote  
  15. Marsia Mariner
    Guest
    Originally Posted by pooksahib View Post
    Encoding twice – xmediarecode followed by MeGUI – is not the neatest solution so I'd be interested in learning a way to get this clip avisynthed in a single step, preferably using MeGUI as it's what I've always used.
    "single step"
    "preferably using MeGUI"

    Not always that's possible, and you really should prepare yourself to do without the one-click wonders.
    Since your source is an ASF file, the zer0th step must be this: convert the audio to an uncompressed WAV file with Lord_Mulder's wma2wav.exe.

    Then, find and use an Avisynth "method" (FFVideoSource, DirectShowSource on a .GRF file, whatever) that gives you a correct CFR video sequence.

    Now, apply WAVSource() to the WAV file and combine it with the video sequence through AudioDub().
    Test the Avisynth script in VirtualDub and make sure there is no sync issue.

    Now you can encode the video, then encode the WAV file, and finally mux the elementary streams with MKVtoolnix, MP4Box, ffmpeg, etc.
    Last edited by Marsia Mariner; 25th Apr 2018 at 22:00. Reason: add emphasis
    Quote Quote  
  16. OK, one step at a time. Where can wma2wav be found? It's not in this list (I always try to get my software from this forum as then I know it's good):
    https://www.videohelp.com/software/sections/audio-encoders
    Quote Quote  



Similar Threads

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