Log in

View Full Version : TsRemux v0.21.2: Transport Stream De/Re-muxer


Pages : [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

dmz01
4th May 2007, 17:39
Having been inspired by Pelican9's and DrMpeg's work, I decided to write a transport stream re-muxer similar in functionality to EvoDemux. Some of the features currently implemented:

Removal of source packet header
Generation of source packet header
Regeneration of DTCP descriptor (all others are kept) which removes analog output restrictions (downrezzing of HD, macrovision etc.)
PAT/PMT generation for RAW TS files sourced from Sat/Cable/OTA
Async I/O for maximum throughput
Ability to trim streams at the beginning and/or the end
Ability to pick and choose elementary streams to be kept
Ability to remux PCR-less streams
Ability to remux program streams (MPG/VOB/EVOB) into TS/M2TS
Ability to demux elementary streams as well as subtitle streams compatible with SUPreader (right click the selected stream with the mouse)
Fixing PCR/PTS/DTS after a file merge
Removing end-of-stream markers for VC1 and AVC after a file merge
Ability to inmux SUPreader presentation graphics subtile streams
Ability to remux into simple Blu-Ray output (new)
Ability to remux MKV into TS (alpha)
Ability to extract Dolby Digital from TrueHD in Blu-Ray streams
Ability to extract DTS Core from DTS HD in Blu-Ray streams
[spacecat56] performance fixes (new)
[spacecat56] command line capability (new)


Current Version 0.21.2

Notes:

All PIDs are now forced to follow Blu-Ray PID requirements
Still working on MKV support
Blu-Ray output option is beta quality.
Audio PES packets follow the blu-ray standard. (PES stream type 0xFD instead of 0xBD is incompatible with some older splitters/players)
HD-DVD to Blu-Ray conversion might have issues due to incompatible DDPlus requirements. Combo-players will have better results than Blu-Ray only.
MKV support early alpha quality. MPEG2/AC3 seems to work, others don't.


Download link (http://www.megaupload.com/?d=R3WWZ7MQ)

Source Code (GPL) (http://www.megaupload.com/?d=6G5LPRI4)

zgx
4th May 2007, 22:47
Thank you. Great work :).

Thunderbolt8
4th May 2007, 23:33
since im not too familiar with that technical stuff, which transport streams does this tool demux now, only mpeg2 or also h264 .ts streams ? and where do they get demuxed too, in which file or container ?

btw. tried to open a skyHD cap h264 .ts 12 gb file and then a 150 mb sample of this stream: in both cases the cpu seemed to work to infinity, but nothing actually happened, the file apparently cant be opened.

dmz01
5th May 2007, 00:06
In theory it should work with any TS file. Is there somewhere where I can download the non-working sample?

I don't demux, since there is already a tool for that. I can add that if there is demand for it. For now I just re-mux into a new TS file.

Thunderbolt8
5th May 2007, 00:43
took another sample of another skyHD cap, this one could at least be loaded. but when remuxing it just gave me der objektverweis wurde nicht auf eine objektdistanz festgelegt -.-

dmz01
5th May 2007, 00:51
Can't figure it out without a sample. :) Can you make a small sample for me?

Thunderbolt8
5th May 2007, 01:00
sry, but I dont know how to cut out a sample out of a .ts file -.-

btw. would also be taking a sample from the sample a possibility or must the source here be the original file ?

bob0r
5th May 2007, 01:06
You're free to test all these: http://x264.nl/h.264.samples/

dmz01
5th May 2007, 01:44
You're free to test all these: http://x264.nl/h.264.samples/

Well, all of those work fine. I need a sample TS that doesn't work with my app. :D

dmz01
5th May 2007, 01:46
sry, but I dont know how to cut out a sample out of a .ts file -.-

btw. would also be taking a sample from the sample a possibility or must the source here be the original file ?


Yes, you can make a sample of a sample etc. even a 1MB sample would be fine as long as it breaks the app.

Thunderbolt8
5th May 2007, 02:13
yes, but tell me how plz, what do I have to do with which tools :D

dmz01
5th May 2007, 02:36
try a simple "copy" command and "CTRL-C" it after a few seconds.

Pookie
5th May 2007, 07:31
dmz01 - Thanks. Looking forward to trying this.


Thunderbolt8 - try cutfile -

http://jsoto.posunplugged.com/tools/CutFile_exe.zip


Edit:

dmz01 - drmpeg's Mpeg2 TS test files =

http://www.w6rz.net/

AVCHD .MTS files =

https://oncourse.iu.edu/access/content/user/rtknapp/00055.MTS
https://oncourse.iu.edu/access/content/user/rtknapp/00043.MTS

CruNcher
5th May 2007, 09:20
took another sample of another skyHD cap, this one could at least be loaded. but when remuxing it just gave me der objektverweis wurde nicht auf eine objektdistanz festgelegt -.-

I have the same problem here, but with a Blu-Ray .m2ts (AVC)

DeepBeepMeep
5th May 2007, 09:24
Thanks! that's a very interesting tool. Unfortunately on all the streams I have tried gives me the error "Object reference not set to an instance of an object" when I click remux.

Thunderbolt8
5th May 2007, 10:56
try a simple "copy" command and "CTRL-C" it after a few seconds.
allright, so its the same as when making a sample for .mkv with mkvmerge (or any other mkv muxer), when I just cancel/close the process in the mid of the work ?
wasnt sure if this way maybe could alter or invalidate the file.

edit: doesnt work for me, when I cancel the copy process, the file gets deleted automatically
apart from that he copies too fast anyway, so the file would be getting too big that way

foxyshadis
5th May 2007, 11:21
Virtualdub has a hex editor with a "truncate" menu item. Most hex editors do, as well as those "file splitters", but that's one you probably already have.

dmz01
5th May 2007, 13:03
Edit:

dmz01 - drmpeg's Mpeg2 TS test files =

http://www.w6rz.net/

AVCHD .MTS files =

https://oncourse.iu.edu/access/content/user/rtknapp/00055.MTS
https://oncourse.iu.edu/access/content/user/rtknapp/00043.MTS

All of those work fine too...

For anyone who has an issue, please try go get me a sample if you can.

Thunderbolt8
5th May 2007, 16:37
as written above, I cant do it the way you described
apart from that I have computer problems atm, my comp is is rebooting constantly when I try to open certain things or dl anythig with any browser, get emails etc. (virus?)
so I might get back later again

DeepBeepMeep
5th May 2007, 17:32
All of those work fine too...

For anyone who has an issue, please try go get me a sample if you can.

It's a shame I can't get it to work at all I have the error message ""Object reference not set to an instance of an object" no matter what stream I throw at it. Is there any special requirements like MFC?

Pookie
5th May 2007, 19:47
Revision of .NET 2.0 ? The app makes a call to sortkey.nlp located in \WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0

dmz01
5th May 2007, 21:00
Yes, the only requirement is the official .NET 2.0

Pelican9
5th May 2007, 23:33
Could you make a subtitle extractor in your app?
We are talking about BD subtitles here: http://forum.doom9.org/showthread.php?t=124105

Eeknay
6th May 2007, 00:39
Can't figure it out without a sample. :) Can you make a small sample for me?

http://www.dryfire.org/~gits/bsg-lolcoreavc.ts

That just loads forever sucking up CPU (as have a few other files I've tried).

dmz01
6th May 2007, 01:26
Ok, I know what the issue is, I'll have a fix ready later on.

Basically the PMT in this stream shows that PCRs are found in PID 0x31. However no packets with PID 0x31 have a PCR. The app doesn't really "load forever" but to compute video length it reads the first and the last PCR in the file. Since there are no PCRs, the file is read twice, once front to back looking for the start PCR and once back to front looking for the end PCR. The reads back to front are extremely slow. I'll add code to detect this defect in existing PMTs.

drmpeg
6th May 2007, 02:46
Ok, I know what the issue is, I'll have a fix ready later on.

Basically the PMT in this stream shows that PCRs are found in PID 0x31. However no packets with PID 0x31 have a PCR. The app doesn't really "load forever" but to compute video length it reads the first and the last PCR in the file. Since there are no PCRs, the file is read twice, once front to back looking for the start PCR and once back to front looking for the end PCR. The reads back to front are extremely slow. I'll add code to detect this defect in existing PMTs.
Are you sure there are no PCR's? Remember that PCR's can be embedded in video PID packets. That is, you can have video packets with both an adaptation field and a payload.

EDIT: nevermind, there really are no PCR's in that stream.

Ron

drmpeg
6th May 2007, 02:48
Could you make a subtitle extractor in your app?
We are talking about BD subtitles here: http://forum.doom9.org/showthread.php?t=124105
http://forum.doom9.org/showthread.php?p=999828#post999828

Ron

dmz01
6th May 2007, 05:58
Could you make a subtitle extractor in your app?
We are talking about BD subtitles here: http://forum.doom9.org/showthread.php?t=124105

Elementary stream extraction with full PES headers added to the to do list. :)

Thunderbolt8
7th May 2007, 17:56
when I try to cut the file with the cutfile proggie then I get the error message "sync byte missing" when trying to put it into tsremux

dmz01
8th May 2007, 15:48
when I try to cut the file with the cutfile proggie then I get the error message "sync byte missing" when trying to put it into tsremux

You need to make the cut at 188 byte boundary. TS streams are made of 188 (or 192 in M2TS case) packets, so you need to break the stream right at the end of one and at the beginning of the next packet.

dmz01
8th May 2007, 16:01
New version uploaded with PS to TS remux support. Now you can take all VOBs and EVOBs and convert them to a single M2TS format. :)

madshi
8th May 2007, 16:17
New version uploaded with PS to TS remux support. Now you can take all VOBs and EVOBs and convert them to a single M2TS format. :)
Wow, that's cool !!! I guess doing VOB -> TS (not M2TS) is also supported, right?

:thanks:

Please forgive me, but I'm getting really gready now: I have all my movies converted to MKV because I like it best. However, it would be great if I had the choice to convert them back to TS somehow, if there are circumstances (e.g. hardware players without MKV support) that force me to. Do you see any chance to add MKV support (only reading, no writing)? Please just say "no" if it's too much work.

dmz01
8th May 2007, 17:02
Wow, that's cool !!! I guess doing VOB -> TS (not M2TS) is also supported, right?

:thanks:

Please forgive me, but I'm getting really gready now: I have all my movies converted to MKV because I like it best. However, it would be great if I had the choice to convert them back to TS somehow, if there are circumstances (e.g. hardware players without MKV support) that force me to. Do you see any chance to add MKV support (only reading, no writing)? Please just say "no" if it's too much work.

Yes, VOB -> TS is supported. I'll add MKV reading support to the to do list. I will need to learn the format first, so it might take some time. :)

Kurtnoise
8th May 2007, 17:04
MP4 with AVC streams could be great too...:)

madshi
8th May 2007, 17:07
I'll add MKV reading support to the to do list. I will need to learn the format first, so it might take some time.
Thanks very much!! There's no hurry, so take all the time you need.

MP4 with AVC streams could be great too...:)
If we continue like this we'll kill him... :devil:

Pelican9
8th May 2007, 19:03
I would like to add a subtitle stream to an existing m2ts file.
(If replace of an existing subtitle stream is easier, it's good for me too.)
This is some kind of (partial) remux.
Is there any chance to make this feature in your app?
(after mkv and avc support)

dmz01
8th May 2007, 19:56
I would like to add a subtitle stream to an existing m2ts file.
(If replace of an existing subtitle stream is easier, it's good for me too.)
This is some kind of (partial) remux.
Is there any chance to make this feature in your app?
(after mkv and avc support)

Actually this would be the easiest thing compared to the other two. Provided that you can help me with it :) I need to know the format of the file so that I can stuff it into PES packets. I will also need to know how to retrieve time stamp information from the stream to know the locations where to insert those PES packets. PM me if you can help.

dmz01
8th May 2007, 19:57
MP4 with AVC streams could be great too...:)

For this to happen someone needs to point me to a copy of ISO/IEC 14496-14, since I don't have one. PM me if you can help.

LuemmelBS
9th May 2007, 10:46
I've tried the latest TsRemux but cannot get past loading an EVO or VOB since I always get this error: "Insufficient system resources exist to complete the requested service."

Anyone else having this prob?

The_Keymaker
9th May 2007, 19:45
When I load the source EVO file into TsRemux, it correctly displays the elementary streams: VC-1 video and Dolby Digital Audio. However, it appears the DD+ audio stream is never remuxed into the target M2TS file.

When the resulting .MTS file is played back in Zoom Player, there is no sound and the graph information shows no audio track.

The EVO file I'm using as a test is the standard UNILOGO.EVO file found on all Universal HD-DVDs. My operating system is windows vista 32.

What am I doing wrong?

Zero1
9th May 2007, 22:04
Would it be possible to add an option to demux the files? That would be great :)

Momber
10th May 2007, 00:49
I may be doing something wrong. Please advise.

I load a properly decrypted EVO (Children of Men main feature EVO 1) into the remuxer. It correctly displays the streams and I select the VC1 video, the first ac3 audio (which is actually Dolby Digital Plus) and one subtitle stream. For output I first try TS and let the remuxer do its thing.
Upon completion I load the TS into HDTV2MPEG2 - it cannot find any channels. Then I open the TS with PowerDVD 6.5 and I get only a visualization and no audio. Then I open the TS with MPC and it cannot display the video, either, although WMVideo Decoder is set up as an external video decoder.

So I think "screw this" and go back to the remuxer, this time selecting m2ts as output. I copy the m2ts to my HPTC, which is set up to play both BluRay and HDDVD (and does so just fine). There, PowerDVD 7.3 is unable to do anything with the m2ts (it just freezes), as are ZoomPlayer and MPC.

What gives?
S.

dmz01
10th May 2007, 06:51
New version posted:

Fixed dolby digital plus remuxing.
Fixed various stream IDs.
Elementary stream demuxing added, includes support for demuxing presentation graphics streams into SUPreader compatible stream. (right click the selected stream with the mouse)

dmz01
10th May 2007, 06:57
I may be doing something wrong. Please advise.

I load a properly decrypted EVO (Children of Men main feature EVO 1) into the remuxer. It correctly displays the streams and I select the VC1 video, the first ac3 audio (which is actually Dolby Digital Plus) and one subtitle stream. For output I first try TS and let the remuxer do its thing.
Upon completion I load the TS into HDTV2MPEG2 - it cannot find any channels. Then I open the TS with PowerDVD 6.5 and I get only a visualization and no audio. Then I open the TS with MPC and it cannot display the video, either, although WMVideo Decoder is set up as an external video decoder.

So I think "screw this" and go back to the remuxer, this time selecting m2ts as output. I copy the m2ts to my HPTC, which is set up to play both BluRay and HDDVD (and does so just fine). There, PowerDVD 7.3 is unable to do anything with the m2ts (it just freezes), as are ZoomPlayer and MPC.

What gives?
S.

HDTV2MPEG2 only supports MPEG2 video, TS streams containing any other type of video will not work. Power DVD 6.5 as well as 7.3 will not demux those properly mainly due to new licensing restrictions. You can only play TS streams containg MPEG2 video and dolby digital (non plus) audio with 6.5 or any other older decoder package.

There is no way that I know off to play those "new codecs" TS streams in zoomplayer or any other player. However there is a way to play those M2TS streams in zoomplayer professional:

1) buy nero 7 and nero blu-ray/hd-dvd plugin
2) configure zoomplayer pro to use nero splitter, nero hd video decoder and nero audio decoder 2
3) rename zplayer.exe to recode.exe
4) associate M2TS files with recode.exe. :D

madshi
10th May 2007, 07:40
HDTV2MPEG2 only supports MPEG2 video, TS streams containing any other type of video will not work. Power DVD 6.5 as well as 7.3 will not demux those properly mainly due to new licensing restrictions. You can only play TS streams containg MPEG2 video and dolby digital (non plus) audio with 6.5 or any other older decoder package.

There is no way that I know off to play those "new codecs" TS streams in zoomplayer or any other player. However there is a way to play those M2TS streams in zoomplayer professional:

1) buy nero 7 and nero blu-ray/hd-dvd plugin
2) configure zoomplayer pro to use nero splitter, nero hd video decoder and nero audio decoder 2
3) rename zplayer.exe to recode.exe
4) associate M2TS files with recode.exe. :D
Shouldn't Haali's Media Splitter be able to demux those? At least it's supposed to support original Blu-Ray M2TS streams, I think (haven't tried that yet, though). If you think there's something missing in Haali's Media Splitter, we should tell him. I'm sure he'd add it quickly, if it's not too much work.

The_Keymaker
10th May 2007, 13:50
Dmz01,

Using the new release of your prog (v 0.0.3), I am still unable to Remux a DD+ audio stream.

I am remuxing the UNILOGO.EVO file from King Kong. I use this file as a test file since it does not not need to be demuxed and rebuilt using Evodemux (there is only one audio track (DD+)).

When I load the UNILOGO.EVO file into your program, it correctly shows both the video and audio streams, but when I Remux, NO AUDIO stream is present in the resulting M2TS file.

I am able to play the video in the resulting M2TS file (stutter free) in both PowerDVD 7.3 and ZoomPlayer.

Thank you for this utility. If We can get the audio worked out, I'll finally be able to remux my ripped HD-DVD library and play them in Zoomplayer instead of PowerVD 7.3, which occasionally stutters and uses overlay for HD-DVD instead of VMR9.

The_Keymaker

Momber
10th May 2007, 14:32
Thanks for your reply, dmz01.

HDTV2MPEG2 only supports MPEG2 video, TS streams containing any other type of video will not work.
I know it will not "work". I wasn't planning on using it - just wanted to see if it finds the streams and PID's OK, hence, if I have a "proper" transport stream at hand.

1) buy nero 7 and nero blu-ray/hd-dvd plugin
2) configure zoomplayer pro to use nero splitter, nero hd video decoder and nero audio decoder 2
3) rename zplayer.exe to recode.exe
4) associate M2TS files with recode.exe.
I have ZoomPlayer Pro set up to play BluRay m2ts files perfectly fine and it doesn't even take Nero to do that.
For demuxers, I can choose between Cyberlink Demux, Sonic HD Demuxer or the latest offering from Elecard. They work well on the m2ts's I tried them with, which came directly from BluRay rips.

I will do some tests with other EVOs as sources and report back.

S.

dmz01
10th May 2007, 15:05
New version 0.0.4:

Fixed bugs reported by users when converting EVOs to TS/M2TS. Let me know if you have issues with this version.

Momber
10th May 2007, 15:12
Ta.
I can't use 0.0.3, nor 0.0.4. "Insufficient System Resources".

S.

dmz01
10th May 2007, 15:14
Ta.
I can't use 0.0.3, nor 0.0.4. "Insufficient System Resources".

S.

.NET framework version? You need to have the latest 2.0 with all the fixes from windows update. Also what OS do you have? XP or Vista?