View Full Version : Wrapping MPEG2/4 in a transmission stream format - where do I start?
son_t
20th May 2009, 14:01
I'm a complete newbie but I want to find out how to do this. I want to transcode (?) an MPEG2 file into a transmission stream file using software/code. Any idea where I would start?
The root of this problem is wanting my Humax FOXSAT-HDR to be able to play some non-native video. Converting such video files to MPEG2 and wrapping it into the ts format and creating some index files that the box need, then hopefully this will work..?
Any ideas?
rack04
20th May 2009, 14:45
tsMuxeR would be a great place to start.
Blue_MiSfit
20th May 2009, 18:37
Indeed. tsMuxeR is probably the best transport stream muxing program I've ever used :)
I think ffmpeg can mux transport streams as well, but don't quote me on that.
~MiSfit
son_t
20th May 2009, 19:16
Thanks. It looks like a great tool, but unfortunately it does not work for my purposes - the HDR can not play the resulting file...
Is there a tool or a way of writing PIDs and video/audio IDs when muxing to ts?
Anyone got any ts or m2ts analysis tools so I can examine the ts files achieved off the Humax HDR?
Blue_MiSfit
20th May 2009, 19:40
Are you certain the files are encoded per the capabilities of your HDR?
I haven't determined how to mux tracks to selected PIDs in tsMuxeR - perhaps someone else has an idea?
Try here?
http://forum.doom9.org/archive/index.php/t-110761.html
~MiSfit
SeeMoreDigital
20th May 2009, 20:29
How are the files being inputted to your Foxsat-HDR?
son_t
21st May 2009, 09:03
Thanks for the replies.
I first used tsMuxeR to mux a vob file to m2ts (I think the HDR produces these files) but on playback, I get a 'scambled' message. I then muxed the vob file to a straight ts file, and this time I get a blank screen but no picture or sound. Being optimistic, I assume the HDR can't display the picture or sound because of missing PIDs...
Anyway, the Humax FOXSAT-HD can 'archive' SD recordings to an external USB hard drive. When exporting these files, the ts file is accompanied by two index type files (which are HDR specific). What I am doing in this first instance, is to export a recording and replacing the ts file of this with the muxed vob file I made. The HDR can play back exported files directly off the external USB drive.
The HDR is just a Linux based PVR, and more info about its filesystem can be found here: http://foxsatdisk.wikispaces.com/. I'll put some samples of its ts files on this wiki if anyone is interested in helping me out... please?
son_t
22nd May 2009, 10:38
I'm approaching the problem from another direction now. I don't know what conclusion to make now, but maybe you can help.
I've archived a recording from the HDR to a USB drive, and got tsMuxerGUI to demux the m2ts file. Here a screengrab: http://i442.photobucket.com/albums/qq149/son_tpics/demux.jpg
I then got the resulting files and muxed them back using tsMuxerGUI to an m2ts format. The resulting file gave a blank screen with no sound on the HDR but at least did not give the scrambled channel message.
dat720
22nd May 2009, 12:08
Can you post screen shots of before and after with mediainfo... it will contain allot more useful info.
son_t
22nd May 2009, 13:17
Thanks for the interest. Here's the info: before (.ts) (http://i442.photobucket.com/albums/qq149/son_tpics/tsRemuxer/mi-before.jpg) and after (.m2ts) (http://i442.photobucket.com/albums/qq149/son_tpics/tsRemuxer/mi-after.jpg). A more detailed demuxing screengrab is here (http://i442.photobucket.com/albums/qq149/son_tpics/tsRemuxer/mux2.jpg).
I can't see that mediainfo reveals anything more useful :( But the remuxed file is certain different (as I would expect - because, I am trying to re-create a muxed .ts file so that it is in the same format as to playback on the HDR.)
dat720
23rd May 2009, 06:56
What happens if you remux back to a ts?
The HDR seems to output to ts and you are muxing back to a m2ts if the HDR can't playback m2ts files that is going to be part of the problem.
PS if you click View and select Text in mediainfo you get very detailed information on the file.
SeeMoreDigital
23rd May 2009, 09:52
What happens if you remux back to a ts?
The HDR seems to output to ts and you are muxing back to a m2ts if the HDR can't playback m2ts files that is going to be part of the problem.Yep, I agree... keep the output as .TS
son_t
23rd May 2009, 20:34
I'll have a go at muxing them back to just the ts format, but I definitely think that the format is m2ts (even though the files are with .ts extension). The first demux screengrab (here (http://i442.photobucket.com/albums/qq149/son_tpics/demux.jpg)) comes up with the m2ts format warning...
I think the remuxed file does not play because the HDR needs to be able to detect video and audio PIDs... so I need piece of software to remux (or mux) and be able to enter suchs PIDs at the same time.
SeeMoreDigital
23rd May 2009, 20:52
There are differences in the way audio and video streams are muxed into the .TS or .M2TS containers.
The .TS container is predominately used for TV broadcasting. Indeed (as far as I know), no other type of container is used... So this "is" the container you "must" use.
EDIT: As dat720 mentioned earlier, you can use MediaInfo to establish the PID numbers of the streams within your original .TS captures.
Cheers
son_t
23rd May 2009, 21:04
TS/M2TS before:
General
ID : 7F9
Complete name : /Users/son/Desktop/Infernal Affairs III_20090319_0105.ts
Format : BDAV
Format/Info : BluRay Video
File size : 2.25 GiB
Duration : 2h 20mn
Overall bit rate : 2 304 Kbps
Video
ID : 2356 (0x934)
Menu ID : 9220 (0x2404)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Default
Duration : 2h 20mn
Bit rate mode : Variable
Bit rate : 1 881 Kbps
Nominal bit rate : 10 000 Kbps
Width : 544 pixels
Height : 576 pixels
Display aspect ratio : 16/9
Frame rate : 25.000 fps
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.240
Stream size : 1.84 GiB (82%)
Audio #1
ID : 2357 (0x935)
Menu ID : 9220 (0x2404)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 2h 19mn
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Video delay : -635ms
Stream size : 192 MiB (8%)
Language : English
Audio #2
ID : 2358 (0x936)
Menu ID : 9220 (0x2404)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 2h 19mn
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Video delay : -604ms
Stream size : 128 MiB (6%)
Language : nar
Text
ID : 2359 (0x937)
Menu ID : 9220 (0x2404)
Format : Teletext
Language : eng / eng
Menu
ID : 266 (0x10A)
Menu ID : 9220 (0x2404)
Format : MPEG Video / MPEG Audio / MPEG Audio / Teletext
List : 2356 (0x934) (MPEG Video) / 2357 (0x935) (MPEG Audio, eng) / 2358 (0x936) (MPEG Audio, NAR) / 2359 (0x937) (Teletext, eng / eng)
Language : / eng / NAR / eng / eng
TS after:
General
ID : 1
Complete name : /Users/son/Desktop/Infernal Affairs III_20090319_0105.track_2356.ts
Format : MPEG-TS
File size : 2.23 GiB
Duration : 2h 20mn
Overall bit rate : 2 278 Kbps
Maximum Overall bit rate : 35.5 Mbps
Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Default
Duration : 2h 20mn
Bit rate mode : Variable
Bit rate : 1 800 Kbps
Nominal bit rate : 10 000 Kbps
Width : 544 pixels
Height : 576 pixels
Display aspect ratio : 16/9
Frame rate : 25.000 fps
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.230
Stream size : 1.76 GiB (79%)
Audio #1
ID : 4352 (0x1100)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 2h 19mn
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Stream size : 192 MiB (8%)
Audio #2
ID : 4353 (0x1101)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 2h 19mn
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Stream size : 128 MiB (6%)
M2TS after:
General
ID : 1
Complete name : /Users/son/Desktop/Infernal Affairs III_20090319_0105.track_2356.m2ts
Format : BDAV
Format/Info : BluRay Video
File size : 2.28 GiB
Duration : 2h 20mn
Overall bit rate : 2 327 Kbps
Maximum Overall bit rate : 35.5 Mbps
Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Default
Duration : 2h 20mn
Bit rate mode : Variable
Bit rate : 1 904 Kbps
Nominal bit rate : 10 000 Kbps
Width : 544 pixels
Height : 576 pixels
Display aspect ratio : 16/9
Frame rate : 25.000 fps
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.243
Stream size : 1.86 GiB (82%)
Audio #1
ID : 4352 (0x1100)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 2h 19mn
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Stream size : 192 MiB (8%)
Audio #2
ID : 4353 (0x1101)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 2h 19mn
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Stream size : 128 MiB (6%)
EDIT: I just had a go at playing both of the ts and m2ts remuxed files on the HDR, and no success. It was the same result: no video or audio but the USB drive is flashing away as if it is being read when playing back a file from it...
SeeMoreDigital
23rd May 2009, 21:21
I don't understand what you mean by, "TS/M2TS before", "TS after" and "M2TS after".
Please begin by telling us what MediaInfo reports about your source?
Cheers
son_t
23rd May 2009, 21:25
I don't understand what you mean by, "TS/M2TS before", "TS after" and "M2TS after".
Please begin by telling us what MediaInfo reports about your source?
Cheers
TS/M2TS* means the original ts file achieved off the HDR. I think it is in the m2ts format, but you think otherwise (and the exported file extension) is .ts. Mediainfo reports the file as an m2ts file.
*I labelled this so because was the point of contention. I should have labelled it as the source ts file.
EDIT: BTW, all three files (orginal and the two remuxed) play just fine with VLC player... so it is not the muxing process that is not correct. It is more that the HDR needs the ts/m2ts file to be in an exact format for it to recognise and play back...
SeeMoreDigital
23rd May 2009, 21:54
Very strange...
Tell you what... Try running your captures thru' an application called MPEG2Repair (http://www.videohelp.com/tools/MPEG2Repair).
As "transport stream" muxing applications go it's quite old. That said, it is able to change a sources PID values to more "broadcast" compliant values. ie: 0x11 for video and 0x14 for audio.
By contrast, Blu-ray players (and AVCHD camcorders) look for video on PID 0x1011 and audio on PID 0x1100.
Cheers
dat720
24th May 2009, 00:37
Before muxing with tsMuxeR you can alter the meta file...
As SeeMoreDigital mentioned you might need to change the PID's, see below:
MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbr --vbv-len=500
V_MPEG4/ISO/AVC, "V:\Movies\HD\High School Musical 2.m2ts", insertSEI, contSPS, track=4113, lang=eng
A_AC3, "V:\Movies\HD\High School Musical 2.m2ts", track=4352, lang=eng
Should be changed to somehting like:
MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbr --vbv-len=500
V_MPEG4/ISO/AVC, "V:\Movies\HD\High School Musical 2.m2ts", insertSEI, contSPS, track=2356, lang=eng
A_AC3, "V:\Movies\HD\High School Musical 2.m2ts", track=2357, lang=eng
PS I Swear I have never watch High School Musical!!! Its the Wife!
son_t
26th May 2009, 13:10
Thanks for the ideas.
So I created the (untitled).meta file, as such:
MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbr --vbv-len=500
V_MPEG-2, "/Users/son/Desktop/Infernal Affairs III_20090319_0105.track_2356.mpv", insertSEI, contSPS, track=2356, lang=eng
A_MP3, "/Users/son/Desktop/Infernal Affairs III_20090319_0105.track_2357.mpa", track=2357, lang=eng
A_MP3, "/Users/son/Desktop/Infernal Affairs III_20090319_0105.track_2358.mpa", track=2358, lang=eng
And excuted tsMuxeR directly, as such:
8afbfc26:~ son$ /Applications/tsMuxerGUI.app/Contents/MacOS/tsMuxeR ~/Desktop/untitled.meta ~/Desktop/untitled.m2ts
SmartLabs tsMuxeR. Version 1.10.6 http://www.smlabs.net
0.0% complete
MPEG-2 muxing fps not set. Get fps from stream.
Decoding MPEG2 stream (track 1): Profile: Main@8. Resolution: 544:576i. Frame rate: 25
Decoding MPEG-Audio stream (track 2): Bitrate: 192Kbps Sample Rate: 48KHz Channels: 2 Layer: 2
Decoding MPEG-Audio stream (track 3): Bitrate: 128Kbps Sample Rate: 48KHz Channels: 2 Layer: 2
MPEG-2 stream does not contain fps field. Muxing fps=25
99.8% complete
Processed 210013 video frames
100.0% complete
Mux successful complete.
Muxing time: 4 min 4 sec
I then opened the file using MediaInfo, giving:
General
ID : 1
Complete name : /Users/son/Desktop/untitled.m2ts
Format : BDAV
Format/Info : BluRay Video
File size : 2.28 GiB
Duration : 2h 20mn
Overall bit rate : 2 327 Kbps
Maximum Overall bit rate : 35.5 Mbps
Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Default
Duration : 2h 20mn
Bit rate mode : Variable
Bit rate : 1 904 Kbps
Nominal bit rate : 10 000 Kbps
Width : 544 pixels
Height : 576 pixels
Display aspect ratio : 16/9
Frame rate : 25.000 fps
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.243
Stream size : 1.86 GiB (82%)
Language : English
Audio #1
ID : 4352 (0x1100)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 2h 19mn
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Stream size : 192 MiB (8%)
Language : English
Audio #2
ID : 4353 (0x1101)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 2h 19mn
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Stream size : 128 MiB (6%)
Language : English
So, it looks like it doesn't write the PIDs as needed, but I've yet to try playing it on the HDR... Unless I'm doing something wrong (I've also tried entering the PIDs as 0x934, etc. but same result).
@SeeMoreDigital: MPEG2Repair gives the error that it does not recognised the muxed file as a ts file. Also looking at the 'MUXOPT' - it seems like there's not muxing different between a ts and a m2ts file - unless tsMuxer does something different by detecting the output file's extension.
Any more ideas anyone? Does ProjectX mux to m2ts format?
SeeMoreDigital
26th May 2009, 16:37
@SeeMoreDigital: MPEG2Repair gives the error that it does not recognised the muxed file as a ts file. Also looking at the 'MUXOPT' - it seems like there's not muxing different between a ts and a m2ts file - unless tsMuxer does something different by detecting the output file's extension.Set TSmuxer to output the files as .TS streams. Then run them thru' MPEG2Repair ;)
As I mentioned previously, there are differences in the way audio and video streams are muxed into the .TS or .M2TS containers.
son_t
28th May 2009, 09:52
Thanks for the suggestion. I tried it and it did not work (no picture or sound just like previous attempts). MPEG2Repair seems not to allow me to enter the PIDs I want, but automatically assign some standard ones. MediaInfo says this about the resulting file:
General
ID : 3EA
Complete name : /Volumes/SILVER/Infernal Affairs III_20090319_0105.ts
Format : MPEG-TS
File size : 2.23 GiB
Duration : 2h 20mn
Overall bit rate : 2 278 Kbps
Video
ID : 17 (0x11)
Menu ID : 1 (0x1)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Default
Duration : 2h 20mn
Bit rate mode : Variable
Bit rate : 1 928 Kbps
Nominal bit rate : 10 000 Kbps
Width : 544 pixels
Height : 576 pixels
Display aspect ratio : 16/9
Frame rate : 25.000 fps
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.246
Stream size : 1.89 GiB (85%)
Audio
ID : 20 (0x14)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 2h 19mn
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Video delay : -120ms
Stream size : 192 MiB (8%)
dat720
28th May 2009, 10:26
There's a high chance that without a properly generate stream and index file you will be unable to get files to playback on the HDR.
You may have to resort to hex editing the PID's to the correct value if the suggested software packages are not setting them correctly.
And when i suggested changing the PID's in tsMuxeR i meant changing the metafile directly in the gui not creating a new one, it may reassign the values when you use the meta file like that... but it may not i don't know.
Sorry ignore that the most current version doesn't let you change the values in the GUI, i swear i've done it before tho!
son_t
28th May 2009, 10:35
I'll try the hexedit route... tsMuxerGUI does not allow you to change the metafile info as required (unless I am doing something wrong...)
SeeMoreDigital
28th May 2009, 14:39
As a side note....
Your source files bit-rate at 2000Kbps is very low for an MPEG-2 stream. Even when the resolution is just 544x576 pixels!
What does it look like?
son_t
28th May 2009, 19:20
It looks just fine - upscaled on the HDR and viewed on my 37" LCD TV...
The recording is made off Film4 (at 1am), and according to this site (http://www.digitalradiotech.co.uk/satellite_tv_bit_rates.php), 2000kbps seems right. The surprising fact from this site, is that Film4+1 broadcast at a higher bit rate of 2555kbps :eek: (always thought that the +1 channels have a lower bit rate by rule...
SeeMoreDigital
28th May 2009, 20:05
...The recording is made off Film4 (at 1am), and according to this site (http://www.digitalradiotech.co.uk/satellite_tv_bit_rates.php), 2000kbps seems right...I remember a time when 4000Kbps was considered too low for UK DTV broadcasting.
Given that TV display sizes have increased (since the 1998 launch of DTV in the UK), you'd think bit-rates would have increased to compensate too :eek:
son_t
29th May 2009, 21:55
I did a google and found this program: http://www.videohelp.com/tools/MPEG-VCR
Which I used to mux the mpv and one of the mpa files with specific PIDs... producing this ts file:
General
ID : 10
Complete name : /Volumes/SILVER/Infernal Affairs III_20090319_0105.ts
Format : MPEG-TS
File size : 1.99 GiB
Duration : 2h 20mn
Overall bit rate : 2 037 Kbps
Video
ID : 2356 (0x934)
Menu ID : 3 (0x3)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Default
Duration : 2h 20mn
Bit rate mode : Variable
Bit rate : 1 704 Kbps
Nominal bit rate : 10 000 Kbps
Width : 544 pixels
Height : 576 pixels
Display aspect ratio : 16/9
Frame rate : 25.000 fps
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.218
Stream size : 1.67 GiB (84%)
Audio
ID : 2357 (0x935)
Menu ID : 3 (0x3)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Duration : 2h 19mn
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Video delay : -80ms
Stream size : 192 MiB (9%)
On playback on the HDR there's a picture and pops of sound, but extremely pixellated - in fact there's nothing to indicate that its in the recording playing back at all! However, this is better than a black screen - no? Here's a screenshot of the picture (http://i442.photobucket.com/albums/qq149/son_tpics/tsRemuxer/pixelpic.jpg).
I now just need a program like this that can mux to m2ts... but maybe I'll try to mux to MPEG-PS using this program first...
dat720
30th May 2009, 00:57
Don't take this as me trying to fob you off... but it's quite obvious no one here has the same hardware as you which means we can do zero testing, is there no HDR specific forum you can share ideas with other owners?
son_t
30th May 2009, 21:28
Not at all. The HDR bunch, or rather the Freesat+ punters are pretty dim when it comes to this sort of thing - they're just consumers at the end of the day - rather than techies that is... I'm the best they've got ;) :D
SeeMoreDigital
30th May 2009, 22:01
Not at all. The HDR bunch, or rather the Freesat+ punters are pretty dim when it comes to this sort of thing - they're just consumers at the end of the day - rather than techies that is... I'm the best they've got ;) :DI must admit I'm interested in working this out but I don't have a Freesat HD recorder. Although I do watch Freesat HD via my Panasonic TV...
That said, a friend of mine has just bought a Humax Freesat HD box. I'll ask him to send me some short test clips captured to a USB flash-drive - I presume capturing to a USB flash-drive is possible?
son_t
31st May 2009, 09:59
Any ideas would be greatly appreciated...
You record programmes onto the internal HDD, then transfer to a USB device - you can't record directly on to USB, but can playback directly. You just need to find a flash drive that's compatible (some aren't).
I have uploaded a few recordings onto my wiki (and megaupload) which you can try out in the mean time: http://foxsatdisk.wikispaces.com/HDR+TS+Files
raydon
8th July 2009, 19:45
I'd like to help progress this project. I've been tinkering with this since I got my Foxsat HDR a few months ago, so it makes sense to pool information.
First I'd like to say that I've already had some success in importing and playing custom content on the HDR. It's early days yet, and it's not perfect, but I've proven beyond doubt that it's possible. I've uploaded the HD sample I made here (http://www.filefactory.com/file/ahb95fa/n/HD_Sample_zip), and the SD sample is here (http://www.filefactory.com/file/ahch485/n/SD_Sample_zip).
The HDR definitely uses standard, 192 byte packet, M2TS format even though the files are named with a .TS extension. The only difference between the HDR and standard M2TS streams are the stream PID's.
Blu-ray Video PID is 0x1011 (4113) and Audio PID is 0x1100 (4352). (These are the PID's assigned when you remux to M2TS with TSMuxer).
Humax assigns custom PID's and these are stored in the .HMT file, along with other infos like channel name, start/end times, and detailed program information. Once I found out where they were stored, it was just a matter of changing the PID values back to standard values using a hex editor. I'm still working on a detailed analysis of the .HMT file which I hope to post soon. In the meantime here are the offsets to the PID's you need to get you started.
0x041B 16 bit 0x1011 TS Video PID
0x041D 16 bit 0x1100 TS Audio PID
0x041F 16 bit 0x1011 TS Video PID repeated
First encode your new video and audio streams to match the format you want (SD or HD), and remux to M2TS with TSMuxer. I used TMPGEnc to create my SD video (the SD download includes the TMPGEnc SD template I used).
Now take a donor video previously recorded on the HDR, with the same run time as your custom video.
Replace the donor .TS file with your new M2TS file, renamed according to the donor file.
Use your favourite hex editor to change the PID's in the donor .HMT file to the standard PID's as above.
Copy the new video, and the two sidecar files back to the HDR. If all went according to plan it should now play.
However, it may stop short of the end, or play fully then show the 'scrambled' message and hang.
If it does hang, just press the stop playback button. I think the reason this happens is that the .NTS file indexes don't exactly match the play time of the replacement file. The 'Play from last played position' function doesn't work either (always plays from start) which I think confirms my suspicion about the .NTS file mismatch.
One nice feature is that the HDR still faithfully creates thumbnails and chapters overnight, as per native HDR videos.
To make the two samples I used a short clip, shot with my Canon HF100 HD camcorder. (Not exactly Steven Spielberg but it fitted the bill). It's of the harbour on the Greek island of Symi, which is about 30 miles northwest of Rhodes where I spent my summer holiday.
With the HD sample I just remuxed the original AVCHD streams to M2TS without the need for re-encoding (1920 x 1080i with Dolby AC3 stereo audio).
For the SD sample the same streams were re-encoded using TMPGEnc Plus (720 x 576i with MPEG 1 layer II audio).
Now if someone can just figure out how the the .NTS index file works, that would be a real breakthrough.......
son_t
8th July 2009, 19:58
WOW! I was just posting on another forum about this... Thanks for the work and progress - what a break through! I will have a go at looking at the .nts file...
First, I have to digest what you've just said... ;)
EDIT:
@raydon: Please join my wiki and put the info under the HDR TS Files section: foxsatdisk.wikispaces.com
P.S. what was the username on hummy.org.uk? I know an admin who might help :)
raydon
9th July 2009, 22:40
User name on hummy.org.is same as here, raydon. As to your wiki, I see you have copied my post to AV to TS conversion section. Is that where you want us to concentrate the knowledge base ?
son_t
10th July 2009, 09:09
Yes, or you can create a new page for technical info and put it under the TS section. (EDIT: I've now made two links for technical details of the hmt and nts files, on the left hand menu.)
I've contacted xyz321 of hummy.org.uk and of the humaxdisk wiki (http://humaxdisk.wikispaces.com/) (who is knowledgeable about the Humax 9200T - we worked together at one point on the fs of these boxes) and he informs me that:
The nts file looks similar'ish to the 9200 .elu file. I never did fully figure that one out. In the elu file there are timestamps (based on a 90kHz rate) and offsets into the file. The offsets into the file did not really correspond to the expected times so I was a bit stumped.
With the nts file the values at 0x0c to 0x0f, 0x2c to 0x2f etc might be a timestamp. If you look at the end of the file and compare it with the duration it should give you the rate. HD might run at a faster rate. The other values in the file don't really look like offsets into the file but they might be absolute postions on the disk if it is fragmented.
You may want to try not copying the nts file onto the disk to see if it works. The 9200 will run without an elu file although the indicated duration is wrong.
SeeMoreDigital
10th July 2009, 09:33
Now if someone can just figure out how the the .NTS index file works, that would be a real breakthrough.......Indeed it would...
Great work raydon ;)
raydon
10th July 2009, 17:11
Tried deleting the .nts file and the recording wouldn't play at all. Thanks for the suggestion though, it would have been nice if it had worked.
son_t
1st September 2009, 10:25
Well, there's the German 'equivalent' (cousin) of the Humax HDR called the iCORD. The Germans have produced a tool to de/mux and make the accompanied files and m2ts for AV playback on the box...
I've been testing this 'Platoon' tool to see if the produced files playback on the HDR, but no luck with a short mess around.
See here for more info: http://www.hummy.org.uk/forums/showthread.php?p=42378#post42378
Can anyone work out what is this tool is doing and recode it to make it work for the HDR? Please help...
paulalex
8th October 2009, 13:54
I've been reading this thread with interest as I own a Foxsat HDR and would also like to get my own videos onto the box. It seems that people are having problems with generating the .nts files.
I've managed to figure out the file structure of the .nts files for standard definition recordings by looking at some files from actual recordings off the foxsat and by also looking at the code from the Platoon project. (For those who know .net, open the platoon pnts.dll file in Reflector (http://www.red-gate.com/products/reflector/)).
To recreate the files you need to have a good understanding of the MPEG file structure, as the file is an index of all the PICTURE elements in the .TS file.
I'm no expert here, but have found that generally the MPEG structure is made up like such: PES -> SEQUENCE -> GOP -> PICTURE.
I've found this website to have a good description of the MPEG headers: http://dvd.sourceforge.net/dvdinfo/mpeghdrs.html
The .nts file is made up of 32 byte records. Each record contains the following data:
Byte Purpose Value
0 Frame Type PICTURE FrameType (0x01 = I; 0x02 = P; 0x03 = B)
1-3 Bytes from Sequence Address of PICTURE - Address of SEQUENCE
4-5 Bytes from Sequence to first Picture Address of 1st PICTURE in SEQUENCE - Address of SEQUENCE
6 Counter Increments by 1. One set of 0x00 to 0x0C then repeating sets of 0x04 to 0x0F *
7 SD/HD Flag 0x24 = SD
8-15 Picture Address Address of PICTURE
16-19 Presentation Timestamp The first 32 bits of PES pts **
20-23 Picture Size Address of Next PICTURE or SEQUENCE (whichever occurs first) - Address of PICTURE
24-27 Time Time in milliseconds ***
28-31 unused 0x000000
There's a couple of things to note here:
* The foxsat .nts files are inconsistant with the values in the initial set and repeating sets
** The PTS is stored in a 40 bit field within the MPEG structure, which includes 4 header bits and 7 filler bits, resulting in a 33 bit timestamp value. The nts file only contains the 32 most significant bits of this 33 bit value.
*** The foxsat .nts files have inconsistent jumps in the time value of around 2-3 seconds.
Sadly, I don't have time to develop and support any tools to generate these files, so hopefully somebody can take this information and make some use of it.
son_t
9th October 2009, 12:03
Great news and many thanks Paul... I am sure Raydon is knocking off a tool and is making progress... This would certainly help in our goal...
SeeMoreDigital
9th October 2009, 12:32
What I don't understand is why the "FoxSat" places its captures within the .M2TS container (which uses 192 byte packets) when the original transmission conforms to .TS which uses 188 byte packets!
son_t
9th October 2009, 13:31
Is this the behaviour of the Broadcom chipset inside the HDR?
raydon
9th October 2009, 13:37
Nice to see someone else is on the case. Thanks paulalex for progressing the cause, great work. For your information I am currently beta testing a tool I have written to create these files. Generation of hmt files is 100%, but at present I'm using the pnts.dll from Platoon to create the nts files.
paulalex
9th October 2009, 14:10
I think using the pnts.dll will be good enough for creating the nts files, and it supports HD .nts files too. No point reinventing the wheel if somebody has already done to coding for us.
I didn't get round to documenting the HD .nts file format, which has some extra fields at the end of the 32 bytes SD file format.
Raydon - I'd be happy to help beta test the tool you're working on. I'm looking at getting some of my DVD TV series onto the foxsat.
Does anyone know if the foxsat supports SD Video with AC3 audio? The files I've tried played without sound and I've had to re-encode them with MPEG Audio so far.
raydon
9th October 2009, 14:56
yes, you can use AC3 audio with SD video. P.M. me with an email address if you want to help with beta testing.
raydon
4th November 2009, 12:24
In order to get 100% working playback on the HDR with full seeking and resume, the source video must contain a valid sequence of GOP timestamps. Video streams extracted from DVD VOBs have GOP headers with all of the timestamps set to zero. Womble multimedia software all contain a GOP fixer tool which can rebuild these timestamps. Does anyone know of a freeware product that has the same function ?
raydon
21st November 2009, 14:44
Check out the thread HERE (http://www.hummy.org.uk/forums/showthread.php?t=6468) for details.
SeeMoreDigital
21st November 2009, 18:01
Great work Raydon...
Looks like it may be time for me to take the plunge and buy a Humax HDR receiver after-all.
Nice to see that TSremux lives on too ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.