Author Topic: Audio Sync Problems  (Read 10129 times)

JefUK

  • Newbie
  • *
  • Posts: 4
Audio Sync Problems
« on: June 04, 2013, 02:25:58 AM »
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

  • Hero Member
  • *****
  • Posts: 6051
Re: Audio Sync Problems
« Reply #1 on: June 04, 2013, 05:49:24 AM »
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

  • Hero Member
  • *****
  • Posts: 6051
Re: Audio Sync Problems
« Reply #2 on: June 04, 2013, 06:49:34 AM »
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

  • Newbie
  • *
  • Posts: 4
Re: Audio Sync Problems
« Reply #3 on: June 08, 2013, 08:13:17 AM »
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

  • Hero Member
  • *****
  • Posts: 6051
Re: Audio Sync Problems
« Reply #4 on: June 08, 2013, 09:11:23 AM »
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:
Code: [Select]
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

  • Newbie
  • *
  • Posts: 4
Re: Audio Sync Problems
« Reply #5 on: June 09, 2013, 08:56:02 AM »
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

  • Hero Member
  • *****
  • Posts: 6051
Re: Audio Sync Problems
« Reply #6 on: June 09, 2013, 09:20:42 AM »
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?
« Last Edit: June 09, 2013, 09:29:01 AM by Jan Gruuthuse »

JefUK

  • Newbie
  • *
  • Posts: 4
Re: Audio Sync Problems
« Reply #7 on: June 10, 2013, 05:37:30 AM »
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.
« Last Edit: June 10, 2013, 08:15:23 AM by JefUK »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: Audio Sync Problems
« Reply #8 on: June 10, 2013, 07:48:51 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.