PDA

View Full Version : Support of ffmpeg with MPEG to TY+ encoding



Pages : [1] 2

bcc
06-27-2006, 08:52 PM
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/showpost.php?p=258392&postcount=2
The development thread is:
http://www.dealdatabase.com/forum/showthread.php?t=49935

shstevens
06-27-2006, 10:14 PM
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

bcc
06-27-2006, 11:00 PM
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.

shstevens
06-27-2006, 11:30 PM
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

whitepelican
06-27-2006, 11:35 PM
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?

bcc
06-28-2006, 02:18 AM
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".

bato
06-28-2006, 12:00 PM
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.

bcc
06-28-2006, 01:07 PM
I am not having luck finding a playable output file with any kind of downconverting.Not sure what you mean.

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.

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.

nova1
06-28-2006, 01:12 PM
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.

bcc
06-28-2006, 01:23 PM
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..

shstevens
06-28-2006, 02:13 PM
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

whitepelican
06-28-2006, 04:26 PM
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.

mbellot
06-28-2006, 04:56 PM
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.

bcc
06-28-2006, 09:47 PM
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.

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.
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.

bcc
06-28-2006, 10:03 PM
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...

Jamie
06-28-2006, 10:39 PM
If it isn't already in the desired format then you need to pre-convert it. Why pre-convert? I've had success converting XVid avi to (mpeg2video+ac3) ty in a single step. For example:

ffmpeg -i <show>.avi -acode ac3 -ab 384 -b 3000 -vcodec mpeg2video <show>.ty

I have had a few tivo reboots when playing these streams though, so I'm not completely confident in the ty remux at this point. Here's a tverr entry from the most recent crash:

Jun 29 02:31:56 (none) TmkAssertionFailure[235]: : (TakeMemoryChunk, line 305 ())
Jun 29 02:31:56 (none) Thread Mediaswitch0[235]: Tmk Fatal Error: Thread Mediaswitch0 <235> strayed! (block timestamp 357754022209160)
Jun 29 02:31:57 (none) Thread Mediaswitch0[235]: bt -t /tvbin/tivoapp
...

bcc
06-28-2006, 10:48 PM
Why pre-convert?I thought by pre we were just referring to before insertion.
I have had a few tivo reboots when playing these streams thoughOh oh. Would be good to get to the bottom of that.

whitepelican
06-28-2006, 11:20 PM
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...

Well, my programming experience is pretty limited. If you have any industrial machinery you need programmed, I could take a look at it.

As far being the only CC user, I find that hard to believe. Do none of the rest of you have three screaming children and a hard-of-hearing sister?

Jamie
06-28-2006, 11:21 PM
I thought by pre we were just referring to before insertion.Guess I misunderstood. Sorry.
Oh oh. Would be good to get to the bottom of that.I'm not sure I can lay the blame on ty-enabled ffmpeg. On the last crash, the stream had a non-tivo-standard resolution and frame rate. It seemed to play ok, but the tivo crashed when I deleted it from the tivo ui. I'll report back if I continue to see crashes, hopefully with a solution.

mbellot
06-28-2006, 11:32 PM
I thought by pre we were just referring to before insertion.

No, I was actually referring to converting formats before muxing to ty format with ffmpeg. Sorry for the lack of clarity.

Guess I'll have to dig into ffmpeg options to see how/if I can pass it an ac3 input and get mp2 (or m2a if you prefer) muxed into the TY file. :eek:

Thanks again.

Jamie
06-28-2006, 11:53 PM
Guess I'll have to dig into ffmpeg options to see how/if I can pass it an ac3 input and get mp2 (or m2a if you prefer) muxed into the TY file. :eek: It's pretty easy. Just specify mp2 for the audio codec in the command line I listed above (instead of the ac3 I used). Adjust the audio bitrate to suit (-ab).

SAS2's can playback ac3, but I guess S1's don't?

shstevens
06-29-2006, 03:16 AM
I finally figured out how to downconvert and get a playable TY - here it is in case anyone wants to copy it:



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


the nice thing is that it seems to sense aspect ratio (i had always had two batch files - one for 16:9 and one for 4:3, so this is nice whether it is your build or just my dumb luck finding it :^)

i would love to test the XML type, but i will need to wait for a windows compiled binary with that component.

thanks for your work on this! real timesaver.

shawn

mbellot
06-29-2006, 09:43 AM
It's pretty easy. Just specify mp2 for the audio codec in the command line I listed above (instead of the ac3 I used). Adjust the audio bitrate to suit (-ab).

SAS2's can playback ac3, but I guess S1's don't?


Interesting about the SAS2s. According to TiVo (http://customersupport.tivo.com/knowbase/root/public/tv251080.htm), the only standalones that support AC3 are the DVD Tivos.

Then again, I guess it makes sense they (S2s) all would since the basic hardware isn't that different.

I ran a quick check with a short (100MB) VOB file and it failed first time (I used -vcodec copy, since I thought mpeg2 video was mpeg2 video - guess not). The picture was way screwy.

Second time I changed it to -b 3000 -vcodec mpeg2video and it worked great. The filesize shrank, which I assume was due to the lower bitrate (3000 vs ~ 4000 in the original file).

Now I'm going to queue up the real job, a 2 hour video. :eek:

Many thanks!

mbellot
06-29-2006, 02:46 PM
Well spank my britches and call me crazy, it worked (I think). :D

I haven't had a chance to upload it to the S1 yet, but Media Player Classic plays it back just fine (with the TY codec).

Tonight it gets sent to the Tivo for the final test.

bcc: If this works you will have made one six year old girl VERY happy. :cool:

cheer
06-29-2006, 02:55 PM
EDIT: bad taste. Sorry.

bcc
06-29-2006, 05:01 PM
Well spank my britches and call me crazy, it worked (I think).That's great. Only thing is you make it sound like you couldn't ever get tymplex to work before? ffmpeg should simply be easier/faster and sometimes better.

shstevens
06-29-2006, 06:11 PM
New output errors. TY seems to play fine (uploading to Tivo now to check XML), but wanted to post in case it helped at all. The are at the end after the master chunk generation....



Multiplexing Audio and Video into TY format...
FFmpeg version SVN-r, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --disable-ffplay --disable-ffserver
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on Jun 29 2006 01:28:36, gcc: 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
Input #0, mpeg, from 'd:\vobs\Slapshot.VOB':
Duration: 02:03:00.1, start: 0.280633, bitrate: 7802 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480, 9800 kb/s, 29.97 fps(r)
Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, 192 kb/s
Output #0, ty, to 'd:\tys\Slapshot.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 720x480, q=2-31, 3000 kb/s, 29.97 fps(c)
Stream #0.1: Audio: ac3, 48000 Hz, stereo, 192 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
Generating master chunk for chunks 0:4095379.6 bitrate= 0.0kbits/s
Generating master chunk for chunks 4096:8191
Generating master chunk for chunks 8192:12287
Generating master chunk for chunks 12288:16383
Generating master chunk for chunks 16384:20479
Generating master chunk for chunks 20480:22598
Found XML but rewrite failed, appending instead...
Successfully wrote new XML
frame=221204 q=2.0 Lsize= 0kB time=7380.8 bitrate= 0.0kbits/s
video:2129275kB audio:172988kB global headers:0kB muxing overhead -100.000000%
4867 [main] ffmpeg 4292 _cygtls::handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
63172 [main] ffmpeg 4292 open_stackdumpfile: Dumping stack trace to ffmpeg.exe.stackdump
65885 [main] ffmpeg 4292 _cygtls::handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
66341 [main] ffmpeg 4292 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)


shawn

bcc
06-29-2006, 06:57 PM
Answer is over here:http://www.dealdatabase.com/forum/showthread.php?p=258935#post258935
Boy I'm so glad there's two separate threads :)

Update: The crash after the XML completes successfully is my bug and I've got a fix.

bato
06-29-2006, 07:01 PM
Boy I'm so glad there's two separate threads :)
Yea, I'm tracking both threads now. Maybe you can ask a mod to join them and work like the TyTool thread, only if a new major version is out a new thread is started. Will get bigger but then you don't have to answer twice.

You can include a link after you update the diff or bin files to point to the first post in the thread about this new version (just an idea), making all other posts obsolete.

shstevens
06-29-2006, 07:49 PM
Answer is over here:http://www.dealdatabase.com/forum/showthread.php?p=258935#post258935
Boy I'm so glad there's two separate threads :)

Update: The crash after the XML completes successfully is my bug and I've got a fix.

Sorry about asking about a support thread, was just trying to follow protocol :^).

The XML doesn't seem to be working, I assume because of the error...

When you say "your XML needs to be bounded by 512 # marker bytes", can you elaborate for us denser folks? I would be happy to do this, but I am not sure what it means.

thanks,
shawn

rrr22777
06-29-2006, 08:55 PM
I finally figured out how to downconvert and get a playable TY - here it is in case anyone wants to copy it:



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


the nice thing is that it seems to sense aspect ratio (i had always had two batch files - one for 16:9 and one for 4:3, so this is nice whether it is your build or just my dumb luck finding it :^)

i would love to test the XML type, but i will need to wait for a windows compiled binary with that component.

thanks for your work on this! real timesaver.

shawn

How do I pipe this to tivoserver so I dont have wait for it to complete before I can watch it?

mbellot
06-29-2006, 11:45 PM
That's great. Only thing is you make it sound like you couldn't ever get tymplex to work before? ffmpeg should simply be easier/faster and sometimes better.

I tried with tymplex a couple times, even went so far as to get a cygwin shell/source tree running, but it just never seemed to work right.

And ffmpeg is most definitely faster and more "featured". When I was done with the TY+ conversion I converted the one VOB I was most interested in to WMV7 format with only a couple command line modifications.

And just as a "final" update... The TY+ file loaded onto the S1 (took ~ 1.75 hours) and appears to play totally fine. FF/FR, 30 sec. and 15 min. skip all seem to work perfectly. I bumped the video rate to 4000 to preserve the maximum quality and the Tivo seems fine with that too.

Once again, fantastic job bcc.

Jamie
06-30-2006, 12:44 AM
How do I pipe this to tivoserver so I dont have wait for it to complete before I can watch it?If you can find an old version of tivoserver that used an external script to convert to ty, you might be able to adapt that. The current version links directly to the ffmpeg/libavformat/libavcode, as well as to a modified version of tymplex, so it needs to be modified before you'll be able to take advantage of the new ty-enabled ffmpeg. There's talk about going back to allowing an external transcode/remux script.

bcc
06-30-2006, 10:16 PM
Yea, I'm tracking both threads now. Maybe you can ask a mod to join them and work like the TyTool thread, only if a new major version is out a new thread is started. Will get bigger but then you don't have to answer twice.

Tytool is a special case, in that it is closed source, so there is no chance for actual development collaboration. For ffmpeg, maybe I should have waited for a development discussion to have broken out before making a thread.
You can include a link after you update the diff or bin files to point to the first post in the thread about this new version (just an idea), making all other posts obsolete.I have posted lots of links, and kept the current versions at the top of the thread; I just added 1 more link from the dev. thread to the support thread. Now you can follow the links in a circle if you want. :)

bcc
06-30-2006, 10:29 PM
Sorry about asking about a support thread, was just trying to follow protocol :^).Don't worry; two distinct threads seems to be the preferred organization around here. I was just following protocol as well.

The XML doesn't seem to be working, I assume because of the error...

I'm a little surprised you guys are confused by this, as I simply made the XML template stuff work just like I originally did with the '-x' argument to tymplex. If you wanted something different it would have been good to detail it. It's pretty clear that for ease of use, it would be nice for '-x' to work with or without the .ty+ marker bytes. So I've tweaked the code so that it will (not in vers. 0.3).
When you say "your XML needs to be bounded by 512 # marker bytes", can you elaborate for us denser folks? I would be happy to do this, but I am not sure what it means.
In .ty+ format, the XML is immediately preceded by 512 '#' characters, and followed by 512 '#' characters. Ie 512 # characters, then the '<?xml ... </Object>' then 512 # characters.

bcc
06-30-2006, 10:33 PM
I tried with tymplex a couple times, even went so far as to get a cygwin shell/source tree running, but it just never seemed to work right.

And ffmpeg is most definitely faster and more "featured". When I was done with the TY+ conversion I converted the one VOB I was most interested in to WMV7 format with only a couple command line modifications.

And just as a "final" update... The TY+ file loaded onto the S1 (took ~ 1.75 hours) and appears to play totally fine. FF/FR, 30 sec. and 15 min. skip all seem to work perfectly. I bumped the video rate to 4000 to preserve the maximum quality and the Tivo seems fine with that too.

Once again, fantastic job bcc.Fair enough. I suspect you could have used tymplex as well, with vanilla ffmpeg to downconvert the individual streams first, being careful to keep track of the a/v sync in the process...
Thanks for the update.

shstevens
07-01-2006, 04:05 PM
Don't worry; two distinct threads seems to be the preferred organization around here. I was just following protocol as well.
I'm a little surprised you guys are confused by this, as I simply made the XML template stuff work just like I originally did with the '-x' argument to tymplex. If you wanted something different it would have been good to detail it. It's pretty clear that for ease of use, it would be nice for '-x' to work with or without the .ty+ marker bytes. So I've tweaked the code so that it will (not in vers. 0.3).In .ty+ format, the XML is immediately preceded by 512 '#' characters, and followed by 512 '#' characters. Ie 512 # characters, then the '<?xml ... </Object>' then 512 # characters.

Ahh, ok. I didn't have to do that with tymplex so this is the first I heard of it. Thanks for the detail though. I am ABSOLUTLEY happy with the same -x functionality by the way, i was just having trouble with it because if the #'s I suppose.

I appreciate your work on this - I really do.

Do the #'s have to be on seperate lines or can they be all on a single line and then followed with the XML code..

Thanks,
Shawn

BTUxNine
07-01-2006, 04:30 PM
It should be a single, uninterrupted line of 512 #s... line breaks would break some of the code.

shstevens
07-01-2006, 04:40 PM
It should be a single, uninterrupted line of 512 #s... line breaks would break some of the code.

thanks, trying it again now.

shawn

lennier
07-02-2006, 12:20 AM
with these tools is it possible to do the reverse? That is, take a .ty file and reencode it to .avi/divx?

cheer
07-02-2006, 12:40 AM
No. For that you can use either TyTool or hdemux/mplex. Either will turn a .ty into a .mpg, and you can use whatever encoding tool you like from there.

shstevens
07-02-2006, 01:56 AM
Sorry to keep coming back, I am hopefully not usually this dense! I am still having trouble with the XML, although the xcoding seems to be working wonderfully. I am hoping I can post my method and example XML and see if I am just boneheading something up....

Commandline to xcode:


ffmpeg -x "Tommy Boy.xml" -y -i "Tommy Boy.VOB" -vcodec mpeg2video -b 3000 -acodec copy "Tommy Boy.ty"


Sample XML file (Tommy Boy.xml in this case):


#################################################################################################### #################################################################################################### #################################################################################################### #################################################################################################### #################################################################################################### ###########
<?xml version="1.1" tivoversion="6.2-01-2-301"?>
<Object type="Recording" id="_top">
<SubObject type="Showing" id="Showing">
<Object type="Program" id="Program">
<Actor></Actor>
<DescLanguage>English</DescLanguage>
<Description>Chris Farley, David Spade, Dan Aykroyd, Brian Dennehy, Bo Derek. An incompetent, immature, and dimwitted heir to an auto parts factory must save the business to keep it out of the hands of his new, con-artist relatives and big business.</Description>
<EpisodeTitle></EpisodeTitle>
<IsEpisode>0</IsEpisode>
<OriginalAirDate>9225</OriginalAirDate>
<Title>Tommy Boy</Title>
</Object>
<Object type="Station" id="Station">
<CallSign>DVD</CallSign>
<Name>DVD</Name>
</Object>
</SubObject>
</Object>
#################################################################################################### #################################################################################################### #################################################################################################### #################################################################################################### #################################################################################################### ###########


Output error from ffmpeg:


Found XML but rewrite failed, appending instead...
Successfully wrote new XML


Any ideas?

Thanks,
Shawn

Vegas
07-04-2006, 08:27 AM
Got the following error during make.

tymaster.c:42: error: ‘CHUNK_MAX_PER_SEG’ undeclared here (not in a function)
make[1]: *** [tymaster.o] Error 1
make[1]: Leaving directory `/opt/ffmpeg/libavformat'
make: *** [lib] Error 2

I added "#define CHUNK_MAX_PER_SEG 4096" to tydefs.h and was able to compile without further error. Just don't know if this is the right way to fix it.

Build on FC5 with gcc 4.1.1 (ffmpeg ver 5510 w/1.3 patch)
./configure --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --disable-ffplay --disable-ffserver

Just an FYI on the error. I'm testing mpg to ty using copy (ffmpeg -i /input.mpg -acodec copy -vcodec copy /output.ty). So far I've converted some mpg's, that tivoserver had a problem with, to ty's and am able to serve them up without error.

Edit: Wow, even adds the external xml data. VERY COOL


Vegas

smatson
07-06-2006, 02:11 PM
Hi hope some one can help but how do i use the program ffmpeg

is it from the cmd or run

thanks steven :)

bcc
07-07-2006, 04:25 PM
Sorry to keep coming back, I am hopefully not usually this dense! I am still having trouble with the XML,
ShawnYou're only including 511 # characters, not 512.

The next round of diffs I post will make those optional so this isn't a chore.

bcc
07-07-2006, 04:34 PM
Vegas[/QUOTE]

I added "#define CHUNK_MAX_PER_SEG 4096" to tydefs.h and was able to compile without further error. Just don't know if this is the right way to fix it.
You must be the 1 person that downloaded the diffs before I made the fresh builds and re-posted things. Sorry, I thought I could squeak that fix in without renumbering the build. Basically I renamed that constant at the last minute, as 4096 is not actually the max. # of chunks in a segment, just the typical #. I've seen longer segments on my hr10-250 lately.

That fix is fine, or you could re-grab the diffs which contain the equivalent fix.

bcc
07-07-2006, 04:38 PM
No. For that you can use either TyTool or hdemux/mplex. Either will turn a .ty into a .mpg, and you can use whatever encoding tool you like from there.Or hdemux+ffmpeg to go straight to .avi or .divx. Just be sure to use -itsoffset option to ffmpeg to maintain a/v sync.

rbautch
07-10-2006, 01:22 AM
Here's a little dos script that batch encodes multiple videos sequentially. I remember seeing some similar scripts in the tivoserver thread, but IIRC, they all required the file path/filename as an argument, which is tedius if your converting 50 movies. This one runs without arguments... just season to taste.

edit: Added a second version that supports avi's, mpg's, and vob's in the same source folder, and encode each type with different options. It also allows you to stop/interrupt the encoding process, and remember which file you left off on when you run it again.

drez
07-10-2006, 01:41 AM
thanks rbautch,

i just did about 10 (out of 30) videos earlier today with tyffmpeg one by one.

this is really gonna help :]

shstevens
07-10-2006, 02:15 AM
i have one that builds an xml, but i am still trying to get it to work properly. doing testing - when done i will post it. it is more complicated, and may be more than people want, but people can edit it easy enough. it uses arguements as filename (which also converts to title), description (which i fill in with actors at the beginning), then release date (goes through the little math to get the right date).

a few questions on your though...

why did you do -ab 384? i just do -acodec copy and it seems to work ok. seems less futzing with the audio stream the better - but i am by no means an expert...

i see you are hardcoding 16:9. i am still playing with arguements that aim to negate the need for that. my commandline as it goes right now (still testing mind you) is:

ffmpeg -x "filename.xml" -y -i "vobname.vob" -b 4000 -acodec copy "filename.ty"

shawn

p.s. if figured out the XML issues I was having above being related to the fact that I guess i can only count to 510...

shstevens
07-10-2006, 02:52 AM
Here is mine - seems to be working fine for 5.1 and non 5.1. Seems to work with 4:3 and 16:9 as well. I only really use this for VOBs so that is all I can attest to. It creates the XML that is necessary to make me happy. Feel free to use if you like, or not :^)

For usage, I just paste in a bunch of movies into the command line such as:


vob2ty.cmd "Billy Madison.VOB" "Adam Sandler, Bridgette Wilson, Norm MacDonald. In order to inherit his fed up father's hotel empire, an immature and lazy man must repeat grades 1-12 all over again." 1995
vob2ty.cmd "Happy Gilmore.VOB" "Adam Sandler, Christopher McDonald, Carl Weathers. A rejected hockey player puts his skills to the golf course to save his grandmother's house." 1996
vob2ty.cmd "Schindler's List.VOB" "Liam Neeson, Ben Kingsley, Ralph Fiennes. 1994 Best Picture Winner. Oskar Schindler uses Jews to start a factory in Poland during the war. He witnesses the horrors endured by the Jews, and starts to save them." 1993
vob2ty.cmd "Slapshot.VOB" "Paul Newman, Jennifer Warren. A failing ice hockey team finds success using constant fighting and violence during games." 1977
vob2ty.cmd "The Omen.VOB" "Gregory Peck, Lee Remick. An American ambassador learns to his horror that his son is actually the literal Antichrist." 1976
vob2ty.cmd "The Sting.VOB" "Paul Newman, Rober Redford. 1973 Best Picture Winner. In 1930s Chicago, a young con man seeking revenge for his murdered partner teams up with a master of the big con to win a fortune from a criminal banker." 1973
vob2ty.cmd "Tommy Boy.VOB" "Chris Farley, David Spade, Dan Aykroyd, Brian Dennehy, Bo Derek. An incompetent, immature, and dimwitted heir to an auto parts factory must save the business to keep it out of the hands of his new, con-artist relatives and big business." 1995


BAT/CMD file (vob2ty.cmd in my case)


@echo off
set vobname=%1
set description=%2
set dateyear=%3
echo "Usage: vob2ty.cmd [vobfilename] [description of movie] [release date]"
echo.
echo.

if "%dateyear%"=="" echo Defaulting to released in 2000... && set dateyear=2000

set vobname=%vobname:"=%
set description=%description:"=%
set /A datevalue=(((%dateyear%-1970)*365)+100)
rem SET VARIABLES HERE
set progdir=c:\tivoserver
set filename=%vobname:~0,-4%
set targetdir=d:\tys
set sourcedir=d:\vobs

if not exist %targetdir%\*.* mkdir %targetdir%
if not exist %sourcedir%\*.* mkdir %sourcedir%

echo Creating "%targetdir%\%filename%.xml" file for %vobname%...
echo.

@echo off
echo #################################################################################################### #################################################################################################### #################################################################################################### #################################################################################################### #################################################################################################### #############> "%targetdir%\%filename%.xml"
echo ^<^?xml version^="1.1" tivoversion^="6.2-01-2-301"^?^> >> "%targetdir%\%filename%.xml"
echo ^<Object type^="Recording" id^="_top"^> >> "%targetdir%\%filename%.xml"
echo ^<SubObject type^="Showing" id^="Showing"^> >> "%targetdir%\%filename%.xml"
echo ^<Object type^="Program" id^="Program"^> >> "%targetdir%\%filename%.xml"
echo ^<Actor^>^<^/Actor^> >> "%targetdir%\%filename%.xml"
echo ^<DescLanguage^>English^<^/DescLanguage^> >> "%targetdir%\%filename%.xml"
echo ^<Description^>%description%^<^/Description^> >> "%targetdir%\%filename%.xml"
echo ^<EpisodeTitle^>^<^/EpisodeTitle^> >> "%targetdir%\%filename%.xml"
echo ^<IsEpisode^>0^<^/IsEpisode^> >> "%targetdir%\%filename%.xml"
echo ^<OriginalAirDate^>%datevalue%^<^/OriginalAirDate^> >> "%targetdir%\%filename%.xml"
echo ^<Title^>%filename%^<^/Title^> >> "%targetdir%\%filename%.xml"
echo ^<^/Object^> >> "%targetdir%\%filename%.xml"
echo ^<Object type^="Station" id^="Station"^> >> "%targetdir%\%filename%.xml"
echo ^<CallSign^>DVD^<^/CallSign^> >> "%targetdir%\%filename%.xml"
echo ^<Name^>DVD^<^/Name^> >> "%targetdir%\%filename%.xml"
echo ^<^/Object^> >> "%targetdir%\%filename%.xml"
echo ^<^/SubObject^> >> "%targetdir%\%filename%.xml"
echo ^<^/Object^> >> "%targetdir%\%filename%.xml"
echo #################################################################################################### #################################################################################################### #################################################################################################### #################################################################################################### #################################################################################################### #############>> "%targetdir%\%filename%.xml"

echo Multiplexing Audio and Video into TY format...

%progdir%\ffmpeg -x "%targetdir%\%filename%.xml" -y -i "%sourcedir%\%vobname%" -b 4000 -acodec copy "%targetdir%\%filename%.ty"

del /Q "%targetdir%\%filename%.xml"

start /i copy /Y "%targetdir%\%filename%.ty" "\\disk\d$\tys\%filename%.ty"



BTW, THANK YOU SO MUCH for this awesome tool!!

Shawn

rbautch
07-10-2006, 03:24 PM
why did you do -ab 384? i just do -acodec copy and it seems to work ok. seems less futzing with the audio stream the better - but i am by no means an expert...My source files were DivX avi's with mp3 audio. Using the -acodec copy would use the original mp3 audio and cause tivoserver to choke. For DVD vob rips, I use much the same command you do.


i see you are hardcoding 16:9. i am still playing with arguements that aim to negate the need for that. My source files were 16:9 DVD rips letterboxed to fit 3:2. Without the 16:9 switch, there were gettting stretched vertically instead of letterboxed on a standard TV. On my high def set, it looked fine without the 16:9 switch.

shstevens
07-10-2006, 03:29 PM
My source files were DivX avi's with mp3 audio. Using the -acodec copy would use the original mp3 audio and cause tivoserver to choke. For DVD vob rips, I use much the same command you do.

My source files were 16:9 DVD rips letterboxed to fit 3:2. Without the 16:9 switch, there were gettting stretched vertically instead of letterboxed on a standard TV. On my high def set, it looked fine without the 16:9 switch.

Gotcha - makes sense. Just making sure I wrap my head around all the options.

Shawn

bcc
07-10-2006, 03:33 PM
BTW, THANK YOU SO MUCH for this awesome tool!!

ShawnYou're welcome.
I assume you guys haven't found problems with a/v sync or experienced the trick play issues that phat_bastard keeps mentioning?

rbautch
07-10-2006, 03:40 PM
Here is mine - seems to be working fine for 5.1 and non 5.1. Seems to work with 4:3 and 16:9 as well. I only really use this for VOBs so that is all I can attest to. It creates the XML that is necessary to make me happy. Feel free to use if you like, or not :^) It might also be useful to append the xml file with a TMSID and other fields that define the show as a series, so when tivoserver transfers them, they get sucked up into a folder. The videos wouldn't necessarily need to actually be a series... for example, DVD rips could show up in a folder called "DVDs".

shstevens
07-10-2006, 04:07 PM
You're welcome.
I assume you guys haven't found problems with a/v sync or experienced the trick play issues that phat_bastard keeps mentioning?

I have no trick play issues or sync issues (other than sync issues I had with mplex that were resolved by VideoRedo's quick stream fix - so i unless you have a built in mechanism for fixing that - and i haven't tried - i just still use that method for VOBs that show weird durations or bitrates on firing up ffmpeg).

i ONLY use this for VOBs though so i am not really the best test subject i suppose.

shawn

shstevens
07-10-2006, 04:10 PM
It might also be useful to append the xml file with a TMSID and other fields that define the show as a series, so when tivoserver transfers them, they get sucked up into a folder. The videos wouldn't necessarily need to actually be a series... for example, DVD rips could show up in a folder called "DVDs".

I am not sure how to do that, but it sounds interesting. I just keep them on my Tivoserver in the directory that matches the genre closest (comedy, drama, best picture winner, adult, etc.) When I suck it down it appears in the root. Folders are not that important to me as I don't archive series. I just have like 700 VOB rips from DVD and other than genre, a folder wouldn't make much sense. Since i usually just pull down a movie to watch, organization on the Tivo isn't that important.

would be a cool process to learn though in case i do archive series in the future. i am generally a "watch and delete" kind of guy when it comes to shows, but like to have movies around to stream whenever.

i am SOOOO hoping the 6.3 for HDTivos will work with MRV and Tivoserver. I have two regular and two HD and we watch most of the movies in the HD one. I now just manually MFS_FTP them, but that isn't very wife friendly, heh.

shawn

rbautch
07-10-2006, 04:22 PM
You're welcome.
I assume you guys haven't found problems with a/v sync or experienced the trick play issues that phat_bastard keeps mentioning?No problems with DVDrips, DivX avi's, or Tytool vobs. Great job on this tool!!

drez
07-10-2006, 05:52 PM
I am not sure how to do that, but it sounds interesting. I just keep them on my Tivoserver in the directory that matches the genre closest (comedy, drama, best picture winner, adult, etc.) When I suck it down it appears in the root. Folders are not that important to me as I don't archive series. I just have like 700 VOB rips from DVD and other than genre, a folder wouldn't make much sense. Since i usually just pull down a movie to watch, organization on the Tivo isn't that important.

would be a cool process to learn though in case i do archive series in the future. i am generally a "watch and delete" kind of guy when it comes to shows, but like to have movies around to stream whenever.

i am SOOOO hoping the 6.3 for HDTivos will work with MRV and Tivoserver. I have two regular and two HD and we watch most of the movies in the HD one. I now just manually MFS_FTP them, but that isn't very wife friendly, heh.

shawn

I havent been able to insert my tyffmpeg'd tys with MFS_FTP (I was thinking the same thing as you) but it might be my fault somehow

anything wrong with this line (mpeg1 videos as source; using rbautchs script):



ffmpeg -i "%sourcepath%\%%~nx.mpg" -acodec mp2 -ab 192 -vcodec mpeg2video -b 2500 "%destpath%\%%~nx.ty"

also another issue is that when I put the ty's in my tivoserver folder, they show up with the correct month/day on the tivo, but at the bottom of the list (probably a missing value for year?)

when i insert them with mfs_ftp (even though they dont play) they show the correct month/day and theyre correctly at the top of my list, i suppose its a tivoserver issue.




UPDATE:

I was pretty tired when I posted this yesterday....

It was my fault, I was inserting the tyffmpeg ty's into /ty/, sending them to /ty+/ (I can't believe I forgot about the xml..) worked fine.
They play, have the correct month/day, and are correctly at the top of my NPL.

If I put that same ty in one of my tivoserver folders, they play, have the correct month/day, but are at the end of my NPL.





I will probably be using tyffmpeg/rbautch's .bat/mfs_ftp more than tivoserver now ;)
I love being able to queue up movies without using the remote.

Thanks bcc for your work.

rbautch
07-10-2006, 10:24 PM
Switches look fine in your command line. Does it work?

drez
07-11-2006, 01:52 PM
I just tried two tyffmpeg'd tys on different tivos and they both show up at the bottom of the Now Playing List when inserting with tivoserver.

mk1277
07-14-2006, 12:17 AM
I have to say that this little app (along with rbautch's batch file) is amazing and made my life easier.

I've been ripping my DVD collection to a 500GB hard drive as a single VOB for each movie. I've had some success, but overall about 50% of the movies would either not load into the now playing list of my PC or crash the tivoserver app. I've been hoping for improved VOB support, but it's been kinda slow in coming.

I just tested the batch conversion of VOB to ty, using ffmpeg and it's basically flawless. All VOBs that I had problems with before, now play perfectly as ty. I have had no audio sync issues (a couple minor drops here and there) and the video quality is great. Many thanks for making my Home Media Server a reality. My kids thank you too. :)

JohnSorTivo
07-14-2006, 10:13 AM
Thought I'd add my kudos for ty enabled ffmpeg as well.

I suffered with audio sync issues for many of my transcoded vobs as well, using both mplex externally and built-in transcoding via tivoserver.

So far, every vob that I gave up on due to audio sync issues, transcodes and plays without issue using ty enabled ffmpeg.

shstevens
07-14-2006, 02:47 PM
when i was converting tons of movies to upload to the tivo (before this tool and tivoserver), i was using ncftp as a commandline ftp program. it would work with mfs_ftp so i could transfer after the conversion. go to sleep and wake up with 30 new shows converted and already on the tivo.

just thought i would mention it, should be easy to find. this was an example of the command line i used for reference.

ncftpput -E -P 3105 tivo1 /ty d:\tivoconversions\*.ty

(change it to ty+ if you have xml i am pretty sure though - i did this before xml).

Rorschach
07-23-2006, 09:08 AM
How do I integrate this version of FFMPEG with tivoserver.exe? I placed it in the same directory and ran tivoserver which crashed when I tried to trasfer Tmpgenc .mpg files. Is there a link to instructions anywhere? Or is it just native .ty files that this works with?

I'm just trying to get already converted files on the directivo without the on the fly encoding.

Vegas
07-23-2006, 10:36 AM
How do I integrate this version of FFMPEG with tivoserver.exe?

I would love to see this integrated into tivoserver. Its been bullitproof with every file i've processed.

I'm a long ways from being a C programmer, but I am willing to help. If there is anything I can do to help get this into tivoserver, let me know.

Vegas

bcc
07-23-2006, 01:32 PM
How do I integrate this version of FFMPEG with tivoserver.exe? I placed it in the same directory and ran tivoserver which crashed when I tried to trasfer Tmpgenc .mpg files. Is there a link to instructions anywhere? Or is it just native .ty files that this works with?

I'm just trying to get already converted files on the directivo without the on the fly encoding.Some coding would need to be done on the tivoserver side to make that happen. I don't have an HMO capable tivo yet (thanks directv!) so I'm not in a position to do it. Recommend you ask the tivoserver folks.

Rorschach
07-23-2006, 02:24 PM
Is there any kind of shell or wraparound to run FFMPEG? The primary thing I need to do with it is convert 25 fps .avi (Xvid) files to 29.97 fps .mpg files I can upload to the Tivo. Ideally, I'd like the .mpg files to be 480x480 resolution with the aspect ratio of the original preserved.

BTUxNine
07-23-2006, 02:29 PM
How do I integrate this version of FFMPEG with tivoserver.exe? I placed it in the same directory and ran tivoserver which crashed when I tried to trasfer Tmpgenc .mpg files. Is there a link to instructions anywhere? Or is it just native .ty files that this works with?

I'm just trying to get already converted files on the directivo without the on the fly encoding.
Convert your files to .ty format, then place them in a directory that tivoserver is serving video from.

stealthdave
07-24-2006, 07:25 PM
Where can one find a sample XML file for use with ffmpeg? I know I can pull one from any program currently on my TiVo using MFS_FTP, but what about the "padding" that needs to be done? I'd love to have a little mini-doc on how to prepare an XML file for creating a ty+ file.

On a separate topic, does this work with Series 1 TiVos, or only Series 2? I haven't tested on my TiVo yet (due to the aforementioned XML issue). If no one knows, I'm more willing to risk marital discord and put my TiVo at risk to test it! ;)

rbautch
07-25-2006, 01:48 PM
I'd like to upload some high-def home movies to my HR10-250. The videos are in .m2t HDV format, and I've read that the standard ffmpeg supports .m2t files, but ty-ffmpeg seems to choke on them. Is this possibile this functionality could be added, or is it already there and my particular videos are the problem?

Rorschach
07-25-2006, 03:41 PM
rbautch:

Is there any reason why your batch files that do work with ty-ffmpeg would not work with the regular ffmpeg.exe program? ffmpeg is a versatile program and I'm trying to use it to make a series of svcd .mpg files to burn on discs instead of .ty files to upload to my Dtivo. I just can't get the tivoserver program to work and my transfers are always incomplete or crash tivoserver.

The batch files exit without doing anything when I substitute the regular version of ffmpeg on my PC.

BTUxNine
07-25-2006, 03:48 PM
I'd like to upload some high-def home movies to my HR10-250. The videos are in .m2t HDV format, and I've read that the standard ffmpeg supports .m2t files, but ty-ffmpeg seems to choke on them. Is this possibile this functionality could be added, or is it already there and my particular videos are the problem?
The precompiled binary here doesn't include any external codecs... if you want that support, looks like you may have to roll your own.

Jamie
07-25-2006, 04:17 PM
The precompiled binary here doesn't include any external codecs... if you want that support, looks like you may have to roll your own.... where roll your own simply means configure and compile from source. You shouldn't have to write any code.

bcc
07-25-2006, 04:42 PM
Where can one find a sample XML file for use with ffmpeg? I know I can pull one from any program currently on my TiVo using MFS_FTP, but what about the "padding" that needs to be done? I'd love to have a little mini-doc on how to prepare an XML file for creating a ty+ file.I've just uploaded a newer version, version 1.4 that makes the XML marker optional, so all the hubbub you might have read about that no longer applies. A sample XML file would be:
<?xml version="1.1" tivoversion="3.1.5-01-2-357"?>
<Object type="Recording" id="_top">
<SubObject type="Showing" id="Showing">
<Object type="Program" id="Program">
<DescLanguage>English</DescLanguage>
<Description>A cyborg (Arnold Schwarzenegger) from the future must protect John Connor (Nick Stahl) from a superior model sent to kill him.</Description>
<Director>Mostow|Jonathan</Director>
<Object type="Series" id="Series">
<Title>Terminator 3: Rise of the Machines</Title>
</Object>
<Title>Terminator 3: Rise of the Machines</Title>
</Object>
</SubObject>
</Object>
On a separate topic, does this work with Series 1 TiVos, or only Series 2? I haven't tested on my TiVo yet (due to the aforementioned XML issue). If no one knows, I'm more willing to risk marital discord and put my TiVo at risk to test it! ;)I should think it'd work but I haven't tested. Worst that should happen is your tivo reboots trying to play the file.

rbautch
07-25-2006, 11:14 PM
rbautch:

Is there any reason why your batch files that do work with ty-ffmpeg would not work with the regular ffmpeg.exe program? ffmpeg is a versatile program and I'm trying to use it to make a series of svcd .mpg files to burn on discs instead of .ty files to upload to my Dtivo. I just can't get the tivoserver program to work and my transfers are always incomplete or crash tivoserver.

The batch files exit without doing anything when I substitute the regular version of ffmpeg on my PC.Instead of double-clicking on the batch script, open a dos command prompt, and run the batch file with the start command. This will show you what the actual error is. I bet it's a file not found or mistyped directory.

drez
07-26-2006, 12:04 AM
Yeah, the batch script opens and closes very quickly when I double click it, ive always run it from the command prompt.

The rbautch's .bat *does* work if you run it from a command line... here's a tip:

Download this Microsoft PowerToy (if you like this one, get the rest here: http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx)

http://download.microsoft.com/download/whistler/Install/2/WXP/EN-US/CmdHerePowertoySetup.exe (514KB)

it adds a "Open Command Window Here" to the right-click list of every folder...

so all you have to do is right click the folder the batch file is in, click "Open Command Window Here", and type:
tyffmpeg.bat

you can do the same thing for tivoserver.

the window won't close by itself, it will just go back to the command prompt.

zippy7272
07-26-2006, 06:26 AM
Help!

I've used ffmpeg and mplex before to encode from .avi to an .m2a and m2v file then onto a .ty.

So finding this thread today, is really good, I can use one command to convert, which I guess must make the process quicker.

However, when I try the command line or the scripts, the resulting file plays far too quickly. What am I doing wrong?

I'm in the UK, if that makes any difference...

stealthdave
07-26-2006, 03:58 PM
I should think it'd work but I haven't tested. Worst that should happen is your tivo reboots trying to play the file.
It works great! The only thing you have to remember is that S1 TiVos are very picky about their audio format. Audio must be 32kHz with a bitrate of 192k in mpeg2 audio format. Here's the ffmpeg command-line that I used:

ffmpeg -i OPTIMUS_HIGH.avi -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video -x optimus.xml -s 720x480 -b 3000 -r 29.97 optimus.ty
It's probably picky about the video format as well, but less so. I have one of the first Phillips models, and these settings looked fantastic. Of course, YMMV.

Great job, bcc! Now I need to motivate myself to build a Mac gui. ;)

bcc
07-26-2006, 07:29 PM
Help!

I've used ffmpeg and mplex before to encode from .avi to an .m2a and m2v file then onto a .ty.

So finding this thread today, is really good, I can use one command to convert, which I guess must make the process quicker.

However, when I try the command line or the scripts, the resulting file plays far too quickly. What am I doing wrong?

I'm in the UK, if that makes any difference...UK may make a difference as the ffpmeg code treats the PAL frame rate as the uninitialized frame rate, so there may be a problem with that rate.
Are you using version 1.3 or version 1.4 of my diffs?
I assume your video's frame rate is the PAL rate of 25fps?
When you say two quickly do you mean 10X too quickly, or just a little bit (like NTSC vs PAL rate issues)?
Output from ffmpeg, including your command line arguments may help, or it might require a sample clip if the problem is involved.

bcc
07-26-2006, 07:35 PM
It works great! The only thing you have to remember is that S1 TiVos are very picky about their audio format. Audio must be 32kHz with a bitrate of 192k in mpeg2 audio format. Here's the ffmpeg command-line that I used:Well S1 Dtivos support AC3 so that's not a general s1 restriction. I think we had all these conversations before concerning tymplex. The idiosyncrasies for what tivo models support what frame rates and resolutions should be the same for tymplex and ffmpeg. In fact tivo.com's list of frate rates and resolutions for HMO/TTG is a good starting point.

Great job, bcc! Now I need to motivate myself to build a Mac gui. ;)Thanks. Would be nice for any GUI work to not be just MAC specific. Note tivotool is a MAC-centric GUI for tymplex, which could probably be easily adapted for ffmpeg instead.

zippy7272
07-27-2006, 05:58 PM
UK may make a difference as the ffpmeg code treats the PAL frame rate as the uninitialized frame rate, so there may be a problem with that rate.
Are you using version 1.3 or version 1.4 of my diffs?


1.4


I assume your video's frame rate is the PAL rate of 25fps?


yes


When you say two quickly do you mean 10X too quickly, or just a little bit (like NTSC vs PAL rate issues)?


proabably 10x (or even faster!)


Output from ffmpeg, including your command line arguments may help, or it might require a sample clip if the problem is involved.

I think it was the .avi in the end, as others have worked ok.
Having said that, besides just being fast, it would also take forever to process (I always gave up), Normally my PC will process 1.5 secs or so per update (every .5 sec?), however this particular one would start at a third of that speed, and get slower,m and slower, until it would be processing a FRAME a second, at which point I killed it anyway.

SO... I downloaded a different version that plays fine as a .avi, but still went slow.

I convert to DVD in the end, as lif eis too short.

But I'm still curious what the problem is. I've done maybe 4-5 other films since which have been fine.

Thanks for the work on this.

And thanks for any suggestions

tas3086
07-31-2006, 12:33 PM
I download the .ty and .xml files from tivo, then edit out commercials, and upload with the -x option pointing to the original .xml file. Works like a champ.

The file does not have 512 #'s (front and end) , but it still seems to work fine.
All information on tivo is correct, even the duration gets changed! While uploading, the filename displays in Tivo, but after upload, everything changes to what I would expect.

What's happening?


PS- Great job on this application.

BTUxNine
07-31-2006, 04:54 PM
While uploading, the filename displays in Tivo, but after upload, everything changes to what I would expect.

What's happening?That's the way mfs_ftp inserts ty+ files... it puts in dummy info until the xfer gets to the end where the xml is stored.

dishdude
08-01-2006, 10:01 PM
I have all Philips DSR704's zippered. Been using Tivoserver to send the videos to the Tivo, works ok but would like to get into using MS_FTP. Does this work on a S2 box or only s1's?

Also what does the XML file do for you? Add the program info?

drez
08-01-2006, 10:27 PM
1) yes it works with S2s
2) yes the XML is where the Program Info is stored, you can skip including one if want though. (here's a post by bcc (http://dealdatabase.com/forum/showthread.php?p=260461#post260461) on what you need in a very basic xml)

this is the line you would use to convert an avi (xvid,divx,etc) to .ty:


ffmpeg -i "C:\whatever\whatever.avi" -vcodec mpeg2video -b 3000 -acodec mp2 -ab 192 "C:\whatever\whatever.ty"

if you wanted to convert a DVD vob to .ty with no reencoding:


ffmpeg -i "C:\whatever\whatever.vob" -vcodec copy -acodec copy "C:\whatever\whatever.ty"


tyffmpeg has been flawless for me converting vobs/avi/anything that fails in tivoserver.

dishdude
08-01-2006, 10:30 PM
Nice.. Thanks..

Can I use an XML file to put different TY files into groups? Maybe Movies, Music Videos, TV etc..?

bcc
08-08-2006, 03:51 AM
But I'm still curious what the problem is. I've done maybe 4-5 other films since which have been fine.

Thanks for the work on this.

And thanks for any suggestionsWell it sounds like the problem is PAL framerate specific. You might try specifying -r 2/50 as an argument to ffmpeg to see if that helps. That would still get you PAL framerates without potentially triggering the special case code that handles unset framerates. Your problem symptoms sound just like jamie's with the older version of code, which would suggest that the framerate is being mishandled.

It's really hard to tell what's going on without more info such as the command line arguments you used and the output from ffmpeg.

zippy7272
08-08-2006, 05:53 AM
Here's my command line...

ffmpeg -y -i zippy7272.avi -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video zippy7272.ty

I'm trying to convert from an .avi (divx) format to .ty (something that'll play on my UK S1 TiVO.

ANy help appreciated, at the moment it plays around x10 too fast

bcc
08-08-2006, 02:03 PM
Output from running ffmpeg? At least the initial parts where the input stream frame rates are interpreted.

darrin75
08-08-2006, 05:43 PM
I have a pal reslution 720 x 576 when transferring to the tivo, it puts green garbage at the problem. Is there any tweaks I can do, that would make this play proper without rencoding?

bcc
08-08-2006, 09:12 PM
I have a pal reslution 720 x 576 when transferring to the tivo, it puts green garbage at the problem. Is there any tweaks I can do, that would make this play proper without rencoding?Not sure, maybe use dvdpatcher to lie about your resolution. Otherwise check over at doom9 for more possibilities.

dishdude
08-12-2006, 09:32 AM
Been using this tool since it came out, no problems until today. Can't seem to get Health Inspector to convert from a single VOB to a TY file. Here is the error I get.

5 [main] ffmpeg 3880 _cygtls::handle_exceptions: Exception: STATUS_ACCESS_
VIOLATION
9911 [main] ffmpeg 3880 open_stackdumpfile: Dumping stack trace to ffmpeg.exe
.stackdump

Any ideas?

ryan94z
08-25-2006, 11:43 AM
Here's my command line...

ffmpeg -y -i zippy7272.avi -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video zippy7272.ty

I'm trying to convert from an .avi (divx) format to .ty (something that'll play on my UK S1 TiVO.

ANy help appreciated, at the moment it plays around x10 too fast

I'm getting the same problem when I try to convert the "higher" resolution DivX TV Rips of Top Gear, or 24, which has the AC3 stream in it. Both end up being a fraction of the size of the original file, and after I upload them to my DTV HDTivo, the video plays roughly 10x the speed, but the sound is the correct speed and length.

Here is my command line log, maybe someone can see what I am doing wrong. Maybe I need a special switch to convert these higher resolution DivX TV Rips?


[user@roundel ~]$ ~/ffmpeg -i Top.Gear.S08E08.WS.PDTV.XviD-RiVER.avi -acodec copy -vcodec mpeg2video Top.Gear.S08E08.WS.PDTV.XviD-RiVER.ty
FFmpeg version SVN-r5510, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --disable-ffplay --disable-ffserver
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on Jul 8 2006 12:44:31, gcc: 4.1.0 20060304 (Red Hat 4.1.0-3)
Input #0, avi, from 'Top.Gear.S08E08.WS.PDTV.XviD-RiVER.avi':
Duration: 00:59:26.4, start: 0.000000, bitrate: 1646 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 640x352, 25.00 fps(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 112 kb/s
File 'Top.Gear.S08E08.WS.PDTV.XviD-RiVER.ty' already exists. Overwrite ? [y/N] y
Output #0, ty, to 'Top.Gear.S08E08.WS.PDTV.XviD-RiVER.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 640x352, q=2-31, 200 kb/s, 25.00 fps(c)
Stream #0.1: Audio: 0x0055, 48000 Hz, stereo, 112 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
Generating master chunk for chunks 0:745356.6 bitrate= 0.0kbits/s
Successfully wrote new XML
frame= 8918 q=31.0 Lsize= 0kB time=356.7 bitrate= 0.0kbits/s
video:32083kB audio:58176kB global headers:0kB muxing overhead -100.000000%

[user@roundel ~]$ ll Top.Gear.S08E08.WS.PDTV.XviD-RiVER.*
-rw-r--r-- 1 user user 733841408 Aug 23 16:14 Top.Gear.S08E08.WS.PDTV.XviD-RiVER.avi
-rw-rw-r-- 1 user user 97912051 Aug 24 00:49 Top.Gear.S08E08.WS.PDTV.XviD-RiVER.ty


Fyi, the episode of 24, that I was trying to encode was 24.S05E01.HR.HDTV.AC3.5.1.XviD-NBS.avi. Any help would be greatly appreciated. Thanks.

jraneses
08-26-2006, 02:06 AM
This is probably entirely a newb type question, but will the output from this ffmpeg build work with an unhacked Series 2 DT and TiVo Desktop?

After doing the conversion from xvid to ty, TiVo Desktop would only recognize the files if renamed to mpg or mpeg, which wasn't a surprise. I could play them fine using WMP on the server TD is installed on, but upon trying to transfer them, the TiVo choked each time. Videora conversions work fine, but going from 16x9 to 4x3 on shows such as Entourage are scaled really poorly. Any suggestions? Thanks in advance for being patient with these questions. ;)

J

BTUxNine
08-26-2006, 02:14 AM
This is probably entirely a newb type question, but will the output from this ffmpeg build work with an unhacked Series 2 DT and TiVo Desktop?

After doing the conversion from xvid to ty, TiVo Desktop would only recognize the files if renamed to mpg or mpeg, which wasn't a surprise. I could play them fine using WMP on the server TD is installed on, but upon trying to transfer them, the TiVo choked each time. Videora conversions work fine, but going from 16x9 to 4x3 on shows such as Entourage are scaled really poorly. Any suggestions? Thanks in advance for being patient with these questions. ;)

J
No, afaik Tivo Desktop doesn't work at all with .ty files... stick with trying to get .mpg to scale properly.

jimcking
08-26-2006, 06:11 PM
I am getting an ffmp error message of "error, non monotone timestamps" and the resultant video is a little jerky on WMP and when put back into the HR-10-250. The orginal mpg comes from a tytool edit and plays perfectly on WMP and makes good DVDs. Is anyone else having this problem with ffmp mpg to ty conversion?

rbautch
08-26-2006, 09:08 PM
I am getting an ffmp error message of "error, non monotone timestamps" and the resultant video is a little jerky on WMP and when put back into the HR-10-250. The orginal mpg comes from a tytool edit and plays perfectly on WMP and makes good DVDs. Is anyone else having this problem with ffmp mpg to ty conversion?See here (http://www.dealdatabase.com/forum/showpost.php?p=260837&postcount=60). ``

jimcking
08-27-2006, 08:39 AM
Thanks for the info. Washing (QuickStream fix) the tytool mpg video with VideoRedoPlus totally fixed the problem. I did have to check the box for "Align Packet Data to Word Boundry [digiTV users]" to get it to work properly. Fixes the error message and makes the video smooth.

jimcking
08-27-2006, 08:46 AM
Oh, and it also fixes the trick play problem.
Thanks.

danpritts
08-31-2006, 12:47 AM
Hi,

audio sync

I'm mostly new to the forums although i've lurked occasionally for years. I recently hacked my s1 standalone to support video insertion via mfs_ftp. I'd been using a kludged together workflow that used ffmpeg to convert and demux my original source, then tymplex to spooge it into a ty file. I do this all on linux (centos 4, a RHEL clone).

With much of the source material i'm working with (downloaded tv shows mostly) I've had audio sync issues and had to correct things manually.

The good news: the ty-enabled ffmpeg (with 1.4 patches) does much, much better with audio sync than what i have had before.

The bad news: still have many files that have lipsync issues. The original avis don't have these issues. far as i can tell it's random - different episodes of the same series from apparently the same source, some are spot on sync and others are fubared.

Thanks for all the hard work on this!

letterboxing and aspect ratios with ffmpeg

I've skimmed this topic and noticed various folks asking questions about messed up aspect ratios on their ty files. I'm not sure whether this willhelp or not, but ffmpeg can set the output resolution and add letterboxing.

I always encode my videos for my SA series 1 at output resolution 640x480, which is a standard 4:3 aspect ratio. This isn't a standard DVD or VCD resolution, but it seems to work fine. use the -s option to specify this.

-s 640x480

This fixes aspect ratio problems for 4:3 content. For 16:9 content, I set the output size to be 640x352 and manually add letterboxing with with the -padtop and -padbottom options.

-s 640x352 -padtop 64 -padbottom 64

There are -padleft and -padright options too, which i suppose would be handy if you were trying to frame 4:3 content on a widescreen set.

I'm sure this is suboptimal in some way but it works for me.

Here's a sample command line that I use to encode a letterboxed ty from 16:9 source material:

ffmpeg -i file.avi -b 2000 -f ty -s 640x352 -padtop 64 -padbottom 64 -r 29.97 -ab 128 -ar 32000 file.ty


-b specifies video bitrate, -r the frame rate, -ab audio bitrate, -ar audio sample rate.

ffmpeg will also allow you to set the output aspect ratio, with the -aspect flag (-aspect 4:3 would work). I don't know whether this works with the ty patch. It should work if you output standard mpeg files from ffmpeg.

A quick note, I didn't figure this out by myself, I got most of what i mention here about ffmpeg from Andrew Ryan's web site at

http://www.nam-shub.com/tivo-hacks/video2ty.html

One thing that's wrong with Andrew's video2ty program (which is mostly a wrapper for ffmpeg and tymplex) is that it encodes to 720x480 size, and calculates the height of the letterboxing based on the 4.5:3 aspect ratio of raw 720x480 (put another way, he does not correct his letterboxing for the viewed aspect ratio). So things don't look quite right with his output.

If for whatever reason you want to use his script, modify it to output 640x480 (a simple variable near the top) and you'll be much happier. However, with this patched ffmpeg you probably don't need his script anyway.

danpritts
08-31-2006, 12:54 AM
I'm getting the same problem when I try to convert the "higher" resolution DivX TV Rips of Top Gear, or 24, which has the AC3 stream in it. Both end up being a fraction of the size of the original file, and after I upload them to my DTV HDTivo, the video plays roughly 10x the speed, but the sound is the correct speed and length.

I don't know that this necessarily solves the problem of video playing at 10x speed, but the reason your files are so small is that you are not specifying a video output bitrate, so you're getting ffmpeg's default output rate, which is tiny (read the fine man page to find out exactly).

Try specifying maybe "-r 2500" to get 2.5 megabit video. your original source is 1.6Mb, going with 2.5Mb will give ffmpeg plenty of room to fit the mpeg4 information into the less-efficient mpeg2 format. you'll probably do just fine with 2000, actually.

Rorschach
08-31-2006, 12:46 PM
It there a way of getting FFMPEG to output without multiplexing the video and audio together? I'd like to take the typical XVID .avi movie and make it into separate streams instead of de-multiplexing after the conversion.

BTUxNine
08-31-2006, 03:58 PM
just specify audio and video output files... if you want it to JUST demux, you would specify -acodec copy and -vcodec copy before each filename.

If that doesn't work, you may have to disable video for the audio out and vice versa.

danpritts
09-06-2006, 05:42 PM
just specify audio and video output files... if you want it to JUST demux, you would specify -acodec copy and -vcodec copy before each filename.

If that doesn't work, you may have to disable video for the audio out and vice versa.

That should work fine.

Here's an example of creating a mpeg2 and mp2 audio output (which you could then spooge together with tymplex for insertion):


ffmpeg -i "Top Gear - [06x01] - 2005.05.22.avi" -b 2000 -f mpeg2video -s 640x360 -padtop 60 -padbottom 60 -padleft 0 -padright 0 -r 29.97 "Top_Gear-[06x01]-2005.05.22.tydir/video.m2v" -f mp2 -ab 192 -ar 32000 "Top_Gear-[06x01]-2005.05.22.tydir/audio.m2a"


after the -i option for the input file, all options string together until you get to the name of an output file. Then more options string together until another output file.

rbautch
09-12-2006, 11:19 PM
I've been storing the majority of my video collection in .ty format using ty-ffmpeg. I want to re-encode a few of them for my portable mp3/video player, but when I try to multiplex the .ty with tytool, I get a bunch of jibberish (attached). Is there another way to convert a .ty created with ty-ffmpeg back to mpeg?

mikey
09-14-2006, 12:19 PM
Awsome Tool. Thanks.


I've been storing the majority of my video collection in .ty format using ty-ffmpeg. I want to re-encode a few of them for my portable mp3/video player, but when I try to multiplex the .ty with tytool, I get a bunch of jibberish (attached). Is there another way to convert a .ty created with ty-ffmpeg back to mpeg?

Have you tried TyStudio. Most of the files I have that TyTool had a problem with, not very many, would work in TyStudio.

drez
09-22-2006, 08:15 PM
Is there any chance we could get a new tyffmpeg cygwin binary compiled with the latest svn?

ffmpeg has had a native wmv3 (vc-1) decoder since early August (or late July, I can't remember exactly.)

wmv3 support would be incredibly useful for transcoding "previously" drm 'd files *cough*fair use 4 wm*cough* to .ty.

i've been using the latest regular ffmpeg svn's to convert wmv3 to mpeg2 and then copying the mpeg2 to .ty with tyffmpeg. i'm greatful for having it that easy, but if it's not too hard to update the ffmpeg revision, it would save me a lot of time...

thank you for all your .ty work bcc

lgkahn
09-22-2006, 08:25 PM
IU have the same problem and posted it.. once I convert files to ty with ffmpeg or mplex vsplit or hdemux no longer runs on it correctly so I cannot further conver tto dvd or portable player.. no response..

as a side not some of them will convert to wmv using etivo ahd wmpconverter.

dcormode
09-22-2006, 08:37 PM
This is a great tool! Makes finding a DVD for the 3yr old a snap!

One thing I can't understand... ffmpeg reports the VOB has a video bitrate of 9800 kb/s. I use the -b 4000 switch and ffmpeg reports it is transcoding to 4000 kb/s.

But the video created are only about 80% of the original size, not less than half as I'd expect.

Anybody know why that is?

BTUxNine
09-22-2006, 09:14 PM
reported bitrates are not always accurate... that's one reason durations are suspect.

Suliman
09-25-2006, 01:56 AM
I think I might be screwing the aspect ratio up a little bit and wanted everyone's help.

I'm using ffmpeg to convert xvid AVI's that I download. They all seem to be 624x352. I'm currently using the following to convert:

ffmpeg -i sample_xvid.avi -x sample_xvid.xml -acodec mp2 -ab 192 -b 4000 -vcodec mpeg2video -s 720x480 sample_xvid.ty

I've tried keeping the resolution at 624x352 (by not specifying any -s at all) but then I'm pillarboxed. The 720x480 seems to look very good, but I notice when I play the original xvid that I seem to be missing some of the picture (at least on the top and bottom). Should I be specifying a slightly different resolution?

BTUxNine
09-25-2006, 02:02 AM
when you watch the original xvid, the pc displays the whole picture... on a TV you lose some from overscan... it's not anything ffmpeg is introducing

Suliman
09-25-2006, 10:14 AM
when you watch the original xvid, the pc displays the whole picture... on a TV you lose some from overscan... it's not anything ffmpeg is introducing

I realize some is lost due to overscan, but this seemed like a fair amount lost (sorry, can't give you specifics). For example, the TV Station logo in the lower right was getting a little cut off.

Just wondering if someone was using different resolution or padding (?) settings that might let me keep a little more of the picture. (And is 720x480 a good resolution to use?)

Jamie
09-25-2006, 10:51 AM
I realize some is lost due to overscan, but this seemed like a fair amount lost (sorry, can't give you specifics). For example, the TV Station logo in the lower right was getting a little cut off.

Just wondering if someone was using different resolution or padding (?) settings that might let me keep a little more of the picture. (And is 720x480 a good resolution to use?)Based on the resolution of the source, it looks like this is 16x9 material. Try adding "-aspect 16:9" to the ffmpeg command line. You could try this either at the original source resolution, or with a resize to 720x480. My tivo's seem to be capable of resizing non-standard-size material, as long as it knows the correct aspect ratio.

Aecer
09-25-2006, 05:14 PM
I've got several PAL 25 fps files that just won't encode correctly. They produce smaller files than they should, and run at much too fast a rate when played - perhaps 10X speed. The audio seems right - so sync is lost instantly. I know others have seen this, but I don't see the answer. I've tried all sorts of settings, here's a few:

ffmpeg -i "nx.avi" -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video -s 720x480 -b 3000 -r 29.97 "nx.ty"

ffmpeg -i "nx.avi" -ab 384 -b 3000 -aspect 16:9 "nx.ty" (the default is suposedly 25 fps)

fmpeg -i "nx.avi" -y -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video -b 3000 -r 25.00 "nx.ty"

I've got a Philips SAS1 NTSC and I'd like 29.97 fps. Is anyone getting 25fps PAL encodes that are correct?

I'm playing the ty file for testing with media player classic. I assume since the result is smaller than it should be that uploading to the Tivo won't change things.

Any help would be appreciated.

Thanks!

danpritts
09-28-2006, 12:43 AM
any hope for improvements on audio sync?

Can anyone point me to any documents online that explain why this is so hard to get right? I know that this is a big problem in general with various of these tools - it just doesn't make sense to me that it's that hard to figure out the sync when the original file is in sync.

I'm not trying to complain (you don't see *me* fixing it) - I'm sure there is a good reason why it's hard. I just want to educate myself.

thanks

danpritts
09-28-2006, 12:45 AM
Based on the resolution of the source, it looks like this is 16x9 material. Try adding "-aspect 16:9" to the ffmpeg command line. You could try this either at the original source resolution, or with a resize to 720x480. My tivo's seem to be capable of resizing non-standard-size material, as long as it knows the correct aspect ratio.

Look a few posts back for my explanation of how i deal with this, by having ffmpeg do the letterboxing for me.

My series1 will resize material just fine but it does not do a very good job of letterboxing.

danpritts
09-28-2006, 12:49 AM
This is a great tool! Makes finding a DVD for the 3yr old a snap!

One thing I can't understand... ffmpeg reports the VOB has a video bitrate of 9800 kb/s. I use the -b 4000 switch and ffmpeg reports it is transcoding to 4000 kb/s.

But the video created are only about 80% of the original size, not less than half as I'd expect.

Anybody know why that is?

Try doing two-pass encoding - it looks like "--pass 2" will enable this. With this setting ffmpeg does analysis of the file before the encoding. I'm not sure how well it will work but it is worth trying.

lgkahn
09-28-2006, 10:05 PM
on the audio sync issue with this new version as long as you don't recode ie use copy I am hoving no problems with sync converting from dvds.. the files are large because you are not lowering the bitrate but letting the tivo do it when the show is transferred here is my batch file and a call



C:\utils>cat ffmpgtoty.bat
c:\tyffmpeg\ffmpeg -i %1 -scodec copy -acodec copy -vcodec copy %2


and an example:
call

first rename it
i.e.


rename VTS_01_1.VOB movie.vob

then call it
E:\Movie\VIDEO_TS>ffmpgtoty movie.vob movie.ty

mikey
09-29-2006, 08:44 AM
I've got several PAL 25 fps files that just won't encode correctly. They produce smaller files than they should, and run at much too fast a rate when played - perhaps 10X speed. The audio seems right - so sync is lost instantly. I know others have seen this, but I don't see the answer. I've tried all sorts of settings, here's a few:

ffmpeg -i "nx.avi" -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video -s 720x480 -b 3000 -r 29.97 "nx.ty"

ffmpeg -i "nx.avi" -ab 384 -b 3000 -aspect 16:9 "nx.ty" (the default is suposedly 25 fps)

fmpeg -i "nx.avi" -y -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video -b 3000 -r 25.00 "nx.ty"

I've got a Philips SAS1 NTSC and I'd like 29.97 fps. Is anyone getting 25fps PAL encodes that are correct?

I'm playing the ty file for testing with media player classic. I assume since the result is smaller than it should be that uploading to the Tivo won't change things.

Any help would be appreciated.

Thanks!

ty encoding the vob to 480x480. That worked for me on my s1 dtivo.
the hr10-250 would through hdmi will play the files with no recoding.

Does anyone else notice a very slight audio drop every 15 to 30 seconds? its "almost" inpercepteble until you notice it. sync is fine, but the audio will dip. I have noticed this on my s1 and on the hr10-250.
thanks,
Mikey

ryan94z
09-29-2006, 01:54 PM
I've seen the slight audio dropout on my HR10-250 when converting DivX Videos that have an AC3 stream--particularly the ones found in the TVRip scene.

mikey
09-30-2006, 07:42 AM
I've seen the slight audio dropout on my HR10-250 when converting DivX Videos that have an AC3 stream--particularly the ones found in the TVRip scene.

These are PAL DVD's I ripped using DVD Decrypter. The audio is AC3 2.0. Any suggestions?
Mikey

danpritts
10-03-2006, 12:16 PM
I've got several PAL 25 fps files that just won't encode correctly. They produce smaller files than they should, and run at much too fast a rate when played - perhaps 10X speed. The audio seems right - so sync is lost instantly. I know others have seen this, but I don't see the answer. I've tried all sorts of settings, here's a few:


I can replicate this. Top Gear episodes that i bittorrented as xvid avi's show a similar problem.

In the past, I have successfully transcoded these very same files with a different build of ffmpeg (and then had to spooge them into tys with tymplex). Look for my previous post in this thread for details of the toolchain.

so, I believe this is either a problem with the ty+ output (probably not) or an issue with the mpeg2 encoder in the particular branch of ffmpeg that the ty+ build is based on.

ryan94z
10-03-2006, 01:43 PM
I can replicate this. Top Gear episodes that i bittorrented as xvid avi's show a similar problem.

In the past, I have successfully transcoded these very same files with a different build of ffmpeg (and then had to spooge them into tys with tymplex). Look for my previous post in this thread for details of the toolchain.

so, I believe this is either a problem with the ty+ output (probably not) or an issue with the mpeg2 encoder in the particular branch of ffmpeg that the ty+ build is based on.

Make sure you pass the bitrate flag (-b) to force a target bitrate. That fixed the issue with the very same Top Gear files you are talking about.

mikey
10-03-2006, 02:08 PM
has any one tried this with CBR vs VBR audio divx. I've been meing to see if that is the difference, but have not had time.
@ ryan94z it's occuring with divx files I made. I appreciate the tip and will try it tonight.Hopefullly.
Thanks,
Mikey

mikey
10-03-2006, 05:18 PM
Try doing two-pass encoding - it looks like "--pass 2" will enable this. With this setting ffmpeg does analysis of the file before the encoding. I'm not sure how well it will work but it is worth trying.

Below is an edited bat file from earlier in the thread. What is the correct syntax to activate 2 pass mode? -pass 2 will not run or even give error messages from the command line :confused:
google is not helping much either here.

::Ty Enabled ffmpeg batch encoder
@echo off

:: SET SOURCE PATH HERE
@set sourcepath=G:\FFMpeg\SourceMaterial

:: SET DESTINATION PATH HERE
@set destpath=G:\FFMpeg\FinishedTys

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

for %%x in (%sourcepath%\*.avi) do (
IF NOT EXIST "%destpath%\%%~nx.ty" ffmpeg -i "%sourcepath%\%%~nx.avi" -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video -s 352x480 -b 3000 -r 29.97 "%destpath%\%%~nx.ty"
)

for %%x in (%sourcepath%\*.vob) do (
IF NOT EXIST "%destpath%\%%~nx.ty" ffmpeg -i "%sourcepath%\%%~nx.vob" -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video -s 352x480 -b 3000 -r 29.97 "%destpath%\%%~nx.ty"
)

for %%x in (%sourcepath%\*.mpg) do (
IF NOT EXIST "%destpath%\%%~nx.ty" ffmpeg -i "%sourcepath%\%%~nx.mpg" -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video -s 352x480 -b 3000 -r 29.97 "%destpath%\%%~nx.ty"
)

Thanks,
Mikey

bcc
10-03-2006, 05:52 PM
There is probably a bug in my changes that are breaking PAL frame rates. Has anyone tried the workaround I mentioned here?
http://www.dealdatabase.com/forum/showpost.php?p=261142&postcount=88
I don't have a good PAL stream to test against and I haven't been able to find the bug by inspection, so I'm awaiting more info or a test stream before moving forward. Pointer to a PAL stream with which one can see the frame rate issue?

Aecer
10-03-2006, 09:42 PM
There is probably a bug in my changes that are breaking PAL frame rates. Has anyone tried the workaround I mentioned here?
http://www.dealdatabase.com/forum/showpost.php?p=261142&postcount=88
I don't have a good PAL stream to test against and I haven't been able to find the bug by inspection, so I'm awaiting more info or a test stream before moving forward. Pointer to a PAL stream with which one can see the frame rate issue?

I have not tried this (yet), but here is more info and my solution, as well as some info that others probably know, but since I went to a lot of trouble to test this and determine some answers, I'll post a summary anyway, and hope it helps others. First, on the PAL 25 fps issue that produces small encodes and 10X speed playing: Here is my solution: I've been running the PAL files through Mediacoder and setting the audio to do a stream copy and the video to do a stream copy and the "Program" tab is set to 29.97 instead of "Original" This does a very fast modification to the file, it seems as fast as a direct copy. I presume it's just changing a header of some type as it never takes enough time to do a real transcode of any sort. This always solves the problem such that the subsequent run with ty-enabled ffmpeg produces a valid file that plays well on my NTSC SAS1.

As an aside: I believe Mediacoder is just a front end for ffmpeg, so I tried doing this same thing using ty-enabled ffmpeg using -acodec copy -vcodec copy and -r 29.97 options, but it didn't work.

Interestingly, although this always seems to solve the problem, ty-enabled ffmpeg doesn't always seem to think it's a 29.97 file (the output stream usually still says 25 fps) OTOH, Gspot always says it's 29.97 after this intiial conversion.

With that problem solved, I then had problems with some non-standard sized files being stretched or distorted and learned the following:

The Tivo S1 I have is only happy when the file has certain resolutions. It's perfectly happy with 480x480 and 640x480, but not 512x384 even though the latter is 1.33 aspect ratio just like 640x480 Provided the Tivo receives a file in a resolution it likes, it will stretch the file to fill the screen (I only have a 4x3 screen)

This means that if I encode a 512x384 input file as -s 512x384 it will display in the screen with a big empty area at the bottom, but if I encode the same file as -s 640x480 it will look perfect. It will also look perfect if it's encoded to -s 480x480. The Tivo is happy with both, and they look identical on the screen. There are other resolutions the Tivo likes, but i've just used -b 3000 bit rate and -s 640x480 (as suggested by others). It's critical to use a final resolution that the Tivo expects. (Everyone here may know this, but I didn't, and posting it again may help others reading this.)

Now, suppose I have a file that's not 4:3 aspect, like the one I'm doing now that is 528x300=W X H. To get it to play, it needs to end up 640x480. If I just use -s 640x480 option, it will encode and play fine, but it will be stretched to fill the screen and the height H will be stretched more than the width W. The solution is to pad the top and bottom, but how much? The answer is to pad it so that the width W=528 is encoded to 640 and to keep pixels square, I want the height stretched by the same amount 640/528 times the the height of 300 or about 364 (don't encode to odd numbers)

In other words, the encode size option should be -s 640x364 in this case. In the general case, the encode size option should be 640X(640 times H/W) The total padding needed can then be seen to be 480-364=116 so the options for my 528x300 file should be -s 640X364 -padtop 58 -padbottom 58 to produce a 640x480 output which will display perfectly on my 4:3 TV.

I have been also adding -r 29.97 (doesn't seem to hurt) and -aspect 1.33. The aspect setting seems to affect playback on my computer with VLC and Media Player Classic, but as far as I can tell, if I send the Tivo a 640x480 final it will fill the screen correctly regardless of the aspect setting defined.

Here is my final encode string:
ffmpeg -i "input file.avi" -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video -s 640x364 -padtop 58 -padbottom 58 -aspect 1.33 -b 3000 "output file.ty"

Now I'd love to have a setting option that works like this :

Encode this W x H input file to 640 x (640 times H/W) (nearest even value) and pad the top and bottom as needed to make it 480 high. I could avoid custom setting of the size and pad options.

If there is such a setting, I'm not sure what it is.

Final comment: I had a file that was squished top to bottom when displayed on the computer. This could be fixed using the method above. I just encoded the height differently than the width. In the case above, for example, encoding to -s 640x400 and padding with 40 on top/bottom will stretch the height by 10%.

bcc
10-05-2006, 05:18 PM
So I just got my first PAL sample that is supposed to demonstrate the frame rate issue. Problem is, it works just fine for me. I re-inserted it on my 6.3 hr10-250 system, without even transcoding, and the a/v plays back fine (right frame rate and lip sync). I also did a second test where I transcoded the video to NTSC frame rates first. That worked as well. So I'm thinking users must be doing something wrong when they see the 10X issue. I'll need more details. Here's what I did that worked:
% mpgdump -i PALclip.mpg -v p.m2v -a p.ac3
% file p.m2v p.ac3
p.m2v: MPEG sequence, v2, MP@ML interlaced Y'CbCr 4:2:0 video, CCIR/ITU PAL 625, 4:3, 25 fps
p.ac3: ATSC A/52 aka AC-3 aka Dolby Digital stream, 48 kHz,, complete main (CM) 2 front/0 rear, LFE on,, 224 kbit/s Dolby Surround encoded
% ffmpeg/1.4/ffmpeg -acodec copy -vcodec copy -i p.m2v -i p.ac3 p.ty
FFmpeg version SVN-r5510, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --disable-ffplay --disable-ffserver
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on Jul 8 2006 12:44:31, gcc: 4.1.0 20060304 (Red Hat 4.1.0-3)
Input #0, mpegvideo, from 'p.m2v':
Duration: 00:00:38.7, start: 0.000000, bitrate: 9000 kb/s
Stream #0.0: Video: mpeg2video, yuv420p, 720x576, 9000 kb/s, 25.00 fps(r)
Input #1, ac3, from 'p.ac3':
Duration: 00:01:02.0, start: 0.000000, bitrate: 224 kb/s
Stream #1.0: Audio: ac3, 48000 Hz, stereo, 224 kb/s
Output #0, ty, to 'p.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 720x576, q=2-31, 9000 kb/s, 25.00 fps(c)
Stream #0.1: Audio: ac3, 48000 Hz, stereo, 224 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #1.0 -> #0.1
Press [q] to stop encoding
Generating master chunk for chunks 0:347
Successfully wrote new XML
frame= 1552 q=4995807.8 Lsize= 0kB time=62.0 bitrate= 0.0kbits/s
video:42587kB audio:1698kB global headers:0kB muxing overhead -100.000000%
% ffmpeg/1.4/ffmpeg -acodec copy -i p.m2v -r ntsc -i p.ac3 p2.ty
FFmpeg version SVN-r5510, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --disable-ffplay --disable-ffserver
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on Jul 8 2006 12:44:31, gcc: 4.1.0 20060304 (Red Hat 4.1.0-3)
Input #0, mpegvideo, from 'p.m2v':
Duration: 00:00:38.7, start: 0.000000, bitrate: 9000 kb/s
Stream #0.0: Video: mpeg2video, yuv420p, 720x576, 9000 kb/s, 25.00 fps(r)
Input #1, ac3, from 'p.ac3':
Duration: 00:01:02.0, start: 0.000000, bitrate: 224 kb/s
Stream #1.0: Audio: ac3, 48000 Hz, stereo, 224 kb/s
Output #0, ty, to 'p2.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 720x576, q=2-31, 200 kb/s, 29.97 fps(c)
Stream #0.1: Audio: ac3, 48000 Hz, stereo, 224 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #1.0 -> #0.1
Press [q] to stop encoding
Generating master chunk for chunks 0:42=61.1 bitrate= 0.0kbits/s
Successfully wrote new XML
frame= 1859 q=24.8 Lsize= 0kB time=62.0 bitrate= 0.0kbits/s
video:2980kB audio:1698kB global headers:0kB muxing overhead -100.000000%
%

bcc
10-05-2006, 05:23 PM
Oh, and direct from .mpg to .ty at PAL frame rates works as well:
% ffmpeg/1.4/ffmpeg -acodec copy -vcodec copy -i PALclip.mpg p3.ty
FFmpeg version SVN-r5510, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --disable-ffplay --disable-ffserver
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on Jul 8 2006 12:44:31, gcc: 4.1.0 20060304 (Red Hat 4.1.0-3)
Input #0, mpeg, from 'PALclip.mpg':
Duration: 00:01:01.8, start: 0.200000, bitrate: 5954 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576, 9000 kb/s, 25.00 fps(r)
Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, 224 kb/s
Output #0, ty, to 'p3.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 720x576, q=2-31, 9000 kb/s, 25.00 fps(c)
Stream #0.1: Audio: ac3, 48000 Hz, stereo, 224 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
Generating master chunk for chunks 0:347
Successfully wrote new XML
frame= 1552 q=4995807.8 Lsize= 0kB time=62.0 bitrate= 0.0kbits/s
video:42587kB audio:1698kB global headers:0kB muxing overhead -100.000000%

Aecer
10-06-2006, 07:57 AM
So I just got my first PAL sample that is supposed to demonstrate the frame rate issue. Problem is, it works just fine for me. I re-inserted it on my 6.3 hr10-250 system, without even transcoding, and the a/v plays back fine (right frame rate and lip sync). I also did a second test where I transcoded the video to NTSC frame rates first. That worked as well. So I'm thinking users must be doing something wrong when they see the 10X issue. I'll need more details.

I've seen 10X the issue a lot. Here's my setup:
encoding on Windows XP

starting file is always 25fps AVI wrapper. I know I've seen it on Divx5 encodes, not sure what others if any. Haven't tried any mpg

The various encoded commands I posted previously.

I'm sending to a 3.0 S1, but the 10x is seen with Media Player Classic and VLC playing the ty files on the winXP system, plus the ty size is way too small. When I get some free time, I'll try to cut a small piece off one, send it to you and try your possible solution, although as posted above, I've got an easy fix that works, using Mediacoder.

Aecer
10-06-2006, 07:28 PM
I've seen the 10X issue a lot.

Some more info: I tried the trick of -r 50/2 suggested. It has no effect.

I transcoded an XVID avi file 25fps. Here's the string used, plus the output:

C:\Graf\ffmpeg-ty\ffmpeg -i "%sourcepath%\A.Bit.of.Fry.and.Laurie.S03E01.[Dalif].avi" -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video -s 640x480 -aspect 1.33 -b 3000 -r 50/2 "%destpath%\A.Bit.of.Fry.and.Laurie.S03E01.[Dalif].ty"


FFmpeg version SVN-r, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --disable-ffplay --disable-ffserver
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on Jul 25 2006 14:21:02, gcc: 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
Input #0, avi, from 'D:\Movies\\A.Bit.of.Fry.and.Laurie.S03E01.[Dalif].avi':
Duration: 00:28:41.4, start: 0.000000, bitrate: 1135 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 528x400, 25.00 fps(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 128 kb/s
Output #0, ty, to 'D:\Movies\_FXP-Ty\Upload\A.Bit.of.Fry.and.Laurie.S03E01.[Dalif].ty':
Stream #0.0: Video: mpeg2video, yuv420p, 640x480, q=2-31, 3000 kb/s, 25.00 fps
(c)
Stream #0.1: Audio: mp2, 32000 Hz, stereo, 192 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
Generating master chunk for chunks 0:8717.8 bitrate= 0.0kbits/s
Successfully wrote new XML
frame= 452 q=2.8 Lsize= 0kB time=18.0 bitrate= 0.0kbits/s
video:6634kB audio:4225kB global headers:0kB muxing overhead -100.000000%

The resulting ty runs at 10x with both Media Player Classic and VLC. Sound plays normally on MPC, and not at all on VLC.

bcc
10-06-2006, 07:33 PM
FFmpeg version SVN-r,No wonder, you're using a different version. The mainline svn version is simply buggy in its mpeg2 frame rate processing from what I can tell. Why don't you try the version I posted yesterday.

bcc
10-06-2006, 07:59 PM
No wonder, you're using a different version. The mainline svn version is simply buggy in its mpeg2 frame rate processing from what I can tell. Why don't you try the version I posted yesterday.Oops, never mind, I see that you were using my old 1.4 version. Hadn't noticed that cygwin builds leave the version string mis-set.

bcc
10-06-2006, 08:10 PM
C:\Graf\ffmpeg-ty\ffmpeg -i "%sourcepath%\A.Bit.of.Fry.and.Laurie.S03E01.[Dalif].avi" -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video -s 640x480 -aspect 1.33 -b 3000 -r 50/2 "%destpath%\A.Bit.of.Fry.and.Laurie.S03E01.[Dalif].ty"I can't reproduce. I tried the same thing except my source stream was a 25fps .mpg, and it plays back fine with mplayer.

bcc
10-06-2006, 10:18 PM
I can't reproduce. I tried the same thing except my source stream was a 25fps .mpg, and it plays back fine with mplayer.So I did finally get a divx encoded PAL avi that does reproduce the problem. Digging further. Note that the workaround of specifying "-r 2/50" *does* work, you just have to specify it before the input file. Remember order matters with ffmpeg arguments...

DFENS
10-06-2006, 10:25 PM
As others have reported, I am also seeing audio sync issues with XVIDs (in this case some "Lost" episodes). On one episiode I get audio coming about 0.5-1 second ahead of where it should be in relation to the video. On the next episode (both created by the same source, have the same resolution, original frame rate, audio codec, ...), the audio is perfectly in synch. Both of the original XVID files are perfectly in synch. I used exactly the same command line (shown below) for both. Note, I added the frame rate of 29.97 to see if the original 23.98 fps was an issue but it didn't change anything (and of course one file works and the other doesn't so it must not be involved).

Any hope this can get fixed? I have been waiting for this kind of tool to come along and would love to be able to use it with consistent results.

Here's input/output data about the file that is the problem:

Input #0, avi, from 'Lost s01e01.avi':
Duration: 00:42:18.7, start: 0.000000, bitrate: 1152 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 640x352, 23.98 fps(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 131 kb/s
Output #0, ty, to 'Lost s01e01.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 480x484, q=2-31, 2500 kb/s, 29.97 fps
(c)
Stream #0.1: Audio: mp2, 48000 Hz, stereo, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1

Here is the command I am using to convert it and the one that turns out fine (obviously filenames in/out are different but otherwise identical):

C:\Program Files\eMule\Incoming>ffmpeg -y -i "Lost s01e01 Dvdrip Xvid-Wat.avi" -padtop 66 -padbottom 66 -s 480x352 -r 29.97 -padcolor 000000 -b 2500 "Lost s01e01.ty"

The ONE thing I notice that is different on the data reported by the input files is this:

Stream #0.1: Audio: mp3, 48000 Hz, stereo, 131 kb/s (audio synch problem)

vs.

Stream #0.1: Audio: mp3, 48000 Hz, stereo, 32 kb/s (no audio sync problem)

The fact that there is a difference in something related to audio is obviously suspicious. Any suggestions on how to fix this? Maybe try to reencode the audio stream as 32 kbps first and then run it thru the rest of the conversion? I looked at this a bit but don't see a way to do this with ffmpeg (it doesn't look to support encoding to mp3 from what I can see, just decoding). Maybe there is just a bug in the way the current build handles downconverting the audio bitrate to 64 kbps but it doesn't have the same problem upconverting?

Thanks!

DFENS
10-07-2006, 09:38 AM
I'm trying the new v1.5 version to see if it still has the audio synch problem. One thing I noticed using it so far is that the bitrate option now has to be 1000x larger to get the desired bitrate. On v1.4, -b 2500 got me 2500 kb/s bitrate. Now I have to give it -b 2500000 to get that value. On v1.5 -b 2500 gives me a 2 kb/s bitrate...

bcc
10-07-2006, 07:28 PM
I'm trying the new v1.5 version to see if it still has the audio synch problem. One thing I noticed using it so far is that the bitrate option now has to be 1000x larger to get the desired bitrate. On v1.4, -b 2500 got me 2500 kb/s bitrate. Now I have to give it -b 2500000 to get that value. On v1.5 -b 2500 gives me a 2 kb/s bitrate...Yes, looks like the ffmpeg boys recently changed the -b option's arguments. The old documentation said: "Set the video bitrate in kbit/s (default = 200 kb/s)." and the new documentation says "Set the video bitrate in bit/s (default = 200 kb/s).". Ffmpeg really needs a config language (or a good gui), IMO.

Update: Oops, you can specify the units. Only documented by example. So -b2500k insetad of -b 2500000

Aecer
10-08-2006, 07:36 AM
So I did finally get a divx encoded PAL avi that does reproduce the problem. Digging further. Note that the workaround of specifying "-r 2/50" *does* work, you just have to specify it before the input file. Remember order matters with ffmpeg arguments...

Thanks, sorry for any confusion I caused. I have placed the -r 2/50 command in front of the input file, and hurray, it works. Now, could you tell me or steer me to somewhere that can tell me what this does? From your comment above, I *think* putting -r in front of the input file is telling ffmpeg the frame rate of the input file. (It never occurred to me to put any parameters in front of the input file, I thought it read that from the file as gspot would do) If that's what it does, I could understand putting -r 25 to tell it 25 fps for the input or even putting -r 50/2 if the division of 50 by 2 was handled by the code differently than 25, but what the heck does -r 2/50 do?

Thanks.

BTW, is there a way to tell ffmpeg to scale the input width to 640, scale the height by the same factor, and then pad the height top and bottom to get a 640x480 correctly scaled output to feed the TiVo?

mikey
10-08-2006, 11:54 AM
Has anyone found a good ffmpeg tutorial?
I found this (http://ffmpeg.mplayerhq.hu/faq.html) but I need examples.:o
Thanks,
Mikey

bcc
10-08-2006, 04:32 PM
Thanks, sorry for any confusion I caused. I have placed the -r 2/50 command in front of the input file, and hurray, it works. Now, could you tell me or steer me to somewhere that can tell me what this does? From your comment above, I *think* putting -r in front of the input file is telling ffmpeg the frame rate of the input file. (It never occurred to me to put any parameters in front of the input file, I thought it read that from the file as gspot would do) If that's what it does, I could understand putting -r 25 to tell it 25 fps for the input or even putting -r 50/2 if the division of 50 by 2 was handled by the code differently than 25, but what the heck does -r 2/50 do?

Thanks.ffmpeg has this problem of overloading the semantics for the frame rate. It does not properly distinguish between an uninitialized frame rate and a PAL frame rate. (This is because the code has hardwired into it the constant 25 to initialize the frame rate in various places). The resulting bugs probably remain unnoticed by the European developers. For example, if you feed a 60fps mpeg2 stream to the current mainline code, it misidentifies it as 25fps. This is why I had trouble finding a stable branch to sync my 1.5 release to.

This framerate overload is breaking my frame rate scaling code when the AVI container claims a frame rate of 25fps. (Turn on verbose debugging to see the container frame rate.) Using -r, you're setting the uninitialized frame rate to something other than 25fps. For an avi, it seems like the value you use for -r doesn't really matter, as the rate is already specified by the multiplex stream. Normally -r is used to specify the frame rate for elementary streams. I believe. I could use some good ffmpeg documentation as well :) Maybe it's too much like asking swiss army to document all the ways you can cut yourself with their knives.

BTW, is there a way to tell ffmpeg to scale the input width to 640, scale the height by the same factor, and then pad the height top and bottom to get a 640x480 correctly scaled output to feed the TiVo?I haven't played with scaling, as I find the scaler in my hr10-250 to handle the normal cases for me.

DFENS
10-08-2006, 08:09 PM
Hey bcc:

I tried the v1.5 release but it doesn't do anything to fix the audio synch issue I am seeing (described in post #138).

Any hope there is a fix that can be made here?

Thanks!

bcc
10-08-2006, 08:30 PM
Hey bcc:

I tried the v1.5 release but it doesn't do anything to fix the audio synch issue I am seeing (described in post #138).

Any hope there is a fix that can be made here?

Thanks!Could you troubleshoot it a bit more or maybe look into it yourself? I haven't had a chance to look into mpeg4 a/v sync issues.
For example, you could check whether you have the problem if you transcode the mpeg4 to mpeg2 (.vob). If so, then check with a generic version of ffmpeg.

DFENS
10-08-2006, 09:33 PM
Sure, no problem. I'll give that a try and see where it leads.

You're help is much appreciated!

whitepelican
10-09-2006, 12:28 AM
Is anyone else having problems with this 1.5 version not recognizing your AC3 files? It keeps reporting my 5.1 Dolby audio as "mono", and then the finished MPG file has no audio at all. Oddly enough, I can use an old windows ffmpeg build (non-TY enabled) and it works perfectly. I am having this problem with every file I have fed to the 1.5 version. Is there a switch I need to use to specify 5.1 audio or something?

Here is a the log of my attempt at using the 1.5 version to mux an HD stream. Notice the "mono" audio.


D:\>ffmpeg.exe -i d:\stan.m2v -i d:\stan.ac3 -vcodec copy -acodec copy d:\stan.m
pg
FFmpeg version SVN-r6543, Copyright (c) 2000-2006 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --dis
able-ffplay --disable-ffserver
libavutil version: 49.0.1
libavcodec version: 51.16.0
libavformat version: 50.5.0
built on Oct 6 2006 00:36:08, gcc: 3.4.4 (cygming special) (gdc 0.12, using d
md 0.125)
Input #0, mpegvideo, from 'd:\stan.m2v':
Duration: 00:43:06.1, start: 0.000000, bitrate: 64999 kb/s
Stream #0.0: Video: mpeg2video, yuv420p, 1280x1088, 65000 kb/s, 29.97 fps(r)
Input #1, ac3, from 'd:\stan.ac3':
Duration: 03:32:22.7, start: 0.000000, bitrate: 384 kb/s
Stream #1.0: Audio: ac3, 48000 Hz, mono, 384 kb/s
Output #0, mpeg, to 'd:\stan.mpg':
Stream #0.0: Video: mpeg2video, yuv420p, 1280x1088, q=2-31, 65000 kb/s, 29.97
fps(c)
Stream #0.1: Audio: ac3, 48000 Hz, mono, 384 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #1.0 -> #0.1
[mpeg @ 0x6fd594]Setting video buffer for HD
Press [q] to stop encoding

And here is the same using the older non-TY ffmpeg build.


D:\>"c:\documents and settings\don\desktop\ffmpeg.exe" -i d:\stan.m2v -i d:\stan
.ac3 -vcodec copy -acodec copy d:\stan.mpg
ffmpeg version 0.4.9-pre1, build 4743, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-mp3lame --enable-vorbis --enable-faad --enable-faac -
-enable-xvid --enable-mingw32 --enable-a52 --enable-dts --enable-pp --enable-gpl
--enable-memalign-hack
built on Feb 22 2005 04:58:29, gcc: 3.4.2 (mingw-special)
Input #0, mpegvideo, from 'd:\stan.m2v':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: mpeg2video, 1280x1088, 29.97 fps
Input #1, ac3, from 'd:\stan.ac3':
Duration: 03:32:22.7, start: 0.000000, bitrate: 384 kb/s
Stream #1.0: Audio: ac3, 48000 Hz, 5:1, 384 kb/s
Output #0, mpeg, to 'd:\stan.mpg':
Stream #0.0: Video: mpeg2video, 1280x1088, 29.97 fps, q=2-31
Stream #0.1: Audio: ac3, 48000 Hz, 5:1, 384 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #1.0 -> #0.1

That one then conks out because it can't handle the HD files. But it does recognize the 5.1 audio, and I've been using it very succesfully to re-encode the HD files to DVD and keep the original 5.1 audio. So, what am I doing wrong with the ty-enabled ffmpeg ver 1.5?

bcc
10-09-2006, 01:03 AM
I have not seen ffmpeg work with ac3 audio if the output file is a .mpg. However if the output file is a .vob, then it works. .vob files include extra dvd-compliant encapsulation for ac3 audio, for what it's worth...

whitepelican
10-09-2006, 10:26 AM
The above problem with the AC3 audio happens exactly the same whether I specify VOB or MPG for the output. As you can see, it doesn't even recognize the 5.1 audio on the input stream, so it doesn't matter what output I specify. For what it's worth, the MPG files I create with AC3 audio using the older windows build of ffmpeg do play perfectly in WinDVD with 5.1 audio included.

drez
10-09-2006, 10:52 AM
try the different ffmpeg svn builds here: http://tirnanog.fate.jp/mirror/ffmpeg/

bcc
10-09-2006, 12:16 PM
As you can see, it doesn't even recognize the 5.1 audio on the input streamEven tho it reports "mono" the ac3 is encoded properly in ffmpeg 1.5 in my tests. So, no, I don't think you've shown me a good example of it not working. Except that your output file is .mpg, and so the DVD encapsulation for ac3 is not written, and so the audio stream is not clearly identifyable as ac3 (mpeg2 spec doesn't define a code for ac3). .mpg may or may not work anyways depending upon your codec setup and player setup I suspect.

whitepelican
10-09-2006, 12:18 PM
try the different ffmpeg svn builds here: http://tirnanog.fate.jp/mirror/ffmpeg/

Ah-yup. Therein lies the problem. The most recent SVN builds are broken in this regard as well. I went through each of them listed on that site, and the last one that worked was rev.6218. Although some of the earlier ones such as 5570 & 5864 are also hosed.

Here's the one that works, rev.6218:


D:\>C:\ffmpeg.exe -i d:\pu17.m2v -itsoffset -0.501 -i d:\pu17.ac3 -target ntsc-d
vd -b 3700 -aspect 16:9 -acodec copy d:\pu17.vob
FFmpeg version SVN-r6218, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-mp3lame --enable-libogg --enable-vorbis --enable-faad
--enable-faac --enable-xvid --enable-x264 --enable-mingw32 --enable-a52 --enabl
e-dts --enable-pp --enable-gpl --enable-memalign-hack --enable-amr_nb --enable-a
mr_wb --enable-swscaler --enable-avisynth
libavutil version: 49.0.0
libavcodec version: 51.14.0
libavformat version: 50.5.0
built on Sep 10 2006 21:00:18, gcc: 4.0.3
Input #0, mpegvideo, from 'd:\pu17.m2v':
Duration: 00:01:27.0, start: 0.000000, bitrate: 64996 kb/s
Stream #0.0: Video: mpeg2video, yuv420p, 1280x1088, 65000 kb/s, 29.97 fps(r)
Input #1, ac3, from 'd:\pu17.ac3':
Duration: 00:07:14.2, start: 0.000000, bitrate: 384 kb/s
Stream #1.0: Audio: ac3, 48000 Hz, 5 channels, 384 kb/s
Output #0, dvd, to 'd:\pu17.vob':
Stream #0.0: Video: mpeg2video, yuv420p, 720x480, q=2-31, 3700 kb/s, 29.97 fps
(c)
Stream #0.1: Audio: ac3, 48000 Hz, 5 channels, 384 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #1.0 -> #0.1
[dvd @ 00A0CEA4]buffer underflow
^Came= 1217 q=4.7 size= 20790kB time=40.6 bitrate=4197.6kbits/s
D:\>

And here's the log of my test from the most recent build, rev. 6586.

D:\>C:\ffmpeg.exe -i d:\pu17.m2v -itsoffset -0.501 -i d:\pu17.ac3 -target ntsc-d
vd -b 3700 -aspect 16:9 -acodec copy d:\pu17.vob
FFmpeg version SVN-r6586, Copyright (c) 2000-2006 Fabrice Bellard, et al.
configuration: --enable-mp3lame --enable-libogg --enable-vorbis --enable-faad
--enable-faac --enable-xvid --enable-x264 --enable-mingw32 --enable-a52 --enabl
e-dts --enable-pp --enable-gpl --enable-memalign-hack --enable-amr_nb --enable-a
mr_wb --enable-swscaler --enable-avisynth
libavutil version: 49.0.1
libavcodec version: 51.16.0
libavformat version: 50.5.0
built on Oct 8 2006 22:37:43, gcc: 4.0.3

Seems that stream 0 comes from film source: 29.97 (30000/1001) -> 25.00 (25/1)
Input #0, mpegvideo, from 'd:\pu17.m2v':
Duration: 00:01:27.0, start: 0.000000, bitrate: 64996 kb/s
Stream #0.0: Video: mpeg2video, yuv420p, 1280x1088, 65000 kb/s, 25.00 fps(r)
Input #1, ac3, from 'd:\pu17.ac3':
Duration: 00:07:14.2, start: 0.000000, bitrate: 384 kb/s
Stream #1.0: Audio: ac3, 48000 Hz, mono, 384 kb/s
Output #0, dvd, to 'd:\pu17.vob':
Stream #0.0: Video: mpeg2video, yuv420p, 720x480, q=2-31, 3 kb/s, 29.97 fps(c)

Stream #0.1: Audio: ac3, 48000 Hz, mono, 384 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #1.0 -> #0.1
[dvd @ 008FF544]buffer underflow
^Came= 152 q=24.8 size= 610kB time=5.0 bitrate= 991.8kbits/s


Not only does it not recognize the 5.1 AC3 audio correctly, but for some reason it thinks the video source is film, which is also wrong. But it doesn't error out and crash. It still does the conversion but the audio is missing.

The other build in between those two dates gets to the heart of the matter. As you can see it errors out when it doesn't recognize the audio format.


D:\>C:\ffmpeg.exe -i d:\pu17.m2v -itsoffset -0.501 -i d:\pu17.ac3 -target ntsc-d
vd -b 3700 -aspect 16:9 -acodec copy d:\pu17.vob
FFmpeg version SVN-r6375, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-mp3lame --enable-libogg --enable-vorbis --enable-faad
--enable-faac --enable-xvid --enable-x264 --enable-mingw32 --enable-a52 --enabl
e-dts --enable-pp --enable-gpl --enable-memalign-hack --enable-amr_nb --enable-a
mr_wb --enable-swscaler --enable-avisynth
libavutil version: 49.0.1
libavcodec version: 51.16.0
libavformat version: 50.5.0
built on Sep 29 2006 15:14:58, gcc: 4.0.3
Input #0, mpegvideo, from 'd:\pu17.m2v':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: mpeg1video, 25.00 fps(r)
Input #1, ac3, from 'd:\pu17.ac3':
Duration: 01:26:51.2, start: 0.000000, bitrate: 32 kb/s
Stream #1.0: Audio: ac3, 48000 Hz, mono, 32 kb/s
swScaler: Unknown format is not supported as input format
Cannot get resampling context

I guess the question is, is there a way to specify the audio format on the input so it will work with the most recent build and the ty-enabled patch?

Otherwise, I'll have to stick to using two different ffmpeg versions so that I can have one that actually does my re-encoding and another that I can use to create ty streams.

bcc
10-09-2006, 12:31 PM
I guess the question is, is there a way to specify the audio format on the input so it will work with the most recent build and the ty-enabled patch?

ffmpeg seems to just mis-report the ac3 stream details when you fail to compile it with a full ac3 decoder library. I compiled with --enable-a52, but not an ac3 decoder library, which as far as I can tell has been sufficient for -acodec copy to pass ac3. My builds probably wouldn't let you transcode into ac3 however. But that's not what your examples try to do anyways.

I think you're getting hung up on the display output when you should be looking at what's actually going on with your audio stream.

I call pilot error here, not a problem with my build.

whitepelican
10-09-2006, 12:43 PM
ffmpeg seems to just mis-report the ac3 stream details when you fail to compile it with a full ac3 decoder library. I compiled with --enable-a52, but not an ac3 decoder library, which as far as I can tell has been sufficient for -acodec copy to pass ac3. My builds probably wouldn't let you transcode into ac3 however. But that's not what your examples try to do anyways.

I think you're getting hung up on the display output when you should be looking at what's actually going on with your audio stream.

I call pilot error here, not a problem with my build.

Of course, I'm assuming errors on my part here. And I never blamed it on your build, since it is obvious that this issue comes from the ffmpeg code and not your patch. I would have liked to see the display verify that I had 5.1 audio, because I'm having some problems with ty streams that are jumping in and out of 5.1 and I'm using tychopper to hopefully get rid of the problem areas. But, otherwise, I think you are right. Mostly operator error on my part.

lefig
10-11-2006, 12:15 PM
What is the best way to combine vobs and encode them to ty using linux. I ran this command and it seemed to work, but I am not with my TV at this time (slow day at work, ssh is great for this).

Thanks

Rob

cat VTS_01_1.VOB VTS_01_2.VOB VTS_01_3.VOB VTS_01_4.VOB VTS_01_5.VOB | ffmpeg-ty -y -i - -vcodec mpeg2video -b 3000 -acodec copy /tmp/pf-test.ty

Output from command

Seems that stream 0 comes from film source: 25.00 (25025/1001) -> 25.00 (25/1)
Input #0, mpeg, from 'pipe:':
Duration: N/A, bitrate: 7384 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576, 7000 kb/s, 25.00 fps(r)
Stream #0.1[0x80]: Audio: ac3, 48000 Hz, mono, 384 kb/s
Output #0, ty, to '/tmp/pf-test.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 720x576, q=2-31, 3 kb/s, 25.00 fps(c)
Stream #0.1: Audio: ac3, 48000 Hz, mono, 384 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Generating master chunk for chunks 0:40958681.4 bitrate= 0.0kbits/s
Generating master chunk for chunks 4096:8191
Generating master chunk for chunks 8192:8519
Successfully wrote new XML
frame=217072 q=31.0 Lsize= 0kB time=8682.8 bitrate= 0.0kbits/s
video:665220kB audio:406996kB global headers:0kB muxing overhead -100.000000%

dishdude
10-12-2006, 07:26 AM
I'd be curious as how to do this in Windows also? All my DVD's are ripped with multiple VOB's, I've been using Shrink to just re-encode to one VOB but it would be nice to not have to use Shrink. Thanks..

mikey
10-12-2006, 09:00 AM
I'd be curious as how to do this in Windows also? All my DVD's are ripped with multiple VOB's, I've been using Shrink to just re-encode to one VOB but it would be nice to not have to use Shrink. Thanks..
Use dvd decrypter with file splitting set to none.

lefig
10-12-2006, 09:54 AM
The command that i used in linux works like a charm. The quality is excellent, the merge of vobs is seemless. I get dolby digital sound and ffmpeg is much quicker and does not suffer the problems of converting the vob to avi to play with tivoserver.

I am extremely pleased.

I love my tivo and this software, as well as all the supporting apps that make a dtivo HMO friendly.

rob

dishdude
10-12-2006, 01:07 PM
The command that i used in linux works like a charm. The quality is excellent, the merge of vobs is seemless. I get dolby digital sound and ffmpeg is much quicker and does not suffer the problems of converting the vob to avi to play with tivoserver.

I am extremely pleased.

I love my tivo and this software, as well as all the supporting apps that make a dtivo HMO friendly.

rob

I agree totally.. It is sweet to be able to play DVD's converted to TY files on any Tivo in my house. My daughter had a friend over the other night and she went home and told her dad she was watching movies, music videos, family pictures etc from my daughters Tivo, of course he called to ask how I was doing it. I don't think I could go back to non networked Tivos..

lefig
10-12-2006, 04:06 PM
I could never go back to non networked tivo's. Although I kinda wish i could use Galleon but that is greedy. Now I just need to get all of my old shows off the original drives and over to both networked tivos. I networked my playroom tivo last winter and just did the upstairs tivo the other week.

danpritts
10-13-2006, 11:12 PM
Below is an edited bat file from earlier in the thread. What is the correct syntax to activate 2 pass mode? -pass 2 will not run or even give error messages from the command line :confused:
google is not helping much either here.


OK, i read the man page a little further, the following appears to work for me but I have not really tested the output, since my linux box is really, really slow (I have a Via C3 CPU, which is great for power usage but not real great for mpeg encoding).

Some mention I see on some web sites suggests that 2-pass encoding might or might not help you. To find out that it's doing *something* try to lower your overall bitrate. If the .pass1 file is different somehow (looks worse, is bigger and looks the same) than the second file then you're getting some benefit from the process.

This is shell script syntax, hopefully it is obvious what i'm doing.

You can delete the .pass1 file when you're done.



$FFMPEG -i $AVI -b 2000 -f ty -s 640x352 -pass 1 -passlogfile pass.log -padtop 64 -padbottom 64 -padleft 0 -padright 0 -r 29.97 -ab 128 -ar 32000 ${TY}.pass1

$FFMPEG -i $AVI -b 2000 -f ty -s 640x352 -pass 2 -passlogfile pass.log -padtop 64 -padbottom 64 -padleft 0 -padright 0 -r 29.97 -ab 128 -ar 32000 $TY

mikey
10-24-2006, 08:27 AM
@danpritts
Thanks,
I finally got a chance to try 2-pass mode. I can tell a differece in quality, however it is not, IMHO, very much. I processing in a batch overnight however I will be using it.

@ Bcc
ffmpeg -r 50/2 does give perfect sync from PAL .avi's, however I still notice the slight audio dropouts. They are pariculary noticable when when the input volume is high. The audio dropout or blip sounds similiar to preamp clipping. If needed I can put up clip where it is particulary noticable.

Thanks,
Mikey

bcc
10-24-2006, 01:16 PM
ffmpeg -r 50/2 does give perfect sync from PAL .avi's, however I still notice the slight audio dropouts. Have you tried to narrow it down more? For example, if you mux to .vob, do you get the same problem? What about if you only mux the audio stream?

mikey
10-24-2006, 02:44 PM
procedure:
rip PAL DVD to .vob

.vob or .mpg to .ty--> perfect sync slight audio drop when the volume increases.
or
.vob to .avi to .ty with ffmpeg -r/50 perfect sync slight audio drop when the volume increases.



What about if you only mux the audio stream?
Haven't tried that yet. I'm the middle of the 6.3a update, again. Just to be clear mux the .vob from the dvd to .mpa and encode to .ty. So I will Have a audio only stream to insert?

bcc
10-24-2006, 03:04 PM
What I'm getting at is whether or not your audio drop is unique to .ty being your destination format, or whether you have the same problems with other destination formats. Goes to whether or not you're having an issue with core ffmpeg or the ty format changes.
Your procedure doesn't include a test that sheds any light on that.
Presumably you're transcoding the video and maybe the audio with ffmpeg.
So after you've ripped to .vob, transcode with ffmpeg, with the same options you were using to make the .ty, to produce another .vob instead. Test result.

procedure:
rip PAL DVD to .vob

.vob or .mpg to .ty--> perfect sync slight audio drop when the volume increases.
or
.vob to .avi to .ty with ffmpeg -r/50 perfect sync slight audio drop when the volume increases.



Haven't tried that yet. I'm the middle of the 6.3a update, again. Just to be clear mux the .vob from the dvd to .mpa and encode to .ty. So I will Have a audio only stream to insert?Oh boy, 6.3a upgrade issues provide hours of fun for most of us.
Your multiplexed recroding (.ty or .vob) would happen to only have an audio stream in it.

ercdvs
11-03-2006, 09:12 AM
Excellent program... I have had no trouble conveting xvid avi's to .ty in both the windows binary & linux binary files...

Stupid questions (?) :

1) is it worth it to store all files in .ty format or keep them in the 'original' .avi .. The only possible places i stream are tivo & xbmc ... and in the future a myth tv box... Space may get to be an issue with 2x versions of each file

2) Aspect ratio .. I have pulled files in 16:9 and 4:3 format, and I have never specified the output ratio before. 16:9 output 'streched' as they would require the black bars top& bottom ... is there a reliable way for ffmpeg to automatically determine the beginning ration and output 4:3 straight or 4:3 w/ black bars ? or do i need to run it through 2 different option sets?

bcc
11-04-2006, 04:32 AM
Excellent program... I have had no trouble conveting xvid avi's to .ty in both the windows binary & linux binary files...

Stupid questions (?) :

1) is it worth it to store all files in .ty format or keep them in the 'original' .avi .. The only possible places i stream are tivo & xbmc ... and in the future a myth tv box... Space may get to be an issue with 2x versions of each file
Thanks.
Assuming your .avi files are mpeg4 encoded, they will be smaller in their original form. Also the conversion to .ty is a lossy one as you're re-compressing the video into mpeg2. If you ever wanted to re-transcode the content you'd want the original .avi to avoid generational loss.
2) Aspect ratio .. I have pulled files in 16:9 and 4:3 format, and I have never specified the output ratio before. 16:9 output 'streched' as they would require the black bars top& bottom ... is there a reliable way for ffmpeg to automatically determine the beginning ration and output 4:3 straight or 4:3 w/ black bars ? or do i need to run it through 2 different option sets?I don't know; I haven't needed to play with aspect ratio conversions as my hr10-250 and widescreen seem to do the right thing.

ercdvs
11-09-2006, 06:03 PM
Curious:

./ffmpeg -i "TVShows/torchwood.s01e04.avi" -vcodec mpegvideo - b 2500k -r 29.97 -aspect 4:3 -acodec mp2 -ab 192 "TVShows/TorchWood s01e04.ty"
FFmpeg version SVN-r6543, Copyright (c) 2000-2006 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --dis able-ffplay --disable-ffserver
libavutil version: 49.0.1
libavcodec version: 51.16.0
libavformat version: 50.5.0
built on Oct 5 2006 21:38:15, gcc: 4.1.0 20060304 (Red Hat 4.1.0-3)
Input #0, avi, from 'TVShows/torchwood.s01e04.avi':
Duration: 00:49:08.7, start: 0.000000, bitrate: 995 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 624x352, 25.00 fps(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 112 kb/s
File 'TVShows/TorchWood s01e04.ty' already exists. Overwrite ? [y/N] y
Output #0, ty, to 'TVShows/TorchWood s01e04.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 624x352, q=2-31, 2500 kb/s, 29.97 fps (c)
Stream #0.1: Audio: mp2, 48000 Hz, stereo, 192 kb/s


This has been a trend in the last couple torchwood episodes recorded from the BBC ... the only difference I can see is that they are at 25 fps .. and no matter if I specify an output ty of 29.97 or leave it at ffmpegs default option, I get a very slow convert and what seems like only a partial file.

The video plays very quickly (25 fps playing at 29.97 fps?) and the audio is not synched ...

Most likely unrelated, but after I uploaded the partially converted file, my tivo now reboots every 1/2 hour or so. I deleted the file, so I think its just a coincidence.

Thoughts on what I am doing wrong in trying to make a ty for a standalone series 2?

bcc
11-09-2006, 07:06 PM
Use -r 2/50 for PAL frame rate AVIs, as explained above. Make sure to use the option before your -i option.

ercdvs
11-09-2006, 07:14 PM
sorry ... i read all those posts and for some reason I never noticed it was my*exact* problem as well..

D'oh

whackit
11-13-2006, 01:22 PM
One of my wives favorite shows was not recorded yesterday... My fault working on power in house, breaker was off. I'm in the doghouse here, normally I would research this more and teach myself the answer but as they say, desperate times call for desperate measures.

Okay, I'm a bit of a noob at ffmpeg and am just looking for the correct command line to convert avi. to .ty and then the correct procedure for re-insertion. I have tried some of the commands listed in this thread and am having little success. The files are to be inserted on a s1 dtivo.

After I convert the file do I just drop it in with MFS_FTP or is there something else I need to do. Most of my experience with insertion is from backed up .tys.

Thanks and apologies for the noobness.

Okay. The insertion part is working fine... I just need the correct command line. Thanks again!

mikey
11-13-2006, 03:49 PM
try here (http://www.dealdatabase.com/forum/showpost.php?p=259563&postcount=48) tou might have to adjust the bitrate as these were written for 1.4 just add 2 zero's. I think. I'm not on my pc atm.

whackit
11-14-2006, 01:37 PM
for future searchers. here's what worked for me on my s1 dtivo:

run the following command from the command line:


ffmpeg -i "/PATH/tO/FILE.avi" -acodec mp2 -ar 32000 -ab 192 -vcodec mpeg2video -s 480x480 -b 3000k -r 29.97 "/PATH/tO/FILE.ty"

that makes decent files, on longer shows change the bitrate switch to 2500k which seems to make for more succesful ftps.

robn77
11-14-2006, 04:01 PM
I have been trying to encode a HD file that I copied via BeyondTV and my ATI HDTV Card so that I can upload it to my HR10-250.

The command I am running is:

ffmpeg -i fred.mpg -acodec ac3 -vcodec mpeg2video -r 29.97 -s 1920x1080fred.ty

This produces a highly grainy picture.

Are there other switches that I can use to improve the picture quality and am I using the correct video codec?

Thanks!

BTUxNine
11-14-2006, 05:14 PM
I have been trying to encode a HD file that I copied via BeyondTV and my ATI HDTV Card so that I can upload it to my HR10-250.

The command I am running is:

ffmpeg -i fred.mpg -acodec ac3 -vcodec mpeg2video -r 29.97 -s 1920x1080fred.ty

This produces a highly grainy picture.

Are there other switches that I can use to improve the picture quality and am I using the correct video codec?

Thanks!
the bitrate (-b) flag is what you need... try using -b 3000k

bcc
11-14-2006, 05:29 PM
the bitrate (-b) flag is what you need... try using -b 3000kI would go higher; it's an HD tivo after all. Or perhaps -vcodec copy if the original data rates and resolution are good already.

robn77
11-14-2006, 07:49 PM
I would go higher; it's an HD tivo after all. Or perhaps -vcodec copy if the original data rates and resolution are good already.

I tried even -b 7000 and it still was grainy.

When I try -vcodec copy I get these errors:


...many more of the below line
error, non monotone timestamps 263867 >= 260864
error, non monotone timestamps 263867 >= 263867
assertion "FALSE" failed: file "ty-enc.c", line 247

Also the file when ffmpeg works, the output file is only 400MB when the original is 2.5GB for a 15 minute test file. Does that sound correct?

Below is the beginning of the ffmpeg output:

E:\Shows\SnapStream>ffmpeg -i fred.mpg -acodec ac3 -vcodec copy -r 29.97 -s 1920
x1080 -b 7000 fred.ty
FFmpeg version SVN-r6543, Copyright (c) 2000-2006 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --dis
able-ffplay --disable-ffserver
libavutil version: 49.0.1
libavcodec version: 51.16.0
libavformat version: 50.5.0
built on Oct 6 2006 00:36:08, gcc: 3.4.4 (cygming special) (gdc 0.12, using d
md 0.125)
Input #0, mpegts, from 'fred.mpg':
Duration: 00:17:53.7, start: 63017.381367, bitrate: 19387 kb/s
Stream #0.0[0x31]: Video: mpeg2video, yuv420p, 1920x1080, 16000 kb/s, 29.97 fps(r)
Stream #0.1[0x34](eng): Audio: ac3, 48000 Hz, mono, 384 kb/s
File 'fred.ty' already exists. Overwrite ? [y/N] y
Output #0, ty, to 'fred.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 1920x1080, q=2-31, 16000 kb/s, 29.97 fps(c)
Stream #0.1: Audio: ac3, 48000 Hz, mono, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
error, non monotone timestamps 263867 >= 35639
...
error, non monotone timestamps 263867 >= 260864
error, non monotone timestamps 263867 >= 263867
assertion "FALSE" failed: file "ty-enc.c", line 247

Thanks!

ercdvs
11-14-2006, 08:02 PM
You have to specify the 'k' at the end, as in -b 7000k or -b 7000000 ..

In previous builds, it was assumed the value for -b was in k, but that is no longer the case...

You were actually encoding it at 7000b/sec FAR below what you wanted.

For my Series 2 stand alone .. this command line gives me great quality on my 'normal' 4:3 tv :



ffmpeg -i "FILE.AVI" -vcodec mpegvideo -b 2500k -acodec mp2 -ab 192 "FILE.TY"


I am still playing around to convert downloaded 16:9 video to display properly on my 4:3 tv (letterboxed) and have the proper title show up on my tivo 'Now Playing'

bcc
11-14-2006, 08:07 PM
When I try -vcodec copy I get these errors:


...many more of the below line
error, non monotone timestamps 263867 >= 260864
error, non monotone timestamps 263867 >= 263867

Hmm, right, this seems to only work right when you demux streams first. This is a bug in ffmpeg IMO. It should be able to figure out that the coded order <> playback order and adjust accordingly when using -vcodec copy...
You should be able to work around this by demuxing to .m2v & .ac3 and then running ffmpeg -vcodec copy.

robn77
11-14-2006, 09:10 PM
Hmm, right, this seems to only work right when you demux streams first. This is a bug in ffmpeg IMO. It should be able to figure out that the coded order <> playback order and adjust accordingly when using -vcodec copy...
You should be able to work around this by demuxing to .m2v & .ac3 and then running ffmpeg -vcodec copy.

OK. I downloaded the 0.18 version of hdemux and when I try and run it on the mpg file, I get a windows error box saying that it has encountered an error. Does hdmux only work on ty files? If so, what should I use to split the files?

The executable has a -d switch to turn up debugging. What valid values are there?

bcc
11-14-2006, 09:26 PM
OK. I downloaded the 0.18 version of hdemux and when I try and run it on the mpg file, I get a windows error box saying that it has encountered an error. Does hdmux only work on ty files? If so, what should I use to split the files?hdemux is just for TY demuxing. vobedit and mplayer with -dumpvideo/-dumpaudio can demux mpeg2. Those are just examples, I'm sure there are better apps around.
The executable has a -d switch to turn up debugging. What valid values are there?Asked&answered in the hdemux thread.

pahunt
11-22-2006, 12:02 PM
Has anyone had any success getting 16:9 content to display full screen on a widescreen tv with a UK series 1? I am using the following command line and although it displays in widescreen on my PC, when I upload it to Tivo it seems to be ignoring the aspect flag and pillarboxing the picture. 16:9 programs that I record on Tivo display fine so I know the TV is setup correctly.


ffmpeg.exe -i c:\test.avi -acodec mp2 -ar 48000 -ab 192 -vcodec mpeg2video -sameq -r 25 -s 720x576 -aspect 16:9 c:\test.ty+

Anyone have any ideas?

mgoddard
11-24-2006, 05:14 PM
I'm having a problem that hopefully some of the gurus out there could troubleshoot or point me in the right direction. I'm running the latest version of ffmpeg and I'm having problems converting dvd vob files to ty format. The vob file is extracted as single file using dvddecrypter and only the video and first audio stream are extracted. The vob itself plays fine using VLC.

Here's the command string I'm using:
ffmpeg -x "movie.xml" -y -i "movie.vob" -vcodec copy -acodec copy "movie.ty"

And this is the error I'm getting after it runs a while. In this case it happened at about 270MB:

Input #0, mpeg, from 'x:\movie.VOB':
Duration: 01:01:30.9, start: 0.200367, bitrate: 12308 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480, 9800 kb/s, 59.94 fps(
r)
Stream #0.1[0x80]: Audio: ac3, 48000 Hz, mono, 448 kb/s
Output #0, ty, to 'c:\tivo\tmf\movie.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 720x480, q=2-31, 9800 kb/s, 29.97 fps
(c)
Stream #0.1: Audio: ac3, 48000 Hz, mono, 448 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
assertion "FALSE" failed: file "ty-enc.c", line 247e= 0.0kbits/s
60 [sig] ffmpeg 3548 open_stackdumpfile: Dumping stack trace to ffmpeg.exe.
stackdump
388843 [sig] ffmpeg 3548 c:\tivo\tmf\ffmpeg.exe: *** fatal error - called with
threadlist_ix -1

So far I've seen this error on several DVDs. Has anybody else ran into this problem or knows what the assertion at line 247 is?


Thanks,

Matt

bcc
11-25-2006, 05:47 AM
I'm having a problem that hopefully some of the gurus out there could troubleshoot or point me in the right direction. I'm running the latest version of ffmpeg and I'm having problems converting dvd vob files to ty format. The vob file is extracted as single file using dvddecrypter and only the video and first audio stream are extracted. The vob itself plays fine using VLC.

Here's the command string I'm using:
ffmpeg -x "movie.xml" -y -i "movie.vob" -vcodec copy -acodec copy "movie.ty"

And this is the error I'm getting after it runs a while. In this case it happened at about 270MB:

Input #0, mpeg, from 'x:\movie.VOB':
Duration: 01:01:30.9, start: 0.200367, bitrate: 12308 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480, 9800 kb/s, 59.94 fps(
r)
Stream #0.1[0x80]: Audio: ac3, 48000 Hz, mono, 448 kb/s
Output #0, ty, to 'c:\tivo\tmf\movie.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 720x480, q=2-31, 9800 kb/s, 29.97 fps
(c)
Stream #0.1: Audio: ac3, 48000 Hz, mono, 448 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
assertion "FALSE" failed: file "ty-enc.c", line 247e= 0.0kbits/s
60 [sig] ffmpeg 3548 open_stackdumpfile: Dumping stack trace to ffmpeg.exe.
stackdump
388843 [sig] ffmpeg 3548 c:\tivo\tmf\ffmpeg.exe: *** fatal error - called with
threadlist_ix -1

So far I've seen this error on several DVDs. Has anybody else ran into this problem or knows what the assertion at line 247 is?
The code is parsing the video stream, and making assumptions about which kinds of video start codes must be expected. Probably it hit a packet that was just full of video slices, not one of the expected start codes. One should be able to find the part of the stream it's having trouble with and take a look at the data. Then adjust the code accordingly. Probably generate a VID_CONT record in this case.

mgoddard
11-25-2006, 10:50 AM
Thanks BCC,

I ended up finding your ffmpeg diff file and found that assertion and like you said it was expecting only certain types of video frames. So I ran it through the VideoRedo cleaner which removed a bunch of video resync frames and I was able to transcode it to ty format without any problems. The first DVD I tried transcoding (Over The Hedge) processed fine so I was a little surprised to have a problem with this one. I also had a problem even getting a sample of that DVD to play and it turned out I had this problem
(http://64.21.8.90/forum/showpost.php?p=232209&postcount=50)

After making the mfs_ftp.tcl fix I was able to push up video without any problems.

By the way your tytompeg program works perfect!

bcc
11-25-2006, 02:51 PM
I ended up finding your ffmpeg diff file and found that assertion and like you said it was expecting only certain types of video frames. So I ran it through the VideoRedo cleaner which removed a bunch of video resync frames and I was able to transcode it to ty format without any problems. The first DVD I tried transcoding (Over The Hedge) processed fine so I was a little surprised to have a problem with this one.Ok, good.
I also had a problem even getting a sample of that DVD to play and it turned out I had this problem
(http://64.21.8.90/forum/showpost.php?p=232209&postcount=50)I assume you mean you had to convert to .tmf to avoid bugs in mfs_ftp. The string range bug jamie mentions should by itself only be cosmetic, as bytes 5-7 are 0 anyways (perhaps not in some oddball recordings but certainly with what ffmpeg generates).

After making the mfs_ftp.tcl fix I was able to push up video without any problems.If just fixing the string range in mfs_ftp is making a difference with a ffmpeg recording, then the recording is getting corrupted, and you're probably really having this problem: http://www.dealdatabase.com/forum/showpost.php?p=247282&postcount=1023

By the way your tytompeg program works perfect!Thanks. Got some fixes for problem streams on the way actually..

mgoddard
11-27-2006, 12:11 AM
Well I ran into a DVD that I cleaned up with videoredo and I'm still getting that assert on line 247 in ty-enc.c so I think I'll get the source and figure out what type of packet it's running into and handle it accordingly. Personally I find it much easier to have some of the kids favorite movies on my hdtivo than to have to keep loading the dvd player and switching the video and audio inputs.

I've only pushed up a handful of DVDs up so far but from my experience any movie I converted with ffmpeg would not play on my hdtivo until I made Jamie's string range bug fix in mfs_ftp.tcl. However, before I made that change I was able to convert one dvd using mplex_cc, convert it to a tmf and push it up successfully. I also haven't seen the potential dropout or corruption problems you referenced BCC with pushing up ty+ files but since there is a potential problem with it I'll go ahead and do the tmf conversion beforehand.

At any rate thanks for your help BCC and I'll dive into the code and figure out what's going on.

mgoddard
11-30-2006, 01:32 AM
I have a 16GB HD transport stream I'm trying to convert to a ty file and I'm running into a problem that hopefully one of the ffmpeg gurus has some insight on. I ran the stream through videoredo and it plays fine in vlc so I think the stream is ok but at about 8.2GB ffmpeg acts like it hit the end of the stream and starts computing the master chunks. When ffmpeg initially parses the stream it does report the correct length of the stream:

Input #0, mpegts, from 'x:\stream.ts':
Duration: 01:57:07.2, start: 80139.890033, bitrate: 18426 kb/s
Stream #0.0[0x11]: Video: mpeg2video, yuv420p, 1920x1080, 65000 kb/s, 29.97 fp
s(r)
Stream #0.1[0x14]: Audio: ac3, 48000 Hz, mono, 384 kb/s


Is there a filesize limitation or anything of that nature in ffmpeg that might cause this?

mgoddard
11-30-2006, 11:12 PM
If you wait long enough you eventually end up answering your own questions but somebody may find this useful to know.
The transport stream I had was segmented into 4 pieces and I thought they were split with a video editor of some sort so when I spliced them together with HDTVtoMPEG2 the stream would play fine in VLC but ffmpeg would quit 8.2GB in the file as I described earlier. After looking at the files closer I discovered they were cut into fixed file sizes so I concatenated them with a copy /b command and ffmpeg processed the whole file without any problems. HDTVtoMPEG2 was discarding the split frames where the file was split which caused ffmpeg to fail.

alfonzotan
12-09-2006, 03:02 PM
This is probably the mother of all stupid questions, but I'm stumped on using the patched ffmpeg to convert an edited HDTivo MPEG back to .ty for re-insertion. It's an OTA recording (which may be the whole problem) that's been edited in VideoReDo for commercial removal, here are the vital stats:

1920x1080, 65000kbps, 29.97 fps; ac3, 48000Hz, 384 kbps.

I've tried running ffmpeg several times with various settings, but I keep getting an output file that's no larger than 25% of the original. Any suggestions? The last time I tried it, I used the following syntax:

ffmpeg -i filename.mpg -f mpeg2video -b 65000 -acodec copy filename.ty

Thanks...

danpritts
12-12-2006, 01:42 AM
ffmpeg -i filename.mpg -f mpeg2video -b 65000 -acodec copy filename.ty



try -vcodec copy; this will avoid any video re-encoding, just like -acodec copy avoids audio re-encoding. drop the -b flag.

alfonzotan
12-13-2006, 07:42 PM
try -vcodec copy; this will avoid any video re-encoding, just like -acodec copy avoids audio re-encoding. drop the -b flag.

Bingo. Thank you.

dillweed
12-24-2006, 09:03 PM
Deleted text because I got it working.

Raymond Day
01-12-2007, 09:15 AM
Hi. I think this is super ffmpeg. My 1st test was a .mpg 4 min. video. It worked super. Played on TiVo very good. It's a 720 x 480 MPEG-2 2 channel 192 kbit/s. I just used the command like this:


ffmpeg -i 11Alive.mpg -acodec copy -vcodec copy 11Alive.ty

It played back super on my TiVo Series 1.

I have lots of .avi/.divx videos and some I love to play on TiVo. But when I do them and play them on TiVo they look bad. Blocks and bigger blocks in the video.

I been using lots of ffmpeg commands. The last one I did looked like this. I will just paste the hole dos window in here:


C:\Documents and Settings\Raymond Day\My Documents\My Videos\TiVo\ffmpeg>ffmpeg -i "test.avi" -vcodec mpeg2video -acodec mp2 -ab 192 "test3.ty"
FFmpeg version SVN-r6543, Copyright (c) 2000-2006 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --disable-ffplay --disable-ffserver
libavutil version: 49.0.1
libavcodec version: 51.16.0
libavformat version: 50.5.0
built on Oct 6 2006 00:36:08, gcc: 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
Input #0, avi, from 'test.avi':
Duration: 00:24:38.6, start: 0.000000, bitrate: 975 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 640x480, 23.98 fps(r)
Stream #0.1: Audio: mp3, 44100 Hz, stereo, 160 kb/s
Output #0, ty, to 'test3.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 640x480, q=2-31, 200 kb/s,23.98 fps(c)
Stream #0.1: Audio: mp2, 44100 Hz, stereo, 192 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
backstep:374, lastbuf:358 0kB time=1309.0 bitrate= 0.0kbits/s
invalid new backstep 486
overread, skip -7 enddists: -4 -4B time=1392.4 bitrate= 0.0kbits/s
Generating master chunk for chunks 0:9551477.3 bitrate= 0.0kbits/s
Successfully wrote new XML
frame=35453 q=31.0 Lsize= 0kB time=1478.3 bitrate= 0.0kbits/s
video:84264kB audio:34647kB global headers:0kB muxing overhead -100.000000%

C:\Documents and Settings\Raymond Day\My Documents\My Videos\TiVo\ffmpeg>

I guess the mpeg2video tells that it's a .avi video.

I have .avi videos in:

720 x 528
656 x 480
640 x 480
480 x 480
720 x 480

I guess the TiVo likes 720 x 480 because that .mpg video played very good in my TiVo. Or maybe it likes 480 x 480 because videos off the TiVo look like they are in that.

I all ready played this one video on a computer with GeexBox with a S/Video in the TiVo so it thinks it's a cable box. That video looks a way better. But I would love to put it on TiVo so it's digital to digital. Not digital to analog. But that way it played very good. When I do the S/Video I can't start and stop it good on the TiVo.

Thank you for ffmpeg. Seems to work good as long as you know how to use it.

What is the command I would do so when I play the video back on TiVo it would look good?

drez
01-12-2007, 06:36 PM
You didn't include a bitrate value in your ffmpeg line. If you don't specify a value, it will use a default value of 200kb/s (http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html#SEC9) (which looks horrible with MPEG-2.)

3000kb/s is a good value for MPEG-2. If you wanted to save a little space, you could try 2500kb/s.



So instead of:
ffmpeg -i "file.avi" -vcodec mpeg2video -acodec mp2 -ab 192 "file.ty"

Use this:
ffmpeg -i "file.avi" -vcodec mpeg2video -b 3000k -acodec mp2 -ab 192k "file.ty"

(Note: Don't forget the k after 3000 and 192.)

Raymond Day
01-13-2007, 01:22 AM
I did what you said Drez, were you put "Use this:" and the video looks super now. But it cuts off about a inch. on all sides. Is there away to get it not to cut off the sides?

Thank you a lot. The video now plays super on my TiVo. It is a Japanese video with text to show what they are saying. The text goes on the sides and this cuts off a little.

Raymond Day
01-13-2007, 11:19 AM
Because the side are cut off some. I been testing the -pad commends like this:

ffmpeg -i "file.avi" -vcodec mpeg2video -b 3000k -padtop 0 -padbottom 16 -padleft 16 -padright 16 -acodec mp2 -ab 192 "file5.ty"

This is the 5 time I am doing it. It takes about 10 minutes to convert it and 10 minutes to send it to TiVo.

Is this the right way to do it and if so what are good number to use in the -pad ?

I wanted to get a photo of the screen. So I did the S/Video out to my computer. I could see all the video then. Not like on the TV were the sides are cut off. But with the paded one it looks like it just zoomed in on the video and put a green over lay bar at the top. I did not see that bar on the TV. The no pad one is the one I recorded right to the TiVo with S/Video in.

I guess ffmpeg is just resizing the video to big so it don't fit on the TV screen good.

Can this be fixed with some -code ffmpeg thing added?

I worked on making a image of it in a .gif so you can see what I am talking about. On TiVo I don't see the black parts on the sides. It looks like the size on TiVo is the smaller size in this image. So when it changes to the bigger size you can see about what it's cutting off on TiVo.

http://i93.photobucket.com/albums/l41/RaymondDay/pad_screen_ffmpeg.gif

So on TiVo the text that says "Speaking of which, are you gonna use that thing yet again?" is cut off on the left and right a little. So you don't see all the S or the ?

When I copy this same video with the S/Video in it did not cut off text like this.

Put your pointing arrow on the smaller size edges in here and then you can see about were it cuts it off on the TiVo.

I hope there is a way to fix this.

Raymond Day
01-14-2007, 12:51 PM
You have to tell the size of the video a little smaller then pad it to the right size. So the command I did was this:


ffmpeg -i "file.avi" -vcodec mpeg2video -b 3000k -s 420x420 -padtop 30 -padbottom 30 -padleft 30 -padright 30 -ss 167 -t 170 -acodec mp2 -ab 192 "file-420x420-pad30.ty"

This gets the video on the right and left side on my TV real good. The bottom and top have a little black space on them. But I did a 440x420 with pad of 20 on the top and bottom then it did not show the video on TV good. Moved it to the left and up some. So I guess the best I can do is a 480x480 down to 420x420 and pad all the sides with 30 to make it back to 480x480 with black around the sides were TiVo don't show it on a TV.

I guess TiVo must do something like this when it records TV. So you can see all the video.

It's something that when I do the video out of TiVo to my computer it can see all the sides very good. But my TV don't.

So is this the right way to make it so you can see all the video on TiVo?

I am going to to convert the hole video file now. I put the -ss 167 and -t 170to just save a start and end in sec. of the video to test it.

TivoZA
01-14-2007, 01:21 PM
But it cuts off about a inch. on all sides. Is there away to get it not to cut off the sides?The reason the sides of your video are cutoff is due to the TV's overscan (http://en.wikipedia.org/wiki/Overscan). As explained in the wikipedia guide, most TV's cut-off between 5-10% of the broadcast picture. This is something that the broadcasters take into account and you may notice that your downloaded recordings have a black border around them.

I've created an app (called nanVue (http://tivoza.nanfo.com/forum/viewtopic.php?t=423)) that ties together tytompg, tyffmpeg as well as the mfs_ftp uploading and downloading. One of the features of nanVue is that you can specify an overscan percentage. nanVue will automatically determine the necessary padding required based on the video being converted and it can also automatically letterbox your content to ensure that that aspect ratio is maintained.

By default the overscan percentages in the nanVue TiVo profiles are set to 5% but you may want to either increase or decrease this depending on your TV.

s11018
01-16-2007, 10:57 AM
I downloaded and extracted the ffmeg and cygwin1.dll files into a directory. I then cd'ed to the directory that contains my VOB file and ran and called ffmpeg from a batch script. I get a shared memory error (sorry, got the error at home and don't have the full text with me).
Before I go messing around with my existing cygwin install I wanted to make sure I am following the proper steps. Should I backup the /cygwin/bin/cygwin1.dll that already exists and then replace it with the one that was downloaded ? Or am I missing something else.

I have hacked, expanded, patched, networked, etc. all of my DTIVO's. I can serve pictures from my PC with TivoDesktop. I can serve up previously saved and editted ty files captured with TyTools. The only thing missing is the ability to serve up my DVD collection that I have backed up to HDD.

Thanks for your help.
Ed

joeybubbabob
01-16-2007, 06:59 PM
Leave the cygwin1.dll that is used by your cygwin install alone. Just place a copy of the cygwin1.dll that you downloaded with ty-ffmpeg in the same directory as the ffmpeg.exe file. That way ffmpeg.exe will use the cygwin1.dll that it was compiled to use, and you're cygwin install will use the cygwin1.dll that it wants to use.

s11018
01-16-2007, 11:39 PM
Thanks for the reply.

I believe my original message said that I did that exactly. All files were extracted to one directory as per the instructions. I have included the error below. I even tried to reset the PATH variable and 'cd' to the directory where the executable resides so that it would look in the local directory first. I even tried absolute paths for the executable and files just to be safe.

I eventually just saved my original cygwin1.dll to a temp file and copied the new file to c:\cygwin\bin and I was able to convert the VOB to a TY file.

Directory of D:\My Tivo\ffmpeg\extracted

01/16/2007 08:50 PM <DIR> .
01/16/2007 08:50 PM <DIR> ..
01/20/2006 10:28 AM 1,805,448 cygwin1.dll
08/22/2005 07:03 PM 66,048 cygz.dll
10/06/2006 12:46 AM 3,698,688 ffmpeg.exe
01/16/2007 06:20 AM 450 sample.txt
4 File(s) 5,570,634 bytes
2 Dir(s) 138,136,481,792 bytes free

D:\DVD Backups>dir
Volume in drive D is Partition2
Volume Serial Number is 44DC-8761

Directory of D:\DVD Backups

01/16/2007 09:04 PM <DIR> .
01/16/2007 09:04 PM <DIR> ..
01/14/2007 07:18 AM <DIR> Cars
01/16/2007 09:04 PM 284 ffmpgtoty.bat
01/14/2007 08:17 AM <DIR> Robots
01/14/2007 07:19 AM <DIR> RV
1 File(s) 284 bytes
5 Dir(s) 138,136,481,792 bytes free

D:\DVD Backups>more ffmpgtoty.bat
cd "\My Tivo\ffmpeg\extracted\"
PATH ;
REM d:"\My Tivo\ffmpeg\extracted\ffmpeg" -i %1 -scodec copy -acodec copy -vcodec
copy %2
d:"\My Tivo\ffmpeg\extracted\ffmpeg" -i d:"\DVD Backups\Robots\Robots.VOB" -scodec copy -acodec copy -vcodec copy d:"\DVD Backups\Robots\Robots.ty"

D:\DVD Backups>ffmpgtoty.bat

D:\DVD Backups>cd "\My Tivo\ffmpeg\extracted\"

D:\My Tivo\ffmpeg\extracted>PATH ;

D:\My Tivo\ffmpeg\extracted>REM d:"\My Tivo\ffmpeg\extracted\ffmpeg" -i -scodec
copy -acodec copy -vcodec copy

D:\My Tivo\ffmpeg\extracted>d:"\My Tivo\ffmpeg\extracted\ffmpeg" -i d:"\DVD Backups\Robots\Robots.VOB" -scodec copy -acodec copy -vcodec copy d:"\DVD Backups\Robots\Robots.ty"
38 [main] ? (4364) d:\My Tivo\ffmpeg\extracted\ffmpeg.exe: *** fatal error
- system shared memory version mismatch detected - 0x75BE0084/0x75BE0096.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
D:\My Tivo\ffmpeg\extracted>

helpdeskdan
01-24-2007, 11:13 PM
That's odd, when I convert with ffmpeg, I get no sound. Granted, I haven't tried it on the tivo, but mplayer reports Audio: no sound. Works with other .ty's. Any idea what is wrong?

Thanks,
-Dan

helpdeskdan
01-27-2007, 01:29 AM
Never mind, I got it. ffmpeg -i source.mpg -ab 192 -ar 32000 -vcodec copy dest.ty I wonder if it has to be 32000? 44100 would sound better.

BTUxNine
01-27-2007, 01:42 AM
44100 works on S2's... not sure about S1 (I think some have had trouble)

helpdeskdan
01-28-2007, 12:55 AM
Thanks - I suppose I will have to experiment more. I never actually tried the first file on my tivo, I only noted that mplayer wouldn't play it. Speaking of mplayer, has anybody noted that NiceWarrior appears to be gone? Without the vstream-client, will mplayer continue to be able to play .ty's? Probably the wrong forum to mention this.

Bester
01-30-2007, 12:37 AM
A couple of noob questions...

Is there a minimum time/size the tyffmpeg supports? I have several small .ts files I've been trying to convert. The original .ts files are about 70Mb. When ffmpeg is done with them, they are 6-7Mb. I use the

ffmpeg -i source.ts -acodec copy -vcodec copy destination.ty+.

Here is the output

D:\FFMPEG>ffmpeg -i irewindow100.ts -acodec copy -vcodec copy irewindow100.ty+
FFmpeg version SVN-r6543, Copyright (c) 2000-2006 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --dis
able-ffplay --disable-ffserver
libavutil version: 49.0.1
libavcodec version: 51.16.0
libavformat version: 50.5.0
built on Oct 6 2006 00:36:08, gcc: 3.4.4 (cygming special) (gdc 0.12, using d
md 0.125)
Input #0, mpegts, from 'irewindow100.ts':
Duration: 00:00:30.4, start: 1.714644, bitrate: 19655 kb/s
Stream #0.0[0x31]: Video: mpeg2video, yuv420p, 1920x1080, 17600 kb/s, 29.97 fp
s(r)
Stream #0.1[0x32]: Audio: ac3, 48000 Hz, mono, 384 kb/s
Output #0, ty, to 'irewindow100.ty+':
Stream #0.0: Video: mpeg2video, yuv420p, 1920x1080, q=2-31, 17600 kb/s, 29.97
fps(c)
Stream #0.1: Audio: ac3, 48000 Hz, mono, 384 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
Generating master chunk for chunks 0:39
Successfully wrote new XML
frame= 917 q=4995807.8 Lsize= 0kB time=30.2 bitrate= 0.0kbits/s
video:3418kB audio:1418kB global headers:0kB muxing overhead -100.000000%

D:\FFMPEG>

I'm trying to upload these files to calibrate my system from source through output. I got the .ts files from www.w6rz.net.

I did read through this entire thread and didn't find my problems(unless they were re-encoding, which I am not).

The other problem I am having is with mfs_ftp(i think) the files upload(shows correct size), then the screen refreshes and the file is there with 0bytes. I am using SmartFTP. I've been looking through the various MFS_Ftp threads, and I'm getting nowhere. Would someone mind pointing me in the right direction? edit, nevermind on this part, I found some answers outside the MFS_ftp support thread....

Thanks for any help

edit 2, nevermind, figured it out....

ercdvs
02-13-2007, 09:49 PM
so.. can anyone give me (if they figured it out) the definitive way to output video in the proper ratio?

I have a video @ 596x246 ... no clear ratio that I can tell ... when i output using :


./ffmpeg -i "video/Movie/movie.avi" -acodec mp2 -ab 192 -vcodec mpegvideo -b 3000k -aspect 16:9 "tivo/movie.ty+"


I get a stretched screen vertically .. trying with :


-aspect 16:9

to assure there will be a letterbox on the top and bottom. Is there a tried and true method of always outputting video in the proper ratio (onto a 4:3 screen) no matter what input resolution, or what calculations I should do forst to determine what to output?

or is it better to specify a 'standard' height & width and possilby pad ? Series 2 stand alone.

mttjcksn
02-14-2007, 11:35 AM
So i've followed the steps laid out here (http://dealdatabase.com/forum/showpost.php?p=258391&postcount=1) to compile the patched version of ffmpeg, namely...


svn checkout -r 6543 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
wget http://dealdatabase.com/forum/attachment.php?attachmentid=5790&d=1160121594
patch -p1 < ffmpeg-diffs-xx.txt
./configure --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --disable-ffplay --disable-ffserver
gmake
(had to use gmake, since make immediately barfed with errors)

I run it with the following options:

./tivo-ffmpeg -i "Battlestar Galactica - Mini Series/Extras.avi" -acodec mp2 -ab 192 -vcodec mpegvideo -b 3000k "../bsg-extras.ty+"

I get the following header output:

configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --disable-ffplay --disable-ffserver
libavutil version: 49.0.1
libavcodec version: 51.16.0
libavformat version: 50.5.0
built on Feb 14 2007 08:26:50, gcc: 3.4.4 [FreeBSD] 20050518
Input #0, avi, from '/home/matt/bittorrent/Battlestar Galactica - Mini Series/Extras.avi':
Duration: 00:20:30.2, start: 0.000000, bitrate: 1657 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 704x400, 25.00 fps(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 256 kb/s
Output #0, ty, to '../bsg-extras.ty+':
Stream #0.0: Video: mpeg2video, yuv420p, 704x400, q=2-31, 3000 kb/s, 25.00 fps(c)
Stream #0.1: Audio: mp2, 48000 Hz, stereo, 192 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1

But, immediately, the screen wraps with 'invalid new backstep' errors!

They seem like warnings, since the process completes, but when I look at the output file, this is all I get:

file bsg-extras.ty+
bsg-extras.ty+: data

I upload the video to mfs_ftp and, unsurprisingly, playback fails.

Can somebody PLEASE tell me what I'm doing wrong here??

Thank you!

drez
02-14-2007, 10:19 PM
try:

./tivo-ffmpeg -i "Battlestar Galactica - Mini Series/Extras.avi" -acodec mp2 -ab 192 -vcodec mpegvideo -b 3000k "../bsg-extras.ty"

(without the + ... the output will still have xml.)

also, is there some reason you don't use the already compiled linux binaries (latest 1.6 is here: http://www.dealdatabase.com/forum/showpost.php?p=271868&postcount=85)

rbreding
02-21-2007, 10:23 AM
Not sure what I am doing wrong at this point.

Ran this with the latest 1.6 release:

ffmpeg -p file.mpg -vcodec copy -codec copy out.ty

The file is an output from videoredo and is 1280/720p from a FOX station. I attempted to insert it into the hr10-250 and the insert was successfull, however when attempting to play the tivo it complains about no video. When I convert the file back to mpeg with ty2mpeg it converts fine and is playable. So my assumption the error is on the insertion/tivo side.

Can someone confirm if I am heading in the right direction ? Else I will continue to assume its mfs_ftp and debug from there.

Thanks

ercdvs
02-26-2007, 01:00 PM
so... a few nagging issues when using ffmpeg that I wonder if anyone has tackled :

1) I don't need to explicitly output the file as a ty+ (or .ty) and drop it to the /ty+ folder for it to show up on the tivo? The entry "Show.ty+" on my now playing list is getting annoying

2) The XML controls all, i realize.. but what entries are needed to have the show appear properly in order as a series? At first glance of an existing xml file from a tivo recorded show, it looks to be quite a few...

3) has anyone come up with a reliable way to have a 'standard' xml file that can be changed for various shows to help automate loading onto the tivo?

i've gone so far as to create "show 1.xml", show 2.xml" to help the tivo load.. but in relation to question 2, i can't seem to get all the settings right...

labbie48
02-26-2007, 02:54 PM
so... a few nagging issues when using ffmpeg that I wonder if anyone has tackled :

1) I don't need to explicitly output the file as a ty+ (or .ty) and drop it to the /ty+ folder for it to show up on the tivo? The entry "Show.ty+" on my now playing list is getting annoying

2) The XML controls all, i realize.. but what entries are needed to have the show appear properly in order as a series? At first glance of an existing xml file from a tivo recorded show, it looks to be quite a few...

3) has anyone come up with a reliable way to have a 'standard' xml file that can be changed for various shows to help automate loading onto the tivo?

i've gone so far as to create "show 1.xml", show 2.xml" to help the tivo load.. but in relation to question 2, i can't seem to get all the settings right...

This is the format I have been using with some success. If you try this, just remember to remove everything that's bracketed "[]" because they are just notes and if included will cause problems. I name the xml file the same as the movie, show, etc and run ffmpeg to combine them into a ty+ file then insert it into my HR10 with Movieloader.

The Advisory, Genre and MPAA rating can be found in this thread.

Here (http://www.dealdatabase.com/forum/showthread.php?t=50560&highlight=tivoserver+xml)




<?xml version="1.1" tivoversion="6.3c-01-2-357"?>
<Object type="Recording" id="_top">
<SubObject type="Showing" id="Showing">
<Date>13564</Date> [expr $(date -d"8/1/2006" "+%s") / 86400 <- enter this at a bash prompt changing the date of course]
<Duration>4200</Duration> [Movie or Show run time x 60 seconds]
<Object type="Program" id="Program">
<Actor>Laverty|Larry</Actor>
<Actor>Dekker|Amanda</Actor>
<Actor>Yang|Susan</Actor>
<Actor>Boatright|Bruce</Actor>
<Actor>Ritzema|Alex Ross</Actor>
<Advisory>2</Advisory>
<Advisory>4</Advisory>
<Advisory>6</Advisory>
<DescLanguage>English</DescLanguage>
<Description>A group of friends get together for a New Year's Eve party.</Description>
<Director>Higgins|Patrick</Director>
<Genre>55</Genre>
<Genre>104</Genre>
<Genre>110</Genre>
<MovieRunTime>70</MovieRunTime>
<MovieYear>2006</MovieYear>
<MpaaRating>4</MpaaRating>
<OriginalAirDate>13445</OriginalAirDate> [expr $(date -d"8/1/2006" "+%s") / 86400 <- enter this at a bash prompt changing the date of course]
<Object type="Series" id="Series"> [Series Movie Sports]
<Genre>55</Genre>
<Genre>104</Genre>
<Genre>110</Genre>
<Title>Sickness House</Title>
<TmsId>MV999999</TmsId> [MV=Movie SH=Series SP=Sports + 6-9's]
</Object>
<Title>Sickness House</Title>
<TmsId>MV9999999999</TmsId> [MV=Movie SH=Series SP=Sports + 10-9's]
<Writer>Laverty|Larry</Writer>
</Object>
</SubObject>
</Object>

rbautch
02-26-2007, 05:34 PM
so... a few nagging issues when using ffmpeg that I wonder if anyone has tackled :

1) I don't need to explicitly output the file as a ty+ (or .ty) and drop it to the /ty+ folder for it to show up on the tivo? The entry "Show.ty+" on my now playing list is getting annoying

2) The XML controls all, i realize.. but what entries are needed to have the show appear properly in order as a series? At first glance of an existing xml file from a tivo recorded show, it looks to be quite a few...

3) has anyone come up with a reliable way to have a 'standard' xml file that can be changed for various shows to help automate loading onto the tivo?

i've gone so far as to create "show 1.xml", show 2.xml" to help the tivo load.. but in relation to question 2, i can't seem to get all the settings right...If you have many shows that you want to create xml files for, try this (http://www.dealdatabase.com/forum/showthread.php?t=52025) script, which automatically generates xml files based on filename of the show.

ercdvs
02-28-2007, 04:03 PM
Wow.. exactly what I needed.

I'm not too keen on the actors / show description... since i really just would use it to put that 'lost' episode on that we missed as an actual 'lost' episode.. not lost.ty+

Isn't there a lookup for tv /movies online that I can script a lookup to? Kind of like CDDB for cd's ?

studog86
03-03-2007, 04:11 PM
I am trying to up convert avi ac3 6 channerl to a ty but to no avail.
Does anyone know how to get 5.1 working sor a series 1 tivo.

What is the sample rate of DD in dtv stream and what codec is used.

pjo1966
03-03-2007, 10:41 PM
I'm trying to convert .avi into .ty. I used the following line...


ffmpeg -i <show>.avi -acode ac3 -ab 384 -b 3000 -vcodec
> > mpeg2video <show>.ty

... and got the following result...


Unable for find a suitable output format for '-b'

Any help would be greatly appreciated.

labbie48
03-04-2007, 12:17 AM
-b 3000 should be -b 3000k and all should run fine....

pjo1966
03-04-2007, 02:29 AM
-b 3000 should be -b 3000k and all should run fine....

I made that change and still got the same error message.

drez
03-04-2007, 02:58 AM
-vcodec should be before -b

pjo1966
03-04-2007, 01:24 PM
-vcodec should be before -b


I made that change as well... now I get "unknown codec -b"

This is the updated code I'm using:

ffmpeg -i SNL.avi -acodec ac3 -ab 384 -vcodec –b 3000k mpeg2video SNL.ty

BTUxNine
03-04-2007, 03:28 PM
the "-vcodec mpeg2video" is a unit... don't separate them

pjo1966
03-04-2007, 03:32 PM
the "-vcodec mpeg2video" is a unit... don't separate them

OK... that looks like this:

ffmpeg -i SNL.avi -acodec ac3 -ab 384 –vcodec mpeg2video 3000k –b SNL.ty

and gives me:

Unable for find a suitable output format for '-vcodec'

bcc
03-04-2007, 03:46 PM
OK... that looks like this:

ffmpeg -i SNL.avi -acodec ac3 -ab 384 –vcodec mpeg2video 3000k –b SNL.ty

and gives me:

Unable for find a suitable output format for '-vcodec'In the above, you've mangled the order of the arguments again (check your -b argument), and also the hyphen before vcodec is not a single character. Recommend you start over and type it so as to not introduce so many cut&paste problems.

pjo1966
03-04-2007, 08:58 PM
Bingo:

ffmpeg -i SNL.avi -acodec ac3 -ab 384 -vcodec mpeg2video -b 3000k SNL.ty

Thanks for the help.

pjo1966
03-06-2007, 10:29 PM
OK... I'm back with another question. It looks like when I converted this 16:9 file it output it as 4:3. Is there a way to fix this?

helpdeskdan
03-08-2007, 09:03 PM
I am also curious about the proper ratio if anybody has figured it out. Also, anybody had any luck converting .m4v's?

nova1
03-08-2007, 09:42 PM
There is an option, -aspect, to specify the ratio.

helpdeskdan
03-08-2007, 11:29 PM
m4v - you have to install libfaad and recompile it with --enable-faad.

I should clarify my other question, I was wondering if anybody came up for a better fix for the picture size issue. Raymond Day was talking about it back on Page 14: (omit -ss and -t stuff)
ffmpeg -i "file.avi" -vcodec mpeg2video -b 3000k -s 420x420 -padtop 30 -padbottom 30 -padleft 30 -padright 30 -ss 167 -t 170 -acodec mp2 -ab 192 "file-420x420-pad30.ty"

So, this is good, now I can download nbc news off the net and, instead of watching it immediately on my high resolution monitor, I can wait an hour while I convert and transfer it to my tivo so I can watch it on my crappy television.... wait, now, why did I want to be able to do this?

helpdeskdan
03-08-2007, 11:44 PM
Retracted question

helpdeskdan
03-11-2007, 01:11 PM
What would be nice is to get a correctly sized 352x480 including 30 padding on each side. Emphasis on "correctly sized." I'll keep playing with it.

pjo1966
03-11-2007, 02:18 PM
For me, I just switched the output format on my HD TiVo and it filled the screen perfectly. It was originally a 16:9 show, so that's a workable solution for me.

helpdeskdan
03-11-2007, 03:55 PM
Thank you for your reply - unfortunately, I only have a series 1 though. FYI, on the series 1, you can use a -b 2000 and see little difference with a good deal of space savings. (maybe even less) Perhaps this is because I have one of those old televisions that technically qualifies as a piece of wooden furniture.

danpritts
03-13-2007, 02:50 PM
What would be nice is to get a correctly sized 352x480 including 30 padding on each side. Emphasis on "correctly sized." I'll keep playing with it.

a standard-def display is 640x480 square pixels.

352x480 uses wide pixels (each one is 640/352 as wide as it is tall)

so if you want 30 *displayed* pixels padding you'll have to divide by 640/352
(multiply by 352 and divide by 640). Which by my math means 16.5 pixels.
Try that with left and right padding.

size=320x420
padtop/padbottom=30
padright/padleft=16

If i understand what you want correctly, this should give it to you.

vnino
03-20-2007, 10:51 AM
Update: Problem solved by remuxing with the right settings in Videoredo.


I have been trying to use tyffmpeg to convert .ts clips to .ty for my HR10-250. I ran into the "non monotone timestamps" error on all my test clips, so now I have demuxed with DGIndex, but now I have the following error:


C:\>ffmpeg -i fire0.ac3 -i fire0.m2v -acodec copy -vcodec copy fire0.ty
FFmpeg version SVN-r6543, Copyright (c) 2000-2006 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --dis
able-ffplay --disable-ffserver
libavutil version: 49.0.1
libavcodec version: 51.16.0
libavformat version: 50.5.0
built on Oct 6 2006 00:36:08, gcc: 3.4.4 (cygming special) (gdc 0.12, using d
md 0.125)
Input #0, ac3, from 'fire0.ac3':
Duration: 00:01:17.7, start: 0.000000, bitrate: 383 kb/s
Stream #0.0: Audio: ac3, 48000 Hz, mono, 384 kb/s
Input #1, mpegvideo, from 'fire0.m2v':
Duration: 00:00:20.2, start: 0.000000, bitrate: 38837 kb/s
Stream #1.0: Video: mpeg2video, yuv420p, 1920x1080, 38810 kb/s, 29.97 fps(r)
Output #0, ty, to 'fire0.ty':
Stream #0.0: Video: mpeg2video, yuv420p, 1920x1080, q=2-31, 38810 kb/s, 29.97
fps(c)
Stream #0.1: Audio: ac3, 48000 Hz, mono, 384 kb/s
Stream mapping:
Stream #1.0 -> #0.0
Stream #0.0 -> #0.1
Press [q] to stop encoding
[ty @ 0x6fd594]seq_pos=0 gop_pos=-1 pic_pos=100assertion "gop_pos != -1" failed:
file "ty-enc.c", line 274
212 [sig] ffmpeg 2152 open_stackdumpfile: Dumping stack trace to ffmpeg.exe.
stackdump

Raymond Day
04-02-2007, 12:45 PM
Why do I get that error? nanVue will all so do a Failed.

I have Vista now so I thought that my be way. But I tested it out out a computer with Windows XP. Same error. I guess it's the video file. I used VirtualDub to copy a VHS video I like to save on TiVo.

Any one else get this error? If so how do you fix it?

mikey
04-13-2007, 09:58 PM
Is anyone else having a problem with 1.6 crashing? I don't even get an error message. 1.5 works fine.
Note 1.6 runs fine on 1 XP pro install, but will close with the non-informative message ffmpeg.exe has encountered a problem and needs to close. Microsoft does however direct me to cygwin for a update. I haven't tried it yet.
thanks,
Mikey

am2006
04-16-2007, 10:06 PM
Does anyone know where I can get a mac OS X binary version of ty ffmpeg? I tried building my own and have had problems... it builds fine, it converts the files without errors, I'm able to upload them to my Tivo using mfs_ftp but-- when I watch the video it reboots my tivo! I've been able to convert the files using my PC and I'm using the exact same parameters...

If there are no OS X binaries available, could someone give me pointers on how to configure the build for macs?

lart2150
05-07-2007, 01:33 AM
Does anyone know where I can get a mac OS X binary version of ty ffmpeg? I tried building my own and have had problems... it builds fine, it converts the files without errors, I'm able to upload them to my Tivo using mfs_ftp but-- when I watch the video it reboots my tivo! I've been able to convert the files using my PC and I'm using the exact same parameters...

If there are no OS X binaries available, could someone give me pointers on how to configure the build for macs?
I have not looked at the source for the patch at all but there might be a problem with "little endian" vs "big endian". Do you have a new x86 mac or ppc?

blahboo
05-07-2007, 04:07 AM
Just wanted to see if anyone has come up with a better method of getting ffmpeg to come up with HD quality video from XVID or Divx files? Here is the line of code I have tried using and it's pretty grainy material I'm getting on my HD set. BTW I'm sending this to a hr10-250


ffmpeg -i the.sopranos.604.hdtv-lol.avi -acodec ac3 -ab 384 -b 65000 -s 1280x720 -aspect 16:9 -vcodec mpeg2video sopranos0604.ty

nova1
05-07-2007, 10:07 AM
Try adding a unit specifier to the bitrate option(i.e. -b 6500k).

blahboo
05-08-2007, 05:52 PM
That's exactly what I did and it now works perfectly. Thank you all for your help.

blahboo
05-09-2007, 12:02 AM
Don't know if this will help anyone but here is a little batch file I created to help me with ffmpeg instead of typing out the entire syntax everytime. Here is what this batch will do:

I created a folder on my called ffmpeg to this folder I move all of my .avi files (DivX, Xvid, blah blah blah). Well I put this batch file in that folder and load up all the files that I want to convert to watch on my TV. Then I double click on the batch file and it will re-encode all of the files to Tivo ready files and move them over to my MovieLoader directory so that they can then be uploaded to Tivo. Let me know if this helps anyone. Thanks

blahboo
06-21-2007, 12:28 AM
Anyone bother to help me with this? I'm trying to convert .vob files to .ty and reencode them using ffmpeg with this command.


FOR %%1 IN (*.vob) DO ffmpeg -i "%%1" -acodec ac3^
-ab 384 -b 6500k -s 1360x768 -aspect 16:9^
-vcodec mpeg2video "c:\movieloader\videos\%%1.ty"

Here is a screen print of what it says when I do this command to a vob; it says that the audio is being encoded in mono? How do I change this?

pahunt
07-03-2007, 09:03 AM
Anyone bother to help me with this? I'm trying to convert .vob files to .ty and reencode them using ffmpeg with this command.


FOR %%1 IN (*.vob) DO ffmpeg -i "%%1" -acodec ac3^
-ab 384 -b 6500k -s 1360x768 -aspect 16:9^
-vcodec mpeg2video "c:\movieloader\videos\%%1.ty"

Here is a screen print of what it says when I do this command to a vob; it says that the audio is being encoded in mono? How do I change this?

Try adding -ac 2 to the command line to tell ffmpeg to use 2 audio channels

sethjvm
07-11-2007, 04:08 PM
Here's a little dos script that batch encodes multiple videos sequentially. I remember seeing some similar scripts in the tivoserver thread, but IIRC, they all required the file path/filename as an argument, which is tedius if your converting 50 movies. This one runs without arguments... just season to taste.

edit: Added a second version that supports avi's, mpg's, and vob's in the same source folder, and encode each type with different options. It also allows you to stop/interrupt the encoding process, and remember which file you left off on when you run it again.

I am trying my best to get your tyffmpeg2 to work for me. Here are the modification that I made.


::Ty Enabled ffmpeg batch encoder
@echo on

:: SET SOURCE PATH HERE
@set sourcepath=C:\Documents and Settings\sethjvm\My Documents\My Videos

:: SET DESTINATION PATH HERE
@set destpath=C:\Documents and Settings\sethjvm\My Documents\My Videos

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

for %%x in (%sourcepath%\*.avi) do (
IF NOT EXIST "%destpath%\%%~nx.ty" ffmpeg -i "%sourcepath%\%%~nx.avi" -ab 384 -b 3000 -aspect 16:9 "%destpath%\%%~nx.ty"
)

for %%x in (%sourcepath%\*.vob) do (
IF NOT EXIST "%destpath%\%%~nx.ty" ffmpeg -i "%sourcepath%\%%~nx.vob" -acodec copy -vcodec copy "%destpath%\%%~nx.ty"
)

for %%x in (%sourcepath%\*.mpg) do (
IF NOT EXIST "%destpath%\%%~nx.ty" ffmpeg -i "%sourcepath%\%%~nx.mpg" -acodec copy -vcodec copy "%destpath%\%%~nx.ty"
)

I have a file called "The Prestige.avi" in the source directory. I think that either the directory path length or the spaces are causing problems because I get the following when I run the file.


C:\Program Files\ffmpeg>(IF NOT EXIST "C:\Documents and Settings\sethjvm\M
y Documents\My Videos\My.ty" ffmpeg -i "C:\Documents and Settings\sethjvm\
My Documents\My Videos\My.mpg" -acodec copy -vcodec copy "C:\Documents and Setti
ngs\sethjvm\My Documents\My Videos\My.ty" )
FFmpeg version SVN-r7329, Copyright (c) 2000-2006 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --dis
able-ffplay --disable-ffserver --enable-avisynth
libavutil version: 49.1.0
libavcodec version: 51.27.0
libavformat version: 51.6.0
built on Dec 18 2006 02:07:43, gcc: 4.1.1 (Indiana University ConceptGCC alpha
4)
C:\Documents and Settings\sethjvm\My Documents\My Videos\My.mpg: I/O error
occured
Usually that means that input file is truncated and/or corrupted.

C:\Program Files\ffmpeg>(IF NOT EXIST "C:\Documents and Settings\sethjvm\M
y Documents\My Videos\My.ty" ffmpeg -i "C:\Documents and Settings\sethjvm\
My Documents\My Videos\My.mpg" -acodec copy -vcodec copy "C:\Documents and Setti
ngs\sethjvm\My Documents\My Videos\My.ty" )
FFmpeg version SVN-r7329, Copyright (c) 2000-2006 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-a52 --disable-v4l --disable-dv1394 --dis
able-ffplay --disable-ffserver --enable-avisynth
libavutil version: 49.1.0
libavcodec version: 51.27.0
libavformat version: 51.6.0
built on Dec 18 2006 02:07:43, gcc: 4.1.1 (Indiana University ConceptGCC alpha
4)
C:\Documents and Settings\sethjvm\My Documents\My Videos\My.mpg: I/O error
occured
Usually that means that input file is truncated and/or corrupted.

Any suggestions?

rbautch
07-11-2007, 10:11 PM
Put the videos in a directory path does not contain spaces.

twostop
07-28-2007, 03:35 AM
One of the things my wife has wanted to do for years, since her first S1 Tivo 8 years ago, is the ability to cut out a clip from a program (say a funny SNL skit, for instance - hey, it happens) and then leave just that clip on the Now Showing list, under its own name (and even beter would be under folders, but that's just icing on the cake).

So I have read threads here for hours and hours, days and days. I saw that there was chunkedit.tcl but it's not exactly what we want (because we want new clip from the original program, without modifying the original program recording) and it seems a bit difficult to use.

So, after all my reading, here's what I think is the accepted method for what I want to do:

1. Grab the video off the Tivo (HDVR2 Dtivo, hacked with superpatch) using tserver/Tytools (or mfs_ftp)

2. Edit the .ty file with Tytools GOP editor

3. Use Tytools to create a MPG

4. Use ffmpeg to create a .ty+ file from the MPG (requires creating XML for the clip)

5. Push the resulting .ty+ file back to the Tivo with mfs_ftp

Is that really the best way? It's amazing that, after all these years, this isn't something a regular user can do right from the Tivo UI, using the remote (i.e. as a built in feature of Tivo).

I used the command: ffmpeg -i input.mpg -acodec copy -vcodec copy clip.ty

Where input.mpg was created with Tytools from a .ty file pulled off the Tivo, and ffmpeg spewed a ton of processing errors, and the resulting clip.ty file, when played on the Tivo had a lot of digital artifacts (similar to when the it rains hard). Before I spend time going through these steps for a bunch of clips, I thought I'd see if I was on the right track. It seems like some wasted steps in there, particulary going from .ty to MPG and back to .ty again. Is there a .ty to .ty editor that could grab a clip from one .ty file, and output a new .ty file with just that clip?

Roger Dylan
07-28-2007, 04:58 AM
I saw that there was chunkedit.tcl but it's not exactly what we want (because we want new clip from the original program, without modifying the original program recording) and it seems a bit difficult to use.Saving the original is not a problem; think it out.

It is, even today, a good approach to your specific need, but it takes some effort to set up a working environment that makes it routine.

Maybe just dump to mpeg (a dozen ways), edit the mpeg (a dozen dozen ways), then tivoserver?

mikey
07-28-2007, 07:19 AM
run the mpg through videoredo use the quickstreamfix. them use tyffmpeg. ty should play fine.
mikey