MPEG-2 Transport Stream Support
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.
*******************************
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.
*******************************
I don't have a schedule for when my work will get added to the main code I'm afraid. At this point it's still very fresh and untested by many people beyond mealynpier wrote:Thanks for the job, awk ! I was really looking for that; I got EyeTV files too.
When will Handbrake add your stuff ? Because I am not able to test anything, since it is not in HB itself...
I anticipate another update to the code today and then some more testing. I'll have to let the lead developers (jbrjake and rhester et al) speak as to when they think it will make a release and when that release might be.
Transport Stream support patch available
At http://awkward.org/handbrake/mpeg2-ts-patch.tar.gz
You'll need to manually add the libhb/stream.c file to the project/makefiles (depending on platform) and then to the libhb and libhb dlib target.
It seems to work OK for me with the transport streams in common use here in the US for digital broadcasting so long as there is only one video stream (ie PMT/PAT filtering has already taken place). MPEG-2 Audio (and LPCM audio) in a transport stream is not supported yet (US broadcasts don't do this so I've not tested it yet. I do have a couple of test clips now though).
The program stream stuff should still work fine (VOB/.mpg files etc.) but there do still seem to be problems with Handbrake's handling of non-AC3 audio. I'm going to take a look at these problems next since I do have some Program Streams with non-AC3 audio (thanks folks).
Some more details are on my blog : http://awkward.org/2007/04/26/transport-stream-support/
You'll need to manually add the libhb/stream.c file to the project/makefiles (depending on platform) and then to the libhb and libhb dlib target.
It seems to work OK for me with the transport streams in common use here in the US for digital broadcasting so long as there is only one video stream (ie PMT/PAT filtering has already taken place). MPEG-2 Audio (and LPCM audio) in a transport stream is not supported yet (US broadcasts don't do this so I've not tested it yet. I do have a couple of test clips now though).
The program stream stuff should still work fine (VOB/.mpg files etc.) but there do still seem to be problems with Handbrake's handling of non-AC3 audio. I'm going to take a look at these problems next since I do have some Program Streams with non-AC3 audio (thanks folks).
Some more details are on my blog : http://awkward.org/2007/04/26/transport-stream-support/
Last edited by awk on Thu Apr 26, 2007 2:45 pm, edited 1 time in total.
Well I'd like to get this stuff checked in as soon as possible, because this so unbelievably cool.
I'm still having problems getting it to build, though. Same stuff I was getting before--parse errors trying to compile stream.c after I add it to the xcode project. I'm sure it's just idiocy on my part
I'm still having problems getting it to build, though. Same stuff I was getting before--parse errors trying to compile stream.c after I add it to the xcode project. I'm sure it's just idiocy on my part
Hmmm.... I did a 'resh sync' on a second machine this morning and applied the patches and built fine so I'm not sure what could be causing this. Can you give me the first 5-10 lines of errors and also which version of XCode and OS X etc. you have (just in case there's some funky tools issue here).jbrjake wrote: I'm still having problems getting it to build, though. Same stuff I was getting before--parse errors trying to compile stream.c after I add it to the xcode project. I'm sure it's just idiocy on my part
Re: Transport Stream support patch available
I'm far to be able to make that !!!awk wrote:You'll need to manually add the libhb/stream.c file to the project/makefiles (depending on platform) and then to the libhb and libhb dlib target.
Nice !
One of the potential uses for this (that only just occured to me) is for people who wish to transfer footage shot with a HDV Camcorder to H.264. Once I fix the MPEG-2 Audio issues you should be able to take a camera stream and transcode it (though getting the stream off the camera is a seperate task
This is actually the most reasonable way for someone to get a true 720p24 H.264 stream that they can test on an Apple TV ! JVC makes a couple of cameras which shoot at 720p24 - I'll try and grab one from work and make some test footage and convert it !
One of the potential uses for this (that only just occured to me) is for people who wish to transfer footage shot with a HDV Camcorder to H.264. Once I fix the MPEG-2 Audio issues you should be able to take a camera stream and transcode it (though getting the stream off the camera is a seperate task
This is actually the most reasonable way for someone to get a true 720p24 H.264 stream that they can test on an Apple TV ! JVC makes a couple of cameras which shoot at 720p24 - I'll try and grab one from work and make some test footage and convert it !
Hi awk,
I've just tried the patch against rev 553, and it applied cleanly. Whilst I can't "make", I can build the HandBrake target in Xcode with no problems.
However, when I launch HandBrake and select an MPEG transport stream via the "DVD Folder / image" browse button, I get an error of "No valid title found". This is a PAL transport stream recorded and exported by EyeTV 2.4. The file will open in MPEG StreamClip fine, and has one Video PID and one audio PID of MP2 stereo. Aha - maybe that's why? Because it only has MP2 audio?
BTW, the current version of HandBrake has something up with its DVD MPEG2 extraction, resulting in stuttery audio. If you can work out what the problem is as part of this work, then that's an extra bonus and saves me investigating it
- maurj.
I've just tried the patch against rev 553, and it applied cleanly. Whilst I can't "make", I can build the HandBrake target in Xcode with no problems.
However, when I launch HandBrake and select an MPEG transport stream via the "DVD Folder / image" browse button, I get an error of "No valid title found". This is a PAL transport stream recorded and exported by EyeTV 2.4. The file will open in MPEG StreamClip fine, and has one Video PID and one audio PID of MP2 stereo. Aha - maybe that's why? Because it only has MP2 audio?
BTW, the current version of HandBrake has something up with its DVD MPEG2 extraction, resulting in stuttery audio. If you can work out what the problem is as part of this work, then that's an extra bonus and saves me investigating it
- maurj.
I've only been using XCode myself, so this isn't too much of a surprise. I though make just launched xcodebuild (which uses the projects), I'll look into it for the next update.maurj wrote:Hi awk,
I've just tried the patch against rev 553, and it applied cleanly. Whilst I can't "make", I can build the HandBrake target in Xcode with no problems.
Yep - if it's a transport stream with MP2 stereo audio that's not going to report a valid title - a program stream should report a valid title (I think), but I've not tested it. I have a couple of transport stream clips with MP2 audio but they're hi-def from Sony & JVC cameras, if you can make available a short example clip for me I'll add it to my test matrix (only needs to be about 10megabytes or so - PM me the link if you wish).maurj wrote:However, when I launch HandBrake and select an MPEG transport stream via the "DVD Folder / image" browse button, I get an error of "No valid title found". This is a PAL transport stream recorded and exported by EyeTV 2.4. The file will open in MPEG StreamClip fine, and has one Video PID and one audio PID of MP2 stereo. Aha - maybe that's why? Because it only has MP2 audio?
There is a change I made - in sync.c I think - for handling MPEG2 stream packets with no PTS information. If you review the patch you should see it. That change could be tested/committed separately if it seems to fix the problem - basically if there's no PTS for a packet then I calculate the expected one and use that.maurj wrote:BTW, the current version of HandBrake has something up with its DVD MPEG2 extraction, resulting in stuttery audio. If you can work out what the problem is as part of this work, then that's an extra bonus and saves me investigating it
- maurj.
Hi awk,
Thanks for the work to get this into HandBrake - it's going to be a killer feature!
- maurj.
Me too (but I've never really looked into it).I've only been using XCode myself, so this isn't too much of a surprise. I though make just launched xcodebuild (which uses the projects), I'll look into it for the next update.
My error - it's a program stream, not a transport stream. I've PM'd you with a download link for a sample clip.Yep - if it's a transport stream with MP2 stereo audio that's not going to report a valid title - a program stream should report a valid title (I think), but I've not tested it.
Strange thing is, MPEG2 audio used to work. I've not yet done the regression to find out when it broke, but if I had to guess it would be "a long time back". If I get the time, I'll take a look at the change you made, and see if it can help out elsewhere.There is a change I made - in sync.c I think - for handling MPEG2 stream packets with no PTS information. If you review the patch you should see it. That change could be tested/committed separately if it seems to fix the problem - basically if there's no PTS for a packet then I calculate the expected one and use that.
Thanks for the work to get this into HandBrake - it's going to be a killer feature!
- maurj.
Ok - that makes sense - I have another test clip (from France) that's also EyeTV and is a program stream. It looks like EyeTV handles any PAT/PMT Filtering itself and just outputs a program stream - no problems.maurj wrote:
My error - it's a program stream, not a transport stream. I've PM'd you with a download link for a sample clip.
I took a little look at this tonight. Unfortunately it doesn't look goodkogyaru wrote: The patch correctly reads in VOB files, either named .vob or .mpg, but it doesn't seem to work with SVCD .mpg files. I'm interested in that as I've got a considerable archive of SVCDs.
The problem is that SVCD MPEG Elementary Stream Packets appear to have a length of 2300 (or so - the exact value escapes me right now) bytes. This is different from the DVD (and general digital broadcasting) standard of 2028 bytes (plus header data for a 2048 byte total length).
Handbrake's Program Stream Demuxer is pretty heavily skewed towards a compile time fixed packet length - it can be changed, but not dynamically - and there's little to no way to reflect 'left over data' back to the reading processes. So there's not even really an option right now for just using a larger buffer size and hoping that will do for DVDs.
Updating the program stream demuxing code to be more flexible would be a great thing but it's outside of my time right now I'm afraid. If others want to take it up I hope I can be of assistance and give some guidance but that's about all I can afford.
Sorry I don't have more positive news
Hey, thank you for looking into the matter. I managed to cobble together a script that uses ffmpeg to convert the streams into something acceptable for handbrake to use, so I'm OK -- but it's nevertheless a good bit of info to have about SVCDs and Handbrake dev.awk wrote:Updating the program stream demuxing code to be more flexible would be a great thing but it's outside of my time right now I'm afraid. If others want to take it up I hope I can be of assistance and give some guidance but that's about all I can afford.
Sorry I don't have more positive news
I've posted an updated (near final) patch to my website :
http://awkward.org/handbrake/mpeg2-ts-patch.tar.gz
There's one bug still in this patch - Transport Streams with anything other than AC-3/A.52 audio won't work correctly (you'll get silence) - unfortunately I don't have much test media to work on this problem with, all my transport streams have AC-3 audio in them. The streams I do have with MPEG audio are Program Streams (which work fine
http://awkward.org/handbrake/mpeg2-ts-patch.tar.gz
There's one bug still in this patch - Transport Streams with anything other than AC-3/A.52 audio won't work correctly (you'll get silence) - unfortunately I don't have much test media to work on this problem with, all my transport streams have AC-3 audio in them. The streams I do have with MPEG audio are Program Streams (which work fine
Patch updated
The patch has been updated for SVN Rev 591 (notably maurj's DTS changes).
I'm interested in anyone who has a Windows development system in giving my patch a try (note you'll need to update the makefiles etc. to add libhb/stream.c - no other changes should be neccessary).
I'm working on getting my linux system back to the state where it can build things (it's 'atrophied' Once the transport stream patches at least build on a linux machine (and hopefully Windows) I'll commit them.
The MPEG-Audio fixes (Ticket #51) have already been submitted.
I'm interested in anyone who has a Windows development system in giving my patch a try (note you'll need to update the makefiles etc. to add libhb/stream.c - no other changes should be neccessary).
I'm working on getting my linux system back to the state where it can build things (it's 'atrophied' Once the transport stream patches at least build on a linux machine (and hopefully Windows) I'll commit them.
The MPEG-Audio fixes (Ticket #51) have already been submitted.
-
- Novice
- Posts: 58
- Joined: Mon Feb 12, 2007 5:52 am
http://handbrake.m0k.org/trac/wiki/CompileGuidealynpier wrote:Hi,
I am not a developper, only a "single" user of Handbrake.
How can I add this feature to "my" copy of Handbrake ?
If someone can do this, is it possible to let it (the whole app) download somewhere ?
Thanks,
Hace a nice day,
...someone else was kind to point me to this a while back. I hope this is what you're looking for (the method/means of getting the most recent build under development).
Au Revoir!
Thank you for that, I knew it.
I used it to "make" my own of HB 0.8.5b1, but I wondered how I could include awk's patch.
I think I have made it !!!! Myself, I can't believe it !
I just added awk's "stream.c" to "~/HB-dev/libhb" folder and then re-make the app.
I got a new Handbrake, I'll do some tests with mpeg files exported from EyeTV. These are TV programs in DVB-T.
I used it to "make" my own of HB 0.8.5b1, but I wondered how I could include awk's patch.
I think I have made it !!!! Myself, I can't believe it !
I just added awk's "stream.c" to "~/HB-dev/libhb" folder and then re-make the app.
I got a new Handbrake, I'll do some tests with mpeg files exported from EyeTV. These are TV programs in DVB-T.