Audio drift after importing and joining MPEG2 files

Started by yetanotherlogin, March 20, 2014, 11:41:09 PM

Previous topic - Next topic

yetanotherlogin

Hello

I shot a conference with my Sony camcorder. Since it uses FAT32 for its filesystem, it created several 2GB files that I needed to join before doing a bit of editing.

When opening the file file, AviDemux detected that there were others sequentially numbered and offered to import them all, to which I agreed.

However, after playing the whole thing, I noticed an audio drift, ie. lag between audio and video. The same thing occured when trying to work with the files in Sony Vegas and LightWorks.

I only have an Atom-based laptop available, which I know is very underpowered to perform video editing, but is this lack of oomph the reason for this issue, and is there something I could do so that AviDemux can successfully join and open the files?

Thank you.

AQUAR

The audio delay is very unlikely due to the processing power of your PC.

What kind of codec/container is produced by the camcorder?
Some types of codec/container combinations are better handled with avidemux 2.5.6.

yetanotherlogin

Here's what MediaInfo says about the first MPG file:


Format                                   : MPEG-PS
File size                                : 1.98 GiB
Duration                                 : 30mn 34s
Overall bit rate mode                    : Variable
Overall bit rate                         : 9 265 Kbps

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@Main
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : M=3, N=12
Duration                                 : 30mn 34s
Bit rate mode                            : Variable
Bit rate                                 : 8 633 Kbps
Maximum bit rate                         : 9 100 Kbps
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 fps
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.833
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
Stream size                              : 1.84 GiB (93%)

Audio
ID                                       : 189 (0xBD)-128 (0x80)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Muxing mode                              : DVD-Video
Duration                                 : 30mn 33s
Bit rate mode                            : Constant
Bit rate                                 : 448 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : -80ms
Stream size                              : 97.9 MiB (5%)

AQUAR

It is a mpeg2 programs stream.
Only thing of note is that the audio is shown as advanced by 80 ms for this first part.

So first check if this audio shift is consistent for all parts?
And/Or does the audioshift remain the same throughout the joined up video?

Also for dealing with older codecs I would first try avidemux 2.5.6.

yetanotherlogin

#4
On the same host, I played one of the files in VLC without any audio shift.

Next, I relaunched AviDemux 2.6.8 and opened the same single file, and the shift shows right away.

Why does VLC play the file fine while all those video editors show an audio shift?

--
Edit: the other files show this:

Delay relative to video                  : -272ms

AQUAR

Possibly because of the way different programs deal with audio shift meta data and or time stamps.
I don't have a good grasp of this time stamp process, but avidemux creates an index file from all that timimg information.
Maybe some information is lost after demuxing.

I'll have a look if avidemux shifts audio as per meta data (probably not, also IIRC an m2p file doesn't have meta data tags).

My approach would be to recode each section separately in avidemux, using the audio shift setting to bring the video/audio into sync.
Then join all the recoded sections in avidemux.
If that didn't work I'd try remuxing to sections into another container (MKV with mkvmerge) and try again.

mean

2 possibilities :
* It is a playback issue : The processed file will be fine
* It is a timing issue : the processed file will have the same problem