Page 1 of 20 12311 ... LastLast
Results 1 to 15 of 295

Thread: Support of ffmpeg with MPEG to TY+ encoding

  1. #1
    Join Date
    Nov 2002
    Posts
    1,076

    Support of ffmpeg with MPEG to TY+ encoding

    This is a non-development support thread for the ffmpeg code that includes TY+ encoding functionality. This tool can be handy for converting directly from .mpg or .avi or .vob to .ty/.ty+. Binary images can be found here:
    http://www.dealdatabase.com/forum/sh...92&postcount=2
    The development thread is:
    http://www.dealdatabase.com/forum/sh...ad.php?t=49935

  2. #2
    Join Date
    Dec 2002
    Location
    Chicago
    Posts
    114
    ok first question :^) this is probably more ffmpeg related than your special build related, but i just want to make sure i am on the right track.

    ideally i like to convert my VOBs to 3000 bitrate as that is kind of the threshold i see the space/quality arguement work out for me. in your suggested command lines you use a copy for the codec. i am trying to get the video to be as close as possible to the original source (frames, aspect, resolution, etc.) except for the bitrate. ((personally i just cant justify the space a full bitrate copy would take up vs. the perceived quality)).

    the command line i am trying to use that i THINK is going to accomplish this is:

    ffmpeg -i "%vobname%" -f mpeg2video -b 3000 -acodec copy "%filename%.ty"

    is there anything you guys think i should add/remove/change? i do want the full audio whatever it is. i want to preserve aspect ratio and other video attributes like i stated above - except bitrate (i think this is the biggest function of size right?).

    thanks for helping the not-so-comfortable.

    the few i did so far have looked great on the PC and transcoded MUCH faster (without the obvious extra step). i am transferring to tivoserver to see if the xml works out....

    thanks,
    shawn

  3. #3
    Join Date
    Nov 2002
    Posts
    1,076
    Quote Originally Posted by shstevens
    is there anything you guys think i should add/remove/change? i do want the full audio whatever it is. i want to preserve aspect ratio and other video attributes like i stated above - except bitrate (i think this is the biggest function of size right?).
    Personally I don't know as I don't have experience with down-converting. The only tivo I use is an hr10-250 for which down-converting is not normally a concern.
    That does look similar to the work flow some posted over in the tymplex support thread.

  4. #4
    Join Date
    Dec 2002
    Location
    Chicago
    Posts
    114
    I am not having luck finding a playable output file with any kind of downconverting. I may just use the old way until I can get it working.

    Can you tell me if there is XML support in this modification? It is almost automatic (with the -x flag and an XML with the same name as the files to be muxed) with tymplex.

    thanks for your work on this, and let me know if you would like any help testing or anything - i am always game to help out with a little direction :^)

    shawn

  5. #5
    Join Date
    May 2005
    Posts
    317
    I've pulled some .ty streams off my Tivo with TyTool10r4, and then used the same to edit out commercials and mux it to MPG. I have then used the ty enabled ffmpeg (cygwin 1.2 binary) to create a new .ty file. Once uploaded with Tivoserver, the video looks perfect. My question is this: Where did the closed captions go? Are they lost during the TyTool processing, or during the ffmpeg processing? And is there any way to maintain them?

  6. #6
    Join Date
    Nov 2002
    Posts
    1,076
    Quote Originally Posted by whitepelican
    I've pulled some .ty streams off my Tivo with TyTool10r4, and then used the same to edit out commercials and mux it to MPG. I have then used the ty enabled ffmpeg (cygwin 1.2 binary) to create a new .ty file. Once uploaded with Tivoserver, the video looks perfect. My question is this: Where did the closed captions go? Are they lost during the TyTool processing, or during the ffmpeg processing? And is there any way to maintain them?
    I'm currently not generating a subtitle stream in the .TY file. In tymplex, nova1 was generating subtitling info, but only by extracting it from DVD closed captioning info, using magic numbers that weren't obvious.
    Looks like tytool supports closed captioning as well. I don't see it documented, but probably it is using DVD format. I would check with the tytool folks. You may also want to verify that you've got the closed captioning info with a sofwtware mpeg player. If tytool is using dvd closed captioning format it shouldn't be hard to add the necessary logic to ffmpeg.
    Analog subtitles I think will "just work".

  7. #7
    Join Date
    Jan 2002
    Posts
    1,030
    It will be great to be able to keep the CC data. I found SCC tools and from the information I read it is possible to add the CC data to a MPG file.

    I don't know how hard (or even possible) to handle CC1, CC2, CC3 and CC4. Now there are some shows with CC1 in English and CC2 in Spanish. If possible then people could add the CC data for any language in other CCx.

  8. #8
    Join Date
    Nov 2002
    Posts
    1,076
    Quote Originally Posted by shstevens
    I am not having luck finding a playable output file with any kind of downconverting.
    Not sure what you mean.
    Quote Originally Posted by shstevens
    Can you tell me if there is XML support in this modification? It is almost automatic (with the -x flag and an XML with the same name as the files to be muxed) with tymplex.
    I included my support to add or change the XML, but I didn't add a flag to pass in template XML. Wouldn't be hard to add. Probably want to do so without libxml however, since libxml makes it more difficult for folks to compile the source, and was a support mess last time around.
    Quote Originally Posted by shstevens
    thanks for your work on this, and let me know if you would like any help testing or anything - i am always game to help out with a little direction :^)
    Thanks. You could go figure out phat_bastard's trick play problems
    Or you could do a bake-off between mplex&ffmpeg to figure out if there are any cases that mplex handles that ffmpeg should have but doesn't.

  9. #9
    Join Date
    Jul 2003
    Posts
    111
    A DTV TY file has two sources of CC info: one in the TY CC records and one in the MPEG user data. I don't know what the format is for the MPEG CC user data though. You can see some of the fields incrementing suggesting a timestamp of some sort.

    I took the DVD CC data array format and output a TY CC record based on the most recent GOP timestamp + offset. The offset value is based on the index position of the CC data in the array((TIVO_TIMESCALE*(i/29.97))). If tytool10r4 outputs CC data in DVD CC format, then it shouldn't be that difficult to convert to TY CC records.

  10. #10
    Join Date
    Nov 2002
    Posts
    1,076
    Quote Originally Posted by nova1
    A DTV TY file has two sources of CC info: one in the TY CC records and one in the MPEG user data.
    And a 3rd in the VBI (vertical blanking interval). This is the analog subtitles I was talking about. This is kind of the problem with CC/subtitles. So many formats it can be stored in, so many types. Not clear to me which ones are the most important.
    Ok if I crib from your DVD CC parsing code into ffmpeg? Or you could do it if you want..

  11. #11
    Join Date
    Dec 2002
    Location
    Chicago
    Posts
    114
    Quote Originally Posted by bcc
    Not sure what you mean.
    I included my support to add or change the XML, but I didn't add a flag to pass in template XML. Wouldn't be hard to add. Probably want to do so without libxml however, since libxml makes it more difficult for folks to compile the source, and was a support mess last time around.
    Thanks. You could go figure out phat_bastard's trick play problems
    Or you could do a bake-off between mplex&ffmpeg to figure out if there are any cases that mplex handles that ffmpeg should have but doesn't.
    When i changed from the suggested arguments of "-vcodec copy" to other combinations (please realize i am far from an ffmpeg expert), i could not get a playable .ty file. with the copy passthrough codec i could, but for me the filesize was so big for the quailty. i am mainly using this to archive movies ripped from dvds on my tivoserver. i have 2 terabytes but i want to be somewhat judicial on space...

    can you describe how you support xml? i have become pretty good at building xml templates on the fly to "attach" with the tymplex method of inclusion, but if i understood your way i could probably adapt. i am not sure how tymplex does it, i just provide an XML file with the same name as the VOB with the information i want in it and, well, magic happens, heh.

    what is the trick play stuff - not familiar with what you are talking about there.

    shawn

  12. #12
    Join Date
    May 2005
    Posts
    317
    Quote Originally Posted by bcc
    Ok if I crib from your DVD CC parsing code into ffmpeg? Or you could do it if you want..
    You might want to look it over to see if it can be improved upon at the same time. I've used Nova's Tymplex build on hundreds of VOBs and I would say it is completely successful (with regards to CCs) on only about 15-20% of them. On the rest, there is a timing issue that causes the CCs to get written to the screen too late, but usually still cleared at the correct time. This means that many of the captions end up only being displayed for a fraction of a second. I'm sure one of you genii can figure it out, though.

  13. #13
    Join Date
    Nov 2004
    Posts
    177
    Perhaps a silly question, but is it safe to assume that the audio stream needs to be pre-converted to the desired format?

    From your dev. thread:

    ffmpeg -i src.ac3 -itsoffset 0.798 -i src.m2v -acodec copy -vcodec copy dest.ty
    In the above, the video stream start delayed 798ms after AC3 audio stream.
    Would this be for insertion into a DTivo only since you are using an AC3 stream (it appears the audio stream is simply copied due to the "-acodec copy" option?

    I have some short clips I want to convert and insert into my SAS1, but the audio is in AC3 currently AC3 and (from what I remember) the S1 uses MP2 @ 32khz.

    Thanks.

  14. #14
    Join Date
    Nov 2002
    Posts
    1,076
    Quote Originally Posted by mbellot
    Perhaps a silly question, but is it safe to assume that the audio stream needs to be pre-converted to the desired format?
    If it isn't already in the desired format then you need to pre-convert it. I do not know the complete answer to the question of what the "desired format" is, as different tivo models have different requirements. Several people have posted conversion scripts to fulfill their own requirements, you could try one of those, or the scripts that are built in to tivoserver.
    Quote Originally Posted by mbellot
    Would this be for insertion into a DTivo only since you are using an AC3 stream (it appears the audio stream is simply copied due to the "-acodec copy" option?
    Yes in that example the ac3 audio is copied into ac3 .ty records. I should think the DVD tivo handles ac3 as well, so I'd hesitate to label ac3 as a dtivo thing.
    Quote Originally Posted by mbellot
    I have some short clips I want to convert and insert into my SAS1, but the audio is in AC3 currently AC3 and (from what I remember) the S1 uses MP2 @ 32khz.
    I suspect that's right but I have no first hand info.

  15. #15
    Join Date
    Nov 2002
    Posts
    1,076
    Quote Originally Posted by whitepelican
    You might want to look it over to see if it can be improved upon at the same time. I've used Nova's Tymplex build on hundreds of VOBs and I would say it is completely successful (with regards to CCs) on only about 15-20% of them. On the rest, there is a timing issue that causes the CCs to get written to the screen too late, but usually still cleared at the correct time. This means that many of the captions end up only being displayed for a fraction of a second. I'm sure one of you genii can figure it out, though.
    If the CC stuff is buggy I'm not interested in incorporating it. I don't use CC, and you seem to be the only one aware of the issues (the only user?) so maybe you need to step up to the plate...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •