View Full Version : .M2TS audio delay
Ghitulescu
17th December 2009, 09:39
I'm not sure where this thread belongs to, here - because it concerns a DVB stream or in (HD) DVD & Blu-ray authoring - because that's the intended target.
My problem is again the audio delay. Most DVB sources I have feature an audio delay of -100 to -1200ms.
So, I intend to work the .M2TS files to extract audio, video and subtitles for authoring a BD5 or BD9. If it were only 1 audio (SDTV in .TS format) no problem at all, because most programs know how to deal with one video (MPEG-2) and one audio (MPEG-1 bzw. AC-3). I did that for 6-7 years now.
However, dealing with HDTV in .M2TS kills me. Very few programs know how to work with .M2TS (atention - keeping all the audio and subtitles) and the .M2TS->.TS converters reset the audio delay of the source without actually change anything.
Is there any .M2TS (192) -> .TS (188) converters that keep track of the audio delay? I mean either correct it or passes it to the destination?
Or is there any software (like tsmuxer) that can take an .M2TS source and demux all streams, having regard to the audio delay? I notice that tsmuxer knows the audio delay and apparently passes it as a parameter but nothing happens.
Or or or ... I'm open to any suggestion ....
midnightsun
17th December 2009, 10:48
In my experience tsmuxer handles the audio delay in a proper way (I don't think it has ever changed its behavior in that regard) at least in remux mode with HD(avc) ts(188) files, i.e. when it finds a negative audio delay it cuts the stream at the beginning so that it gets as close as possible to zero, but you seem to claim it doesn't so further testing would need to be done.
Ghitulescu
17th December 2009, 11:26
Actually, all the problems began with firmware 1.0.04, when Humax changed the normal .TS format to the .M2TS one. My iCord came with 1.0.17 so I cannot tell whether before was easier or not, nevertheless there are very few programs that can understand .M2TS.
Well, I did yesterday a test with an .M2TS recording from ARTE HD (1 video H.264 720p50, 3 audios (2 MP2, 1 AC3), 1 DVB SUB and 1 TXT SUB). All three languages were asynch. The delay was about -1100ms for one and about -1000ms for the other.
I'll do some tests myself over the weekend, but I'm rather hopeless ...
If I'll keep only 1 audio and 1 video - there are myriads of softwares that can do this ...
midnightsun
17th December 2009, 11:38
Could you try remuxing m2ts(192) to ts(188) with tsremux (it will keep all audio streams, not sure about subs if you're interested in those as well) and then use tsmuxer on the new file? That way if tsmuxer's behavior is consistent with ts files you should be able to do what you're trying to
b66pak
17th December 2009, 18:26
is there any software (like tsmuxer) that can take an .M2TS source and demux all streams, having regard to the audio delay?
use eac3to to demux .m2ts (it will correct any audio delay)...then use tsmuxer to mux to .ts...
_
L.E. if the source is unclean use something as ts doctor to fix it before demuxing!
_
Ventolin
18th December 2009, 08:11
Hi Ghitulescu,
TSPE should be able to do this, you can convert .m2ts to .ts by stripping the extra headers and / or demux at the same time. Everything should still be in sync.
If not give a sample and I'll have a look at it.
Regards,
Vent
Ghitulescu
18th December 2009, 09:53
Thank you all for the answers.
I know there's at least one piece of software that does what I want (reads Humax iCord .TS files (they are however .M2TS) and converts them to AVCHD/BD), it's called DVR Studio HD. Unfortunatelly it cannot cope with subtitles and probably picks only 1 language (as some users reported). Reports in its own forum also revealed that the audio delay is still not solved. Also the AVCHD/BD authoring and burning section is not yet implemented, when it will be it would cost extra. Summa summorum it's not for me.
I like very much the documentaries ARTE (and now ARTE HD) sends in the ether. It broadcasts 720p50 (50 frames/s) in 2 languages (MP2) + German as AC3; in addition there are DVB subtitles in FR and TXT subtitles in DE/FR.
My first hurdle is to demux and cut the original .M2TS file with all the streams. The second one (authoring an AVCHD/BD) is almost a breeze (now that multiAVCHD exists ;)).
@ventolin: Ok, luckily I have the HDD with me today, I hope it would be ok if I'll cut only a part of it (I don't know how to upload 12GB) - so I'll upload the beginning.
Here it is:-> http://rapidshare.com/files/322467620/NEW_Kleine_und_andere_Strolche_20090815_0757.ts.html
Ghitulescu
18th December 2009, 11:21
Here's my problem:
TsMuxeRGui understands that there's a delay, apparently passes this information downto tsMuxeR, but the delay remains.
The original plays fully in synch in VLC 0.8.6i.
laserfan
18th December 2009, 16:08
You might want to head over to the VideoReDo forum and ask about your Humax there--there are working hard to allow editing of all manner of streams, and may work with yours already, I dunno. But even if not now, they would be interested to see your issues I'm certain.
Ghitulescu
18th December 2009, 17:10
So, I intend to work the .M2TS files to extract audio, video and subtitles for authoring a BD5 or BD9. If it were only 1 audio (SDTV in .TS format) no problem at all, because most programs know how to deal with one video (MPEG-2) and one audio (MPEG-1 bzw. AC-3). I did that for 6-7 years now.
You might want to head over to the VideoReDo forum and ask about your Humax there--there are working hard to allow editing of all manner of streams, and may work with yours already, I dunno. But even if not now, they would be interested to see your issues I'm certain.
Thank you for your suggestion, however VideoReDo does, according to their home page, only MPEG-1/2, while the H.264 support is only early beta, according to their forum.
Meanwhile my HDD has only 15GB left, probably 5GB this evening as another doku was on ARTE HD (BTW, the internal HDD of the Humax is also full).
b66pak
18th December 2009, 18:06
i have no problem with the sample provided...tsdoctor make the .m2ts>.ts
here is the log:
Opening file E:\NEW_Kleine_und_andere_Strolche_20090815_0757.ts
OS: Windows XP Service Pack 2
TSDoctor.exe V 1.0.7
Supported splitter filter found : Haali
Supported audio filter found : ffdshow
Supported video filter found : ffdshow
Working in M2TS mode with 192 byte pakets!
Pakets will be converted from 192 byte pakets to 188 byte pakets!
Scanning for TRP fill pakets
Scanning for PIDs
Found 8 different PIDs
Identifying stream types
$1842: 92% = H264 Video (PES_StreamID $E0 = Video_Stream_0)
$184C: 2% = AC3 Audio (PES_StreamID $BD = Private_Stream_1)
$1856: 2% = (PES_StreamID $BD = Private_Stream_1)
$1838: 0% = PMT
$184D: 2% = MPEG1 Audio (PES_StreamID $C2 = Audio_Stream_2)
$184E: 2% = MPEG1 Audio (PES_StreamID $C4 = Audio_Stream_4)
$1857: 0% = Subtitles (PES_StreamID $BD = Private_Stream_1)
$0000: 0% = PAT
Scanning for PATs
----------- PAT 0 -----------
PacketCount : 1
Table ID : 0
Section Syntax Indicator : 1
Reserved Bit 0 : 0
Reserved Bit 1 : 1
Reserved Bit 2 : 1
Pointer Field : 0
Section Length : 25
Transport Stream ID : 1011
Reserved Bit 3 : 1
Reserved Bit 4 : 1
Version Number : 6
Current Next Indicator : 1
Section Number : 0
Last Section Number : 0
Program Number : $2B5C
Map PID : $1770
Program Number : $2B66
Map PID : $17D4
Program Number : $2B70
Map PID : $1838
Program Number : $2B84
Map PID : $1900
CRC32 : $C8D6DA5F = $C8D6DA5F
-----------------------------
Found 1 different PATs
Found 1 different PMT PIDs (3 PMTPIDs ignored $1770, $17D4, $1900 )
Scanning for PMTs
----------- PMT 0 -----------
Packet : $000005C6
PacketCount : 1
PID : $1838
Table ID : 2
Section Syntax Indicator : 1
PMT Size : 113
Pointer Field : 0
Section Length : 105
Program Number : $2B70
Version Number : 9
Current Next Indicator : 1
Section Number : 0
Last Section Number : 0
PCR PID : $1842
Program Info Length : 0
Stream Type : 27
Description : AVC video stream as defined in ITU-T Rec. H.264 | ISO/IEC 14496-10 Video
Elementary PID : $1842
ES Info Length : 3
ES Info : $52, $01, $09
ES Info Text : R__
Stream Type : 6
Description : ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES packets containing private data (AC3)
Elementary PID : $184C
ES Info Length : 12
ES Info : $6A, $01, $00, $52, $01, $11, $0A, $04, $67, $65, $72, $01
ES Info Text : j__R____ger_
Stream Type : 3
Description : ISO/IEC 11172 Audio
Elementary PID : $184D
ES Info Length : 9
ES Info : $52, $01, $02, $0A, $04, $67, $65, $72, $01
ES Info Text : R____ger_
Stream Type : 3
Description : ISO/IEC 11172 Audio
Elementary PID : $184E
ES Info Length : 9
ES Info : $52, $01, $04, $0A, $04, $66, $72, $61, $01
ES Info Text : R____fra_
Stream Type : 6
Description : ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES packets containing private data (Teletext)
Elementary PID : $1856
ES Info Length : 16
ES Info : $52, $01, $03, $0A, $04, $67, $65, $72, $01, $56, $05, $67, $65, $72, $09, $00
ES Info Text : R____ger_V_ger__
Stream Type : 6
Description : ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES packets containing private data (Subtitle)
Elementary PID : $1857
ES Info Length : 13
ES Info : $59, $08, $66, $72, $61, $20, $00, $01, $00, $01, $52, $01, $06
ES Info Text : Y_fra ____R__
CRC32 : $B355B6F2 = $B355B6F2
-----------------------------
Found 1 different PMTs
Selecting PMT with PID $1838 at position $000005C6
CRC OK!
0.
stream_type : 27 = AVC video stream as defined in ITU-T Rec. H.264 | ISO/IEC 14496-10 Video
elementary_pid : $1842
ES_info_length : 3
1.
stream_type : 6 = ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES packets containing private data (AC3)
elementary_pid : $184C
ES_info_length : 12
2.
stream_type : 3 = ISO/IEC 11172 Audio
elementary_pid : $184D
ES_info_length : 9
3.
stream_type : 3 = ISO/IEC 11172 Audio
elementary_pid : $184E
ES_info_length : 9
4.
stream_type : 6 = ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES packets containing private data (Teletext)
elementary_pid : $1856
ES_info_length : 16
5.
stream_type : 6 = ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES packets containing private data (Subtitle)
elementary_pid : $1857
ES_info_length : 13
PCR PID is $1842
Created PAT:
----------- PAT 0 -----------
PacketCount : 0
Table ID : 0
Section Syntax Indicator : 1
Reserved Bit 0 : 0
Reserved Bit 1 : 1
Reserved Bit 2 : 1
Pointer Field : 0
Section Length : 13
Transport Stream ID : 1011
Reserved Bit 3 : 1
Reserved Bit 4 : 1
Version Number : 6
Current Next Indicator : 1
Section Number : 0
Last Section Number : 0
Program Number : $2B70
Map PID : $1838
CRC32 : $AAB5E68D = $AAB5E68D
-----------------------------
Created PMT:
----------- PMT 0 -----------
Packet : $000005C6
PacketCount : 1
PID : $1838
Table ID : 2
Section Syntax Indicator : 1
PMT Size : 113
Pointer Field : 0
Section Length : 105
Program Number : $2B70
Version Number : 9
Current Next Indicator : 1
Section Number : 0
Last Section Number : 0
PCR PID : $1842
Program Info Length : 0
Stream Type : 27
Description : AVC video stream as defined in ITU-T Rec. H.264 | ISO/IEC 14496-10 Video
Elementary PID : $1842
ES Info Length : 3
ES Info : $52, $01, $09
ES Info Text : R__
Stream Type : 6
Description : ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES packets containing private data (AC3)
Elementary PID : $184C
ES Info Length : 12
ES Info : $6A, $01, $00, $52, $01, $11, $0A, $04, $67, $65, $72, $01
ES Info Text : j__R____ger_
Stream Type : 3
Description : ISO/IEC 11172 Audio
Elementary PID : $184D
ES Info Length : 9
ES Info : $52, $01, $02, $0A, $04, $67, $65, $72, $01
ES Info Text : R____ger_
Stream Type : 3
Description : ISO/IEC 11172 Audio
Elementary PID : $184E
ES Info Length : 9
ES Info : $52, $01, $04, $0A, $04, $66, $72, $61, $01
ES Info Text : R____fra_
Stream Type : 6
Description : ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES packets containing private data (Teletext)
Elementary PID : $1856
ES Info Length : 16
ES Info : $52, $01, $03, $0A, $04, $67, $65, $72, $01, $56, $05, $67, $65, $72, $09, $00
ES Info Text : R____ger_V_ger__
Stream Type : 6
Description : ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES packets containing private data (Subtitle)
Elementary PID : $1857
ES Info Length : 13
ES Info : $59, $08, $66, $72, $61, $20, $00, $01, $00, $01, $52, $01, $06
ES Info Text : Y_fra ____R__
CRC32 : $B355B6F2 = $B355B6F2
-----------------------------
First PTS is 7896466915 00:22:18.521 PID:1856
Last PTS is 7902018115 00:23:20.201 PID:1856
First DTS is 0 00:00:00.000
First PCR is 1207661859000 12:25:28.217
First PCRŽ is 4025539530 12:25:28.217
Last PCR is 1209328115883 12:26:29.930
Duration of video stream is 5554190 00:01:01.713
The following PIDs will be imported into new stream: $1842, $184C, $184D, $184E, $1856, $1857
Scanning for video details
-------- H264 Video ---------
profile_idc : 77
constrained_set0_flag : 0
constrained_set1_flag : 0
constrained_set2_flag : 0
constrained_set3_flag : 0
reserved_zero_4bits : 0
level_idc : 40
seq_parameter_set_id : 0
log2_max_frame_num_minus4 : 0
pic_order_cnt_type : 0
log2_max_pic_order_cnt_lsb_minus4 : 1
num_ref_frames : 2
gaps_in_frame_num_value_allowed_flag : 0
pic_width_in_mbs_minus1 : 79
pic_height_in_map_units_minus1 : 44
frame_mbs_only_flag : 1
direct_8x8_inference_flag : 1
frame_cropping_flag : 0
vui_parameters_present_flag : 1
aspect_ratio_info_present_flag : 1
aspect_ratio_idv : 1
overscan_info_present_flag : 0
video_signal_type_present_flag : 1
video_format : 5
video_full_range_flag : 0
colour_description_present_flag : 1
colour_primaries : 1
transfer_characteristics : 1
matrix_coefficients : 1
chroma_loc_info_present_flag : 1
chroma_sample_loc_type_top_field : 0
chroma_sample_loc_type_bottom_field : 0
timing_info_present_flag : 1
num_units_in_tick : 1
time_scale : 100
fixed_frame_rate_flag : 1
nal_hrd_parameters_present_flag : 1
cpb_cnt_minus1 : 0
bit_rate_scale : 4
cpb_size_scale : 4
bit_rate_value_minus1_0 : 11519
cpb_size_value_minus1_0 : 58111
cbr_flag_0 : 0
initial_cpb_removal_delay_length_minus1: 23
cpb_removal_delay_length_minus1 : 23
dpb_output_delay_length_minus1 : 23
time_offset_length : 0
vcl_hrd_parameters_present_flag : 0
-----------------------------
Video format: H264 1280x720p/50 fps/Main@4.0
Colorimetry : ColourPrimaries=BT.709, TransferCharacteristics=BT.709, MatrixCoefficients=BT.709
Scanning for audio details
Audio stream 1: AC3 2.0 48000Hz (GER)
Audio stream 2: MPEG1 Audio
Audio stream 3: MPEG1 Audio
Starting at source file position: 706944
Cut in at PCR: 00:00:00.000 (12:25:28.217)
Cut out at PCR: 00:01:01.713 (12:26:29.930)
Starting at paket $00000000(00000E62) PCR: 00:00:00.000 (12:25:28.217)
No cutting at the end needed
--------- NAL Unit Type Statistic ---------
Slices : 3062
Data Partition A : 0
Data Partition B : 0
Data Partition A : 0
IDR Picture : 0
SEI : 3062
Sequence Parameter Set : 134
Picture Parameter Set : 134
AUD : 3062
End of Sequence : 0
End of Stream : 0
Filler : 438
Slices : 0
Seq. Param. Set Ext. : 0
Cutted pakets at the beginning: 0
Cutted pakets at the end: 0
Discarded pakets (not needed): 11278
ERRORS : 0
WARNINGS : 0
Speed: 10.2 MBytes/sec
Duration: 00:00:09
it preserves all three audio and the sub...
_
Ghitulescu
18th December 2009, 18:53
Thank you for having a look on this sample.
I worked another one with tsMuxeRGui, output to BD. Playing it on my BD player gave me almost certainly the amount of delay*, as in the picture that waits to be approuved. I also performed the exact procedure with another one, the only difference being that I processed it before with TS-Doctor (cutting out the extremes to keep only the main clip). It happened exactly the same.
*The sound was some 1s displaced, while my files have some 1000ms - I assume the delay is the same.
b66pak
18th December 2009, 19:03
demux the stream with eac3to then use tsMuxeRGui and you will not have any problems...here is the log from eac3to with your sample...
eac3to v3.16
command line: eac3to NEW_Kleine_und_andere_Strolche_20090815_0757.ts -demux
------------------------------------------------------------------------------
M2TS, 1 video track, 3 audio tracks, 1 subtitle track, 0:01:02, 50p
1: h264/AVC, 720p50 (16:9)
2: AC3, German, 2.0 channels, 256kbps, 48khz, dialnorm: -27dB, -1281ms
3: MP2, German, 2.0 channels, 256kbps, 48khz, -1154ms
4: MP2, French, 2.0 channels, 256kbps, 48khz, -1164ms
5: Subtitle (DVB), French
[v01] Extracting video track number 1...
[a02] Extracting audio track number 2...
[a03] Extracting audio track number 3...
[a04] Extracting audio track number 4...
[a02] Removing AC3 dialog normalization...
[a02] Applying (E-)AC3 delay...
[a02] A remaining delay of -1ms could not be fixed.
[v01] Creating file "NEW_Kleine_und_andere_Strolche_20090815_0757 - 1 - h264, 720p50.h264"...
[a03] Applying MPx delay...
[a04] Applying MPx delay...
[a03] A remaining delay of -2ms could not be fixed.
[a04] A remaining delay of +12ms could not be fixed.
[a02] Creating file "NEW_Kleine_und_andere_Strolche_20090815_0757 - 2 - AC3, German, 2.0 channels, 256kbps, 48khz.ac3"...
[a03] Creating file "NEW_Kleine_und_andere_Strolche_20090815_0757 - 3 - MP2, German, 2.0 channels, 256kbps, 48khz.mp2"...
[a04] Creating file "NEW_Kleine_und_andere_Strolche_20090815_0757 - 4 - MP2, French, 2.0 channels, 256kbps, 48khz.mp2"...
Video track 1 contains 3072 frames.
eac3to processing took 3 seconds.
Done.
_
N.B. it seams that eac3to don't demux DVB subtitles!
_
laserfan
18th December 2009, 19:10
Thank you for your suggestion, however VideoReDo does, according to their home page, only MPEG-1/2, while the H.264 support is only early beta, according to their forum.
Actually they've been testing h.264 for many months now, and you'd have an easy time getting the software with your particular source (they like new sources to try). So you should consider it if you can't find any other way.
Ghitulescu
18th December 2009, 19:35
Actually they've been testing h.264 for many months now, and you'd have an easy time getting the software with your particular source (they like new sources to try). So you should consider it if you can't find any other way.
Unless you have some insider informations, from what I read from the manual and web site, VideoReDo simply downconverts HD to SD, it keeps only one audio and does not do subtitles. What I need is something that can work with multiple streams and keep them alltogether in synch.
But now I have the whole weekend to practice on my files.
Ghitulescu
28th December 2009, 10:23
ADDITION:
I noticed that the same recordings go ok through multiAVCHD (well, I loose the subtitles, oh gosh, I'm sick and tired of all this, should I find no way in the very next future I'll start buying DVDs and that's all folks, the content providers won again).
Since multiAVCHD uses the very same tsmuxer, I can only assume it's due to separate stream processing (multiAVCHD splits the .TS file into ESs, converts them if needed, then remuxes them).
Another way to get rid of this nasty synch issue is to run the .M2TS files through TS-Doctor to convert them to .TS with all streams kept. However, TS-Doctor is trialware for 30 days, despite some sites list it as freeware.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.