News:

--

Main Menu

Audio Sync Problems

Started by JefUK, June 04, 2013, 02:25:58 AM

Previous topic - Next topic

JefUK

I an a new to AVIdemux, and find the program very useful, much better than other similar programs that I have tried.

I am using version 2.6.4 to demux HD TV and SD TV Transport Stream files to MP4 and MPG respectively. The original Transport Streams all play with video and audio perfectly in-sync.

The SD Transport Streams (MPEG video, MP2 audio) demux to MPG Program Stream with the audio remaining correctly in-sync. The audio remains in-sync irrespective of whether the video is trimmed or not.

Demuxing HD TV Transport Stream files produces MP4 Program Stream files with significantly out-of-sync audio. The HD files have H264 video and AAC audio, and when converted to MP4 have an audio delay of 500ms. However, if the start of the same video is trimmed the required correction to audio delay changes to a different value, usually between +500ms and -500ms.

Jan Gruuthuse

What container are you recording in, when using copy for both video/audio what audio track have you selected as track 0? If this would be an AC3 that could explain. Audio delay = on your computer or other hardware: flatscreen mediaplayer: usb, dlna, .... ?
What is your workflow? This would be the prefered way: demo trim/cut/edit video 2.6 branch way

Jan Gruuthuse

if you are using digital out on your computer (hdmi/spdif) check against analog stereo out. If digital audio is out of sync against analog stereo: hardware related.

JefUK

Jan, thanks for your help.

The characteristics of the HD files from the Humax, as analysed by MediaInfo:

------------------------------------------------------------------------------------------------------------------------
General
ID                                       : 16520 (0x4088)
Complete name                            : D:\Users\John\Videos\Misc Videos\Young Margret_20130427_2117.ts
Format                                   : BDAV
Format/Info                              : Blu-ray Video
File size                                : 3.57 GiB
Duration                                 : 1h 14mn
Overall bit rate mode                    : Variable
Overall bit rate                         : 6 847 Kbps

Video
ID                                       : 101 (0x65)
Menu ID                                  : 17472 (0x4440)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Format settings, GOP                     : M=8, N=24
Codec ID                                 : 27
Duration                                 : 1h 14mn
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio #1
ID                                       : 102 (0x66)
Menu ID                                  : 17472 (0x4440)
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Muxing mode                              : LATM
Codec ID                                 : 17
Duration                                 : 1h 14mn
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Delay relative to video                  : -884ms
Language                                 : English

Audio #2
ID                                       : 106 (0x6A)
Menu ID                                  : 17472 (0x4440)
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : HE-AAC / LC
Muxing mode                              : LATM
Codec ID                                 : 17
Duration                                 : 1h 14mn
Channel(s)                               : 1 channel
Channel positions                        : Front: C
Sampling rate                            : 48.0 KHz / 24.0 KHz
Compression mode                         : Lossy
Delay relative to video                  : -620ms
Language                                 : English
Language, more info                      : Visual impaired commentary

Text
ID                                       : 105 (0x69)
Menu ID                                  : 17472 (0x4440)
Format                                   : DVB Subtitle
Codec ID                                 : 6
Duration                                 : 1h 14mn
Delay relative to video                  : 3s 929ms
Language                                 : English

Menu
ID                                       : 100 (0x64)
Menu ID                                  : 17472 (0x4440)
Duration                                 : 1h 14mn
List                                     : 101 (0x65) (AVC) / 102 (0x66) (AAC, English) / 106 (0x6A) (AAC, English) / 105 (0x69) (DVB Subtitle, English) / 110 (0x6E) () / 111 (0x6F) () / 150 (0x96) () / 130 (0x82) ()
Language                                 :  / English / English / English
Service name                             : BBC TWO HD
Service type                             : advanced codec HD digital television
UTC 2013-04-28 00:20:00                  : en:òvtØ;'!Éà^;Ã,¨úÝ00 / en:âã|]íüsÉ0èÃ,¸Gì   Ã,½QSâ„¢Ãâ€"Ã,¿Ãâ€"_Ãâ,¬Ã’Ã,Ã…   QÃ,¼Vp / sports /  / 02:00:00 /
UTC 2013-04-28 02:20:00                  : en:Ã,°Ã¤Ã,¨ÃŽÃ,ºp / en:Íä>Ø;^ââ,¬Â°Ã¢â,¬Å¡fS}*0 / Ã,©Ã¼sÃ,¹ÃŽÃ,¢Ã¾Ã‚ÃŽ / undefined /  / 02:40:00
UTC 2013-04-28 13:20:00                  : en:òvtØ;'!Éà^;Ã,®â‚¬ / en:/sø{6ÛÃ,±Ã‰Ã,·IDÝÃ,»ýÃ,7ââ,¬â€œÃ,¼gÃ...½{H;ëø1Ã,°HêÃ,Ã¢Ã,³â‚¬ / sports /  / 03:40:00 /
--------------------------------------------------------------------------------------------------------------------------------------------------------

Originally I was selecting both audio streams, but now selcting just Audio #1. The audio is still out of sync but by a different amount. The amount the audio is out of sync varies with different players (WMP12 and PowerDVD9).

If I Copy the video stream but convert the audio to AC3 and output into an MPEG TS container the audio is perfectly in sync. I can stream this by DLNA to 2 TV's over a LAN with perfect sync.

I am using analogue audio out not digital audio.

Jan Gruuthuse

Think  HE-AAC / LC is causing your issue? Weird stuff humax is doing? Is this DVB-T or DVB-C or DVB-S2? Do you have choices in how humax is recording?
Perhaps upload a 5 second recording and provide a publicly available link to it? Developer could have a look at it. And see if there is an issue that could be fixed?

Yeah doing same thing here: trimming front and back, removing blocks, keeping .TS fomat, dumping on NAS (n4100pro) and dlna twonky to samsung flatscreen **40B models. I can keep AC3 and MPEG Audio as it is.
Openpli 3.0 on xp-1000 dvb-s2:
General
ID                                       : 2050 (0x802)
Complete name                            : /media/0ToProcess/0xp1000/20130605 1945 - BBC Two HD - Coast.ts
Format                                   : MPEG-TS
File size                                : 3.48 GiB
Duration                                 : 59mn 58s
Overall bit rate mode                    : Variable
Overall bit rate                         : 8 307 Kbps

see rest in attached file:

JefUK

There is no control over how the Humax records the video, I believe it is just a copy of the DVB-T2 transport stream.

I have uploaded a short trimmed MP4 clip here: https://www.box.com/s/yykqoo6qswq5ln4oqmn0, which demonstrates the out-of-sync which is typical of MP4 files that contain AVC video and AAC audio (single stream)

Jan Gruuthuse

#6
Better to upload original 5 seconds mpeg-ts. Nothing much a developer can do with changed material.
With VLC hard to notice delay if at all, seems to match with his nervous nose tick? core I7 ubuntu 12.04 LTS nvidia GT-520 (OpenGL GLX video output (XCB))
Perhaps check VLC statistics if decoding/decompression issue?

JefUK

#7
Jan, you are absolutely right. I have just downloaded VLC which plays the clip with the audio in-sync! PowerDVD has never given similar problems before.

Thanks for your help.

PS.

VLC appears to be the only application that will play a AVIIDemux  "copy" into .mp4 with in-sync audio. WMP12, PowerDVD12, and Pinnacle Studio 16 all play with out-of-sync audio.

Jan Gruuthuse

Quote from: JefUK on June 10, 2013, 05:37:30 AM
VLC appears to be the only application that will play a AVIIDemux  "copy" into .mp4 with in-sync audio. WMP12, PowerDVD12, and Pinnacle Studio 12 all play with out-of-sync audio.
Check if these using the same audio interface/device as VLC.