PDA

View Full Version : tychopper - Cut ty streams by chunk number



MrBassMan
01-24-2003, 03:39 PM
Open source, sold as seen - no support (apart from answering questions here when I feel like it) and no warranties.

This program will chop out a section of a .ty file by using chunk numbers, a chunk is 131072 bytes.

It's not using any rocket science, it simply seeks to an offset in the file and starts copying bytes into the destination file. Think of it as a blunt axe rather than a scalpel.

It was designed to allow sections of a ty file to be extracted for analysis by Olaf to fix problems with tydemux but it could also be used to split a large .ty file into more manageable smaller files.

Usage:
tychopper infile start end outfile

infile - name of the tystream to extract from
start - Number of the first chunk to extract
end - Number of the last chunk to extract
outfile - name of the file to extract to

i.e.
tychopper in.ty 1000 1500 out.ty
This will chop 500 chunks starting at chunk 1000

If tydemux fails, use the chunk numbers displayed by tydemux to extract the bad part. See Olaf's sticky thread for information on what to do with the extract.

This is the second release of the program.

Changes are:
Compiler performance optimisations turned on
Visual Studio project files released
Verifies the end chunk number is larger than the start chunk number
outfile is now made read/write, it used to be read only

This is a windows only build but the source is included and it should port easily to other platforms. Feel free to do so and post your changes here.

zobetron
01-24-2003, 04:45 PM
Before I get started please excuse my ignorance of the internals of an tyfile.

That said, I wonder how difficult it would be to modify your program to chop the ty file on a GOP? boundry or some other boundry that would not lose/corrupt/munge the data?

The reason I ask is that I have used the chopper to, in effect, edit out commerical breaks. I determine the in and out chunks and then create a bunch of segments from the original ty file (30 chunk padding on front and back). Then I run TyDemux on the the segments. I resample the audio files to 48mhz and convert to ac3.

The reason I am doing this is that the resultant .m2v files are accepted into Maestro (after DVDPatcher trick) without transcoding. This seems to work well in that the audio is in sync and I can add menus and chapters, etc.

It's just that I don't know if this proceedure is the best way to do this, ie., not losing anything in the chop. Maybe if olaf's program would allow jumping so many chunks into a ty file and then only demuxing a certain number of chunks like tysplit?

TIA,

Zobetron

captain_video
01-24-2003, 05:44 PM
A similar feature has been implemented in jdiner's tytool for quite some time. You can extract by FSID or you can extract a desired number of chunks beginning at any point you specify.

MrBassMan
01-24-2003, 07:05 PM
Originally posted by zobetron
Before I get started please excuse my ignorance of the internals of an tyfile.

That said, I wonder how difficult it would be to modify your program to chop the ty file on a GOP? boundry or some other boundry that would not lose/corrupt/munge the data?

The reason I ask is that I have used the chopper to, in effect, edit out commerical breaks. I determine the in and out chunks and then create a bunch of segments from the original ty file (30 chunk padding on front and back). Then I run TyDemux on the the segments. I resample the audio files to 48mhz and convert to ac3.

The reason I am doing this is that the resultant .m2v files are accepted into Maestro (after DVDPatcher trick) without transcoding. This seems to work well in that the audio is in sync and I can add menus and chapters, etc.

It's just that I don't know if this proceedure is the best way to do this, ie., not losing anything in the chop. Maybe if olaf's program would allow jumping so many chunks into a ty file and then only demuxing a certain number of chunks like tysplit?

TIA,

Zobetron
If you are a windows user, I am currently working with Olaf on something which will solve your problem.

Try jdiner's new gopeditor program, it's great. The trouble is you need to use vsplit to take the cut file and that produces broken streams.
BTW: Before people start flaming me because vsplit works for them - it does NOT work for lots of people, including me.

Now wouldn't it be nice if tydemux took the cut file? :cool:

Watch Olaf's thread with baited breath...... :D

rd001
01-25-2003, 01:30 PM
A convergence in functionality between the two leading projects is not a bad thing. It could be a Good Thing. Not that I'm telling anyone what they should do. I'm grateful for whatever I'm given by our talented extraction/muxing/demuxing developers.

Before we make remarks about our Tivo tools ("Program X doesn't work with my streams"), we should keep in mind that most of the ambitious frameserving tools or IfoEdit or Tmpgenc etc always have some people reporting "Well, it doesn't work for me".

But that doesn't mean they're bad tools. Sometimes it's very hard for small developers to have a full set of test data or to comprehensively test. And our developers are hobby developers. We can't expect universal functionality from them with the weird streams, the networking, all the different software people put on the Tivos, etc. Even an outfit like Tmpgenc that is getting substantial financial support can't do it. I can't grasp why people who are getting free software in from hobby developers think they should expect a great deal more than they get from paid developers.

It has sometimes been unfair to our developers. We take it for granted that they hang out here and answer our every little question. But this isn't a paying job for either of them. I just hope they don't get tired of us because I love these tools.

Just a few observations (not a scolding) that apply not only to jdiner and olaf but to all our hobby developers. Last I checked, no one was paying them a salary so we'd better hope they enjoy it and be grateful for what we get from their hard work.

saltydog4791
03-18-2003, 11:12 PM
Is there a way to know how many chunks are in a ty file without actually processing it? The reason I ask is because I am concerned with just chopping off the beginning and would rather not have to figure out what to put as the end point. Thanks to anyone who knows.

saltydog4791

MrBassMan
03-19-2003, 04:33 PM
Originally posted by saltydog4791
Is there a way to know how many chunks are in a ty file without actually processing it? The reason I ask is because I am concerned with just chopping off the beginning and would rather not have to figure out what to put as the end point. Thanks to anyone who knows.

saltydog4791

Put 99999999 as the end chumk number if this last chunk number is > number of chunks, it uses the end of file.