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.
+ Reply to Thread
Results 1 to 16 of 16
-
-
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. -
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. -
Not by much, though (100ms or so) and it began very early, less than a minute into the clip.
“Alternatively: extract timecodes from source and use them to remux MeGUI's output. Then file can be sync again.”
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 MKVToolNixLast edited by leonsk; 25th Apr 2018 at 12:48.
-
"Remux the WMV with MKVToolNix" - do you mean mkvtoolnix-gui.exe (which is what I use)? It always tells me that WMV is unsupported...
-
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... -
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%) -
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). -
Yeah, I'd say it's consistent.
-
Marsia MarinerGuest
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.
-
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. -
mkvmerge doesn't support the ASF container
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 -
Marsia MarinerGuest
"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
-
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
Similar Threads
-
MKV and AVISynth: aspect ratio problems!
By billyboy12 in forum Video ConversionReplies: 26Last Post: 15th Jul 2016, 17:57 -
MKV to WMV conversion
By ironape in forum Video ConversionReplies: 1Last Post: 27th Feb 2015, 04:59 -
Mux WMV to MP4/MKV
By PrinceSwaraj in forum Video ConversionReplies: 10Last Post: 24th Sep 2014, 10:46 -
Best way to open an mkv with avisynth for deinterlcing
By ROBO731 in forum Video ConversionReplies: 13Last Post: 27th Oct 2013, 17:29 -
Is there are program like MKV Merge for WMV files?
By KyleMadrid in forum Newbie / General discussionsReplies: 7Last Post: 17th May 2013, 21:17