PDA

View Full Version : HD TS demux 2 excact copy


stingertje
29th October 2008, 20:11
Problem :

I have a 20 GB large TS file containing H.264 video 1080i, ac3 en mpeg audio. TS file plays fine in powerdvd and so.. and has a duration of 2:47:38. Was recorded with progdvb.

When I demux it to seperate streams it goes wrong. then I get a video file that is 2:45:17 long and an audio file that is 2:45:30 long. I did a negative timestretch of the audio file to match the video, but its still out of sync, the out of sync gets worse when it goes to the end, form a few ms in the beginning to seconds in the end.

So my demuxed files are less in time, so I suppose they contain errors that the demuxer skips, to become a smaller file in time. I can live with the errors, As said before the ts file plays fine without sync problems.

So the help I'm seeking is :
1. A tool that can demux the streams but leave errors in the file so that the time fitts the original ts file a 1:1 copy but then demuxed.
2. A tool that demux with errorcorrection but leaves video and audio both the same in time and in sync.

Any help is welcome.

Stingertje

PS. Allready did demuxing with mplayer, tsmuxer, and tsconvertor.

DrNein
15th November 2008, 03:18
Other possibilities are:

xport - which may demux with any delay included
TsRemux & Ts4Np
eac3to - may halt if there are errors though
MPEG Streamclip

What is the ultimate goal for the streams? Sometimes remuxing in a single step with a certain program may achieve the desired result where the two-step demux and mux does not.

Schmendrick
16th November 2008, 00:40
@stingertje: First of all with the price per GB using an external hard discs being equal to the price per GB using DVD+-R why still bother to cut recordings to burn them on a DVD. The only I see to be able to use a stand-alone BD-Player.

To be able to keep synchronity like in the original recording one would either have to keep the included time stamps which the player software uses to resynchonize the stream after faults in the streams like missing frames etc.. The other option is to feed the recording e.g. using Avisynth using compatible video and audio decoders for reencoding.

Using a hex editor which is able to handle large files > 4GB like HxD ( http://mh-nexus.de/en/hxd/ ) the ts-file can be cut at the beginning of the ts-packet containing the „H264 Sequenz Parameter Set“. This is a five byte sequence having as first four hex values "00 00 00 01" and then either hex: "27" or hex: "67". 24 bytes prior to these five bytes usually the ts-frame start byte hex: "47" is located. Just before this byte a stream should be cut so that the following stream should start with this "47" ts-start code.
So one should move forward to the maximum file size one chunck of the file should have and then search backwards to the „H264 Sequenz Parameter Set“ and then do the cut as described.

The advantage of this method is that the separated pieces can be rejoined using the "copy /b Clip1.ts+Clip2.ts+Clip3.ts Fullclip.ts"-method.

Schmendrick