View Full Version : weird mpeg1 audio issues
len0x
15th September 2004, 15:25
Not sure that its the right place to start discussion, but anyway: for about a week I'm struggling with conversion of bunch of mpeg1 files to AVI (it drives me nuts already :) ). Audio is the problem (any types of audio: original MPA(mp2) or MP3) - I can't get it in synch with video. It starts always in synch, but gradually fades away. I tried encoding/demuxing in vdubmod (directly or via DirecShowSource) bbdmux, mplayer and every time I get audio of length ~1.5 seconds less than video length. So my guess is that by the end of the playback audio is exactly 1.5 sec ahead of video (probably AVI playback feature when audio has to be exact length as video). I could probably use reclock AVI filter to get it in synch, but that's not a permananent solution for such files.
So question is what's wrong with this mpeg file and how can I fix it?
Peter Cheat
16th September 2004, 00:59
Originally posted by len0x
So question is what's wrong with this mpeg file and how can I fix it?
It looks like a frame rate issue. What is the frame rate of the mpeg? Are you encoding the AVI using the same frame rate?
len0x
16th September 2004, 11:03
Original fps is 29.970. It has duplicates every fifth frame so first I was trying to decimate(5), but then just switched to original frame rate to minimize number of failure points...
I even tried some of the encoder packages (so that VDuvMod/avisynth is eliminated from encoding process) like Dr.DivX and even WME9 - the same result.
Also if I try to process this mpeg with vcdgear with options "-mpg2mpg -fix" it says that 9 packets corrected and about 30000 padded. The result is even worse (synch wise).
eb
16th September 2004, 11:55
lenOx,
put sample on your server and pm me how to download it,
it seems to me that solution is simple assuming that audio micro drops are evenly distributed all over the mpeg file, but it will be easier for me to check it on the sample and then to make exact conclusions
eb
eb
16th September 2004, 22:14
Data from 78MB of your sample.
In this case repairs can be done by ProjectX.In the place where are some not exactly micro drops out, ProjectX is inserting additional plombs/filling frames
http://img40.exs.cx/img40/3645/lenOx.jpg
in the case that you have already processed materials to .avi you can repair it processing again in VitualDubMod playing with values from video frame rate
http://img79.exs.cx/img79/4118/lenOxA.jpg
on this picture we can see that after ProjectX video and audio are synchronized /exactly difference in length is 7miliseconds/
eb
len0x
17th September 2004, 09:56
well I have the following log from processing in ProjectX:
============================================================
=> File 0: E:\a.mpg (444773932)
=> File is MPEG-1 PS/SS (Video/Audio PES)
=> demux
-> found PES-ID 0xE0 (MPEG Video) @ 4640
-> found PES-ID 0xC0 (MPEG Audio) @ 9288
-> video basics: 352*240 @ 29.97fps @ 1.1575 @ 1150000bps, vbvBuffer 20
-> starting export of video data @ GOP#0
!> dropping GOP#1741 @ orig.PTS 00:16:17.876 (88008928)
Pics exp/cnt 18/18, inGOP PTS diff. 33ms, new Timecode 00:16:17.643
!> PTS difference of 54055 (00:00:00.600) to last GOP#1741 detected
!> dropping useless B-Frames @ GOP#1742 / new Timecode 00:16:17.643
!> dropping GOP#1831 @ orig.PTS 00:17:10.663 (92759678)
Pics exp/cnt 18/18, inGOP PTS diff. 33ms, new Timecode 00:17:09.762
!> PTS difference of 54054 (00:00:00.600) to last GOP#1831 detected
!> dropping useless B-Frames @ GOP#1832 / new Timecode 00:17:09.762
!> dropping GOP#1865 @ orig.PTS 00:17:30.182 (94516435)
Pics exp/cnt 18/18, inGOP PTS diff. 33ms, new Timecode 00:17:28.614
!> PTS difference of 54054 (00:00:00.600) to last GOP#1865 detected
!> dropping useless B-Frames @ GOP#1866 / new Timecode 00:17:28.614
!> dropping GOP#2006 @ orig.PTS 00:18:51.497 (101834754)
Pics exp/cnt 18/18, inGOP PTS diff. 33ms, new Timecode 00:18:49.261
!> PTS difference of 54054 (00:00:00.600) to last GOP#2006 detected
!> dropping useless B-Frames @ GOP#2007 / new Timecode 00:18:49.261
!> dropping GOP#3140 @ orig.PTS 00:29:30.002 (159300220)
Pics exp/cnt 18/18, inGOP PTS diff. 33ms, new Timecode 00:29:27.098
!> PTS difference of 54054 (00:00:00.600) to last GOP#3140 detected
!> dropping useless B-Frames @ GOP#3141 / new Timecode 00:29:27.098
!> startPTS of GOP#3396 is earlier than the end of last GOP.. (exp. 171939860)
!> dropping GOP#3396 @ orig.PTS 00:31:50.309 (171927848)
Pics exp/cnt 18/18, inGOP PTS diff. 133ms, new Timecode 00:31:46.871
!> PTS difference of 54054 (00:00:00.600) to last GOP#3396 detected
!> dropping useless B-Frames @ GOP#3397 / new Timecode 00:31:46.871
!> dropping GOP#3457 @ orig.PTS 00:32:24.510 (175005927)
Pics exp/cnt 18/18, inGOP PTS diff. 33ms, new Timecode 00:32:20.271
!> PTS difference of 54055 (00:00:00.600) to last GOP#3457 detected
!> dropping useless B-Frames @ GOP#3458 / new Timecode 00:32:20.271
!> dropping GOP#4197 @ orig.PTS 00:39:08.480 (211363285)
Pics exp/cnt 18/18, inGOP PTS diff. 33ms, new Timecode 00:39:03.574
!> PTS difference of 54054 (00:00:00.600) to last GOP#4197 detected
!> dropping useless B-Frames @ GOP#4198 / new Timecode 00:39:03.574
-> skip sequence_end_code following GOP#4553
-> video: fr/ ct/ 1p/ cg/ og/ dg = 76424/ 9/ 0/ 4545/ 0/ 8
-> video length: 76424 frames @ 00:42:30.010
-> GOP summary: min. 2, max. 40 fields; contains progressive frames
-> avg. nom. bitrate 1150083bps (min/max: 629600/4867200)
-> set first sequence_header bitrate to 4867200bps
===> new File: C:\DVDR\a.mpv
--> MPEG Audio (0xC0)
Audio PTS: first packet 00:00:00.232, last packet 00:42:35.311
Video PTS: start 1.GOP 00:00:00.232, end last GOP 00:42:35.588
-> adjusting audio at video-timeline
=> src_audio: MPEG-1, Layer2, 44100Hz, stereo, 224kbps, noCRC @ 00:00:00.000
-> 9 frame(s) (235ms) inserted @ 00:06:36.199
-> 8 frame(s) (209ms) inserted @ 00:14:48.267
-> 8 frame(s) (209ms) inserted @ 00:23:27.529
-> 9 frame(s) (235ms) inserted @ 00:30:56.313
-> 8 frame(s) (209ms) inserted @ 00:37:58.034
-> 9 frame(s) (235ms) added @ 00:42:29.786
audio frames: wri/pre/skip/ins/add 97618/0/0/42/9 @ 00:42:30.021 done..
===> new File: C:\DVDR\a.mp2
=========================================================
In resulting mpeg VDubMod can only see first ~10 min of the video (probably until first B-frame was dropped). Is there a way of preventing ProjectX to drop or correct those GOPs properly?
len0x
17th September 2004, 21:07
Any luck encoding, eb ? :)
eb
17th September 2004, 23:09
I was unlucky to download whole this file, i was lucky to load 78MB piece where the first audio problem appeared,
but all audio problems seems to be resolved /corrected by ProjectX .
THe last audio problem is that difference between audio and video length is 277ms, it can be solved by reprocesing in VirtualDubMod with both audio and video set to direct copying, only in video frame rate accept proposed frame rate change and in window below set again 29.97, but it can be good solution for .avi
About video it is clear that only few single GOPs will be lost/removed and it is better than keeping them there and have rather terrible artifacts in this places 600ms each.
I am affraid that nothing more better can not be done here.
eb
len0x
18th September 2004, 12:02
Finally I managed to solve the problem this way:
- video is encoded directly from mpeg file in VDubMod or via DirectShowSource in avisynth
- audio is demuxed in MPEG-VCR (Womble Multimedia)
- then mux it together
It seems like MPEG-VCR synchs audio as well, but without video processing (feature that ProjectX lacks). I even managed to decimate video with no problems, so I'm really happy now :)
P.S. weird thing - when watching original mpeg I do not see any artifacts in the video...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.