Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > (HD) DVD, Blu-ray & (S)VCD > (HD) DVD & Blu-ray authoring

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd June 2009, 20:06   #41  |  Link
clark15b
Registered User
 
clark15b's Avatar
 
Join Date: Apr 2009
Location: Moscow, Russia
Posts: 61
deank

The first part has variable fps, it is a principal cause of out of sync.

My tool can build timecodes for fixed fps now.

Here that has turned out: http://rapidshare.com/files/24783849..._4113.rar.html
First part has out of sync, second part without audio asyncronization.

Now i try join this to one ts with variable fps....mkvmerge does not approach (it is possible but difficult)
clark15b is offline   Reply With Quote
Old 3rd July 2009, 12:00   #42  |  Link
clark15b
Registered User
 
clark15b's Avatar
 
Join Date: Apr 2009
Location: Moscow, Russia
Posts: 61
UPDATE is available.

Version 1.50

- new demux engine (parse difficult streams)
- new timecodes generator for mkvmerge (+ h.264, AC3 ES parser)
- allow large files in Linux
- dump TS structure
- batch processing (without join clips)
- PES output (instead of elementary streams)
- a lot of changes

Now I work over join of several TS/M2TS streams in one.
clark15b is offline   Reply With Quote
Old 27th July 2009, 14:10   #43  |  Link
clark15b
Registered User
 
clark15b's Avatar
 
Join Date: Apr 2009
Location: Moscow, Russia
Posts: 61
GUI here: http://tsdemuxer.googlecode.com/file...uxer_setup.exe

Download Microsoft Visual C++ 2008 Redistributable Package if problems: http://www.microsoft.com/downloads/d...displaylang=en

Last edited by clark15b; 27th July 2009 at 14:29.
clark15b is offline   Reply With Quote
Old 30th July 2009, 13:02   #44  |  Link
clark15b
Registered User
 
clark15b's Avatar
 
Join Date: Apr 2009
Location: Moscow, Russia
Posts: 61
My new project - PS3Muxer
http://forum.doom9.org/showthread.php?t=148627
clark15b is offline   Reply With Quote
Old 28th August 2009, 13:19   #45  |  Link
clark15b
Registered User
 
clark15b's Avatar
 
Join Date: Apr 2009
Location: Moscow, Russia
Posts: 61
UPDATE is available.

Version 1.52

Now produces SRT file with subtitles for saving information about shooting time/date from the playlist and TS timecodes.

Example:
./tsdemux -m -j -c 1 -d samples/hf100/private/avchd/bdmv/stream/ -l samples/hf100/private/avchd/bdmv/playlist/00000.mpl

00015.track_4113.264
00015.track_4113.tmc
00015.track_4352.ac3
00015.track_4352.tmc
chapters.xml
timecodes.srt
__________________
tsdemuxer|PS3Muxer
clark15b is offline   Reply With Quote
Old 27th January 2010, 11:33   #46  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,772
Well, if I may have a suggestion

Just landed today over this thread, read all the comments, but I'm not really sure if it touches the following subject.

I have .M2TS from HDTV, that contain subtitles both as TXT and DVB SUB.

Is it possible to demux these subtitles?
Is it possible to join multiple .M2TS or .TS files (seamless, no asynch)? I used copy /b from DOS with good results
Is it possible to check/reorder the timecodes for joined files?

All the questions are related to subtitles. Apparently I'm the only one on this planet that cares about subtitles in HDTV. I'm still looking for a clear method to recover/work them.

Thanks

PS: videoformat is H.264 for HDTV and MPEG-2 for SDTV. Audio are generally a mixture of AC-3 and MP2, usually 1 AC-3 and at least 1 MP2.
Ghitulescu is offline   Reply With Quote
Old 30th January 2010, 15:25   #47  |  Link
clark15b
Registered User
 
clark15b's Avatar
 
Join Date: Apr 2009
Location: Moscow, Russia
Posts: 61
Quote:
Is it possible to demux these subtitles?
Yes, '-u' switch
Quote:
Is it possible to join multiple .M2TS or .TS files (seamless, no asynch)? I used copy /b from DOS with good results
No, the program can not create M2TS/TS file as output... elementary streams + timecodes only.
'copy /b' is a true way, but stream not absolutely correct.
__________________
tsdemuxer|PS3Muxer
clark15b is offline   Reply With Quote
Old 1st February 2010, 13:14   #48  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,772
Quote:
Originally Posted by clark15b View Post
Yes, '-u' switch
Ok, I'll give it a try.
Ghitulescu is offline   Reply With Quote
Old 30th October 2010, 01:20   #49  |  Link
Chug a Bug
Registered User
 
Join Date: Feb 2007
Posts: 27
Hi, I've been looking for a tool for joining .m2ts files, this would fit the bill except... it won't demux DTS-MA. AC3 is fine, but not this.
Chug a Bug is offline   Reply With Quote
Old 31st October 2010, 10:02   #50  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,714
I believe TSMuxer can join m2ts files. Why don't you give that a try?
Adub is offline   Reply With Quote
Old 1st November 2010, 09:02   #51  |  Link
clark15b
Registered User
 
clark15b's Avatar
 
Join Date: Apr 2009
Location: Moscow, Russia
Posts: 61
Chug a Bug
Yes, i don`t know how to demux HD-audio.

Sorry
__________________
tsdemuxer|PS3Muxer
clark15b is offline   Reply With Quote
Old 9th March 2011, 15:10   #52  |  Link
mariner
Registered User
 
Join Date: Nov 2005
Posts: 583
How to join m2ts files properly?

Quote:
Originally Posted by clark15b View Post
I'm proud to present my own M2TS files demuxer taken from AVCHD camera and Blu-ray disks. Utility have a number of advantages and features when you working with AVCHD materials.

There is a major issue: joining multiple scenes located in different M2TS (MTS)/TS files into one file with audio/vidio sync (optional).

After brief topic examination it came to me that such thing can be done by eac3to, tsMuxer or simple 'copy /b' command in Windows and 'cat' in *nix-es, just addition one file in the end of another.

But in practice this is not good idea. The question is each M2TS file audio and video may be varied by length. This is urgent for the NTSC with fractional FPS, for example 29.97. Audio length (AC3 fps) and video frames (H264 JVT NAL) could not be variable, consequently there is no way to combine they at the end of the TS stream. Easiest way is to adjust video to audio, in this case variable fps is needed. In result we have audio stream 1 msec longer then video. It is not hard to calculate that for the 100 scenes we will get tremendous audio delay for 100 msec at the end.

When playing M2TS files one after one player begins from start and there are no visible synchronization issues. But when we join files, extracting elementary streams and muxing to MKV we are dropping information for synchronization completely. Muxer (mkvmerge) have no idea about initial TS stream properties and therefore sets its own time marks, supposing video and audio synchronized (I would remind you h.264 stream doesn't contain any metadata about FPS and so on).

Here the program features:

* runs either by Windows, Linux and FreeBSD;
* completely opensource , GPLv2;
* understands M2TS and TS file formats (type detetection by magic sequence);
* batch processing;
* joining multiple scenes;
* demux to ES or PES streams;
* extensions for the output files would be set depending of elementary stream;
* takes files list and/or directories list as command line argument (it is possible to specify a path to files for example private/avchd/bdmv/stream, program will take all appropriate files by itself);
* extracts shooting date and time of the each clip from mpls files in camera (private/avchd/bdmv/playlist/*.mpl);
* extracts elementary streams all programs in TS container or selected by number;
* makes files with time codes for appropriate elementary streams synchronizationl (mkvmerge timecode format v2);
* determining h.264 and AC3 elementary stream FPS;
* determining audio delay after video in each file and brings appropriate corrections into time codes (urgent for Blu-ray, you not needed to calculate and specify delay by yourself when muxing into MKV);
* trying to align elementary streams endings inside each scene;
* produces file with scenes for saving information about initial material dividing into multiple M2TS files. Scene names gives after file names or shooting time/date from the playlist (mkvmerge xml format);
* produces SRT file with subtitles for saving information about shooting time/date from the playlist;
* shows invoking mkvmerge command for muxing produced material into MKV;
* support MPEG2 Video, MPEG2 Audio, H.264, VC-1, AC3, L-PCM elementary stream types;
* parses and shows information about TS stream without elementary streams extraction (shows streams types. length, offset, and fps);
* dump TS structure (M2TS timecodes, PTS/DTS ...).

Unfortunately there is only console version available yet. It was tested against AVCHD cameras by Sony, Canon, Panasonic, some Blu-ray disks and broadcast TS.

Competitors disadvantages:
* xport - Unable to join files and can't take TS from the standard input. Output file names not reflecting content type;
* eac3to - No source code available, only Windows;
* tsMuxer - Also no source code, not so useful console version, joining files in GUI version is not comfortable.

And no one of them able to form files for proper streams synchronization for mkvmerge, no ability to generate file with scenes list, and no shooting time/date extraction.

I suppose my program may be an alternative to xport.

GUI Windows setup (win32): http://tsdemuxer.googlecode.com/file...uxer_setup.exe
Windows binaries (win32): http://tsdemuxer.googlecode.com/files/tsdemux.zip
Linux binaries (gcc4, static): http://tsdemuxer.googlecode.com/files/tsdemux.tar.gz
Sources: http://code.google.com/p/tsdemuxer/source/browse
Project home page: http://code.google.com/p/tsdemuxer


Simple invocation form: 'tsdemux.exe -m -j -d x:\private\avchd\bdmv\stream' or 'tsdemux.exe -j 00001.mts 00002.mts'. Result will be in five files in current directory: video stream , audio stream, tmc-file for audio, tmc-file for video, xml-file with scenes. Then you should pass all of these to mkvmerge.

Command line options:
tsdemux.exe [-d src] [-l mpls] [-o dst] [-c channel] [-u] [-j] [-m] [-z] [-p] [-e mode] [-v] *.ts|*.m2ts ...

-d discard all TS/M2TS/MTS files from specified directory (use it multiple times for different directories, files will be sorted ascending). For the AVCHD/Blu-ray it should be 'private/avchd/bdmv/stream'.
-l path to AVCHD/Blu-ray playlist mpl/mpls file (usually it is 'private/avchd/bdmv/playlist/*.mpls'). If this option set then for the names of scenes shooting time/date will be used also.
-o redirect output to another directory
-c channel number in TS stream (if not specified then all streams from all programs will be extracted, but scene file for mkvmerge will not generated).
-u demux unknown streams
-j join elementary streams
-m shows mkvmerge invoking options for muxing results in MKV.
-z demux to PES streams (instead of elementary streams).
-p deny elementary streams extraction, only analyze with information output.
-e dump TS structure to STDOUT (mode=1: dump M2TS timecodes, mode=2: dump PTS/DTS, mode=3: human readable PTS/DTS dump)
-v turn on verbose output

Valid files extensions: m2ts, mts, ts.
Output files could be with extensions: sup, m2v, 264, vc1, ac3, m2a, pcm. Files with time codes for each elementary stream for mkvmerge (tmc) and mkvmerge scene file (chapter.xml) will be generated as well.

Send bugreports to comments, please
Greetings Anton. May thanks for writing this detailed analysis of how to properly join m2ts files.

1. I have come across your wonderful program by way of Dean Kasabow's multiAVCHD. It offers two options for joining m2ts: tsdemux and eac3to. Both produce identical video stream, but the AC3 stream produced by eac3to is slightly longer in duration. Does this mean that the eac3to method (eac3to.exe 1+2+3+... -demux) gives incorrect results?

2. multiAVCHD then uses tsmuxer to mux together the 264 and ac3 streams. Do you think this will produce the correct result, as I remember reading somewhere that tsmuxer does not understand tmc file and may mess up the audio time stamp? If not, what would you suggest to correctly mux together a m2ts stream?

3. The tsdemux version used in multiAVCHD is dated May, and supports the -i instead of the -j option. While the 264 and ac3 output are identical, the tmc file for ac3 differs. How does this affect the accuracy of final joined m2ts file?

4. If I use copy/b to join the m2ts files and demux the audio stream, it would differ from both the tsdemux and eac3to output. Can we conclude that copy/b is not the proper way to join m2ts files?

5. The original source I use are actually mp4 with AAC audio. They were first converted by multiAVCHD into m2ts with AC3 audio since blu-ray does not accept AAC. Would it be a better option to first join these mp4 files, and what would you suggest to perform this task?

Many thanks and best regards.
mariner is offline   Reply With Quote
Old 5th October 2011, 12:47   #53  |  Link
cafevincent
Registered User
 
Join Date: Feb 2003
Posts: 111
I'm demuxing some bluray files and it seems tsdemux doesn't demux the dts-hd streams (not sure about normal dts). Is that normal?

edit: also I am trying to figure out how to keep out any chapters on the finished mkv, does that come into play during the demuxing?

Last edited by cafevincent; 5th October 2011 at 12:51.
cafevincent is offline   Reply With Quote
Old 27th April 2016, 12:56   #54  |  Link
clark15b
Registered User
 
clark15b's Avatar
 
Join Date: Apr 2009
Location: Moscow, Russia
Posts: 61
Hi, All.

Please support my crowdfunding campaign at indiegogo.com:
http://www.indiegogo.com/projects/xu...4-and-xbox-one
__________________
tsdemuxer|PS3Muxer
clark15b is offline   Reply With Quote
Old 5th June 2016, 13:45   #55  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 851
Hi,
Do you have documentation about M2TS ? I would like to understand how it's structured.
Thank you.

Last edited by Nico8583; 5th June 2016 at 13:56.
Nico8583 is offline   Reply With Quote
Reply

Tags
avchd, blu-ray, mux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:41.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.