Hi guys,
I've been spending days trying to convert a captured MPEG2 video with a .mp2 audio file (MPEG audio version 1, layer 2, which MediaInfo says is CBR although I'm not completely sure about that), with no success in getting synchronized videos. The audio synchronism is getting lost progressively, but not in the same way all the time, since I've even tried to change the video fps to get the synch back (even if I have to interpolate) and I can get some scenes synchronized but not all of them. I'm just getting crazy with that, I don't know what else can I do. I've read there are many problems synching VBR audios, so I thought that could be my problem.
It looks like I have this sync problems after creating the DGIndex, since when I open it I loose this synchronism. I'm not very good with avisynth, so one of the scripts I've used is:
video=DGDecode_mpeg2source("Cinta num 3.d2v", info=3)
audio=MPASource("Cinta num 3 3 Tc0 L2 2ch 48 224 DELAY 0ms.mp2", normalize = false)
audiodub(video,audio)
Before doing that, I was converting this mp2 file to wav and then add it in virtualdub/virtualdubmod, but also without luck.
I've also tried many options in DGIndex. Again, no luck. Also there are some threads here talking about that, but I could not solve my problem with them. That might also be because many of this threads start with AVI videos, and I have to use first this DGIndex file that looses my synchronism.
Can anyone help me with that? I'll really appreciate it, since really need to convert that and I don't know what else to do
Thanks!!
+ Reply to Thread
Results 1 to 30 of 42
-
Last edited by mahonni; 31st Mar 2011 at 20:07. Reason: some extra info
-
Then stop using it.
You are converting MPEG2 clips to xvid or divx?
Drag the video clip into VirtualDub or AviDemux and output to whatever you need. Don't over-complicate things. -
Impressive, Baldrick, I was totally hopeless and now you made my week
. I had tried many many tools to fix this file, all options in DGIndex and almost everything, but not Videoredo. Great tool, I wasn't expecting to solve it that fast!
Thanks again for that!!
Thank you for your advise, but I had already tried that with no success.
I needed Avisynth at least to load the indexed mpg file in Virtualdub, since it doesn't accept mpg2. I'm not very good with it, but spending a lot of time I was able to adjust color, levels, remove some dirt and noise and stabilize the image, which is all I want to do to repair my old Video8 captures. I only know how to do that with Avisynth, so I needed to use it. The only problems were the sync issues, which were also not fixed with AviDemux, even trying all the fixing options I found there.
The fix tool in Videoredo worked perfectly, and now all programs can encode without synchronizing problems -
You don't need any external tool, you can open MPEG-2 directly in VirtualDub + MPEG-2 input plugin.
The latest version of VirtualDub support every version of MPEG audio and it support also VBR audio.Codec Toolbox RS (A tool to read/change merit of codecs and many other things) -
Thanks for noting that, I was aware of an old version that had this MPEG compatibility, but it gave me problems with long movies, saying it was out of memory and I thought there was no solution to that. Now, with this plugin I can open it perfectly.
I still need to first fix the movie with videoredo before opening it with virtualdub if I don't want to have sync problems. -
You should be fine, since you are using mpeg2source . The comment was directed at the above posters
It's not a colormatrix issue, it's an interlaced chroma issue . Jagabo has explained / illustrated it in several threads
https://forum.videohelp.com/threads/316415-Check-Over-My-Options-From-DVD-to-XviD-Conve...65#post1958565
another non-anime example
https://forum.videohelp.com/threads/322848-Scripts-and-filters-for-an-Opera-(sample-vid...=1#post2000643 -
Does the bug still happens with the latest version of VirtualDub?
Does it happens also when opening the file directly or only by feed interlaced YV12 from AviSynth?
(I'm talking only about VirtualDub because VirtualDubMod is dead)Codec Toolbox RS (A tool to read/change merit of codecs and many other things) -
yes it still occurs when opening interlaced mpeg2 4:2:0 directly , the author is aware. It's not a "bug" technically - he's doing it correctly according to fourcc YV12 specs and many programs handle interlaced 4:2:0 content like that - by the book. Avidemux does too , as do many retail programs. Because technically, YV12 is a progressive format only.
no it doesn't occur with interlaced YV12 when feeding though avisynth and dgdecode.dll, because the issue is with the mpeg2 decoder
EDIT: ^sorry this is not correct , the issue is with vdub's interlaced YV12 => RGB conversion, not the decoderLast edited by poisondeathray; 3rd Apr 2011 at 14:04.
-
In the first link you posted I see: "But if you feed it interlaced YV12 from AviSynth it will not be handled correctly"
Do you refer to VirtualDub-MPEG2 or VirtualDub + MPEG2 input plugin?
It is different.
Also do this happen with interlaced MPEG1?
PS: Do you have a small example file with the problem easily visible?
PS2: The latest test version (1.10.1 test 7) of VirtualDub support a lot more color depths =>Last edited by ale5000; 3rd Apr 2011 at 15:39.
Codec Toolbox RS (A tool to read/change merit of codecs and many other things) -
yes, it's been reported many times over the years . Do a search, this topic comes up every month or so. Avery Lee is aware, and technically is correct according to fourcc (even though it looks bad) , so I understand his reasoning , even though many will disagree , but few will argue with observations of the end results.
in the 2nd link is a mpeg2 file you can download to test for yourself (red guitar on a blue shirt)
vdub-mpeg2 works fine, as does vdubmod for direct interlaced mpeg2 input. The issue is with vdub + mpeg2 input plugin and interlaced mpeg2 video. I don't know about interlaced mpeg1 , but I suspect it's the same
"But if you feed it interlaced YV12 from AviSynth it will not be handled correctly"
In the 1st post this was referring to vdubmod
I haven't tested with the latest beta/test version with the different chroma positions in your last screenshot, only the stable versions. If there are options for chroma placement in that beta version, that might "fix" it.Last edited by poisondeathray; 3rd Apr 2011 at 13:19.
-
The test version is here: http://forums.virtualdub.org/index.php?act=ST&f=15&t=19755
There is Video => Color Depth => Other
If the problem is in the MPEG-2 decoder, then it should be reported to the author of the decoder (fccHandler) and not to the author of VirtualDub (Avery Lee).
Or I'm missing something?Codec Toolbox RS (A tool to read/change merit of codecs and many other things) -
They both are aware . They argue it's not a problem.
. And "technically" they are correct. This is not a new issue. It comes up every month or so... for at least 2-3 years... do a search
I took a quick look and the "problem" still exists with 1.10 beta with various color depth selections.
You can test it for yourself. Open that test video in the 2nd link, side by side with vdub & vdubmod , or with vdub + avisynthLast edited by poisondeathray; 3rd Apr 2011 at 13:34.
-
It would be interesting to see if it happen also with the internal mpeg-1 import filter (instead of a separate input plugin) of VirtualDub but it need someone posting an interlaced mpeg1 video.
PS: You can use both the internal MPEG-1 import filter and the MPEG-2 input plugin to open MPEG-1 videos.Codec Toolbox RS (A tool to read/change merit of codecs and many other things) -
Sorry I should clarify i made a mistake: this issue is not the import decoder specifically, but the way vdub handles the interlaced YV12=>RGB conversion , the way it upsamples the chroma . This affects when you look at the display or use filters (because converted to RGB for display or using filters). Vdubmod and vdubmpeg2 handle the upsampling and chroma placement differently
In avisynth, you can specify the matrix (pc vs. rec, 601 vs.709) and whether or not it' s interlaced or not . The interlaced sampling is what we are talking about here
e.g.
MPEG2Source()
ConvertToRGB(matrix="rec601", interlaced=true)
I can make an interlaced MPEG1 test video if you want, but I suspect it will be the same . Remember this isn't unique to vdub, it happens with a lot of other programs -
I'm mainly interested in VirtualDub, not in other programs.
Since in the latest test version you can specify rec601 interlaced if the problem still happen then it is a bug.
Or I'm wrong?Codec Toolbox RS (A tool to read/change merit of codecs and many other things) -
it is not a "bug", technically
it's "chroma upsampling error" or CUE - google it, it's discussed frequently
if you do the RGB conversion in avisynth, specifing it's interlaced, the "error" does not occur. If you let vdub do the RGB conversion, error occurs
The "error" I'm talking about "CUE" is the ugly notching along color borders
This is because interlaced YV12 is upsampled to RGB as progressive (instead of interlaced) , because YV12 according to the specs , is progressiveonly. Whenever you do interlaced sampled as progressive, or progressive sampled as interlaced, you get CUE
Since in the latest test version you can specify rec601 interlaced if the problem still happen then it is a bug.
Or I'm wrong?
rec601/709 has nothing to do with the interlaced vs. progressive sampling. This specifies the coefficients for YUV<=>RGB conversions (the math equations)
To re-iterate, the issue is with vdub's handling of interlaced YV12 (so it can be anything interlaced YV12, not just MPEG2). It upsamples the chroma as progressive, so you get CUELast edited by poisondeathray; 3rd Apr 2011 at 14:35.
-
Codec Toolbox RS (A tool to read/change merit of codecs and many other things)
-
It doesn't have an interlaced RGB option . YCbCr is the same colorspace (Y'CbCr is the digital equivalent of YUV, for all intents and purposes they refer to same thing). CUE only occurs when there is upsampling error (interlaced YV12 4:2:0 upsampled to RGB 4:4:4 as progressive, not interlaced , or vice-versa: progressive YV12 upsampled as interlaced)
Since FourCC specifies YV12 as progressive only....that's where the problem occurs. Vdub upsamples it as progressive for everything, even interlaced content -
Look at the second image, altough it isn't completely equal to VirtualDubMod, the upsampling error doesn't happen.
VirtualDubMod:
VirtualDub 1.10.1 - YCbCr (Rec.601) - Range Limited - 4:2:0 - interlaced:
VirtualDub 1.10.1 - Autoselect:
Codec Toolbox RS (A tool to read/change merit of codecs and many other things) -
im getting completely different results than you ; I cannot replicate your 2nd screenshot with vdub
I had been using 1.10 , not 1.10.1 as in your download link, but I check that version and it doesn't make a difference, it's still sampled incorrectly
vdub 1.10.1 YCbCr/limited/601/4:2:0/interlaced
vdubmod
EDIT: ok i see, try a different frame, like scrub to 113 or 114 and you'll see the difference. The frame you chose didn't show differences as muchLast edited by poisondeathray; 3rd Apr 2011 at 15:15.
-
Try like this:
Options => Preferences => Display => Disable "Use DirectX overlay surfaces".
(test-2) Defaults: DirectX hardware video overlays are now disabled by default to avoid color space issues and driver bugs.
Then Decompression format => Other... => YCbCr (Rec.601) Limited 4:2:0 interlaced
Then Output format => Same as decompression format
Now open the video in VirtualDub.Codec Toolbox RS (A tool to read/change merit of codecs and many other things) -
I don't know why it isn't working for you but I still get correct results with frame 113 and 114.
Have you changed the color depth before (and not after) opening the video in VirtualDub?Codec Toolbox RS (A tool to read/change merit of codecs and many other things) -
It's producing a grey screen now (no picture)
If I change color depth to autoselect, and reopen file, it works as before (still b0rked chroma)
Even if i save as default, close & restart application
I'm using: MPEG2 Plugin Version 4.0 (August 14, 2010), VirtualDub-1.10.1-test7
Maybe something else setup differently ? I tested on 3 different computersLast edited by poisondeathray; 3rd Apr 2011 at 15:46.
-
"It's producing a grey screen", then press play and stop, now you can move from one frame to another correctly.
So now the bugs are:
- Autodetect doesn't work correctly
- With some color depth it start with grey video until you press play
- It cannot change color depth when the video is already opened in some casesCodec Toolbox RS (A tool to read/change merit of codecs and many other things)
Similar Threads
-
DVD to MPEG2 Transport Stream audio sync problem
By elba in forum Video Streaming DownloadingReplies: 12Last Post: 23rd Oct 2008, 02:09 -
Help! VirtualDub video/audio out of sync when enconding MPEG2 to XVID
By kbal in forum Video ConversionReplies: 6Last Post: 19th Dec 2007, 15:05 -
i'm trying to convert a mpeg2 file to an mp4-audio is out of sync!
By cduval04 in forum Video ConversionReplies: 1Last Post: 22nd Oct 2007, 16:56 -
How is done the sync between audio and video in a MPEG2-VOB file stream
By rmanal in forum EditingReplies: 0Last Post: 22nd Aug 2007, 09:33 -
Audio sync problems
By jelockwood in forum ffmpegX general discussionReplies: 1Last Post: 30th Jul 2007, 12:03