digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   FFMPEG: Some encoding tips (http://www.digitalfaq.com/archives/encode/5507-ffmpeg-encoding-tips.html)

kwag 09-10-2003 02:50 PM

FFMPEG: Some encoding tips
 
This is what I'm currently testing, and it seems it's working correctly. It also plays in ALL my standalone players.
I encode like this:

Code:

ffmpeg -i YourInputFile.(VOB,AVI,etc)  -s 352x240 -r 23.976  -ac 2 -ar 44100 -ab 112  -b YourAverageBitrate  -minrate 300 -maxrate 2500  -g 18 -bf 1 -pass 1 YourOutputFile.mpg
Then for the second pass, change the -pass 1 to -pass 2

After you have encoded your file, demux with TMPEG, and remux with BBMpeg as MPEG-1. Not as VCD :!:
Like this:

http://www.digitalfaq.com/archives/error.gif

This way, you get zero mux errors.
So far, I've encoded several ~10 minute clips, and they all play fine. Other than a slight "greenish" color on the picture, everything else seems correct.
Tested on Macintosh and Windows.
Same results on both platforms.

-kwag

Garedryl 09-10-2003 05:30 PM

And how about a mpeg-2 multiplex???

My Philips can play all the resolutions but for resolution up to 352x288 they have to be multiplexed as SVCD (not VCD). I still encode in mpeg-1 not mpeg-2

kwag 09-10-2003 06:12 PM

Quote:

Originally Posted by Garedryl
And how about a mpeg-2 multiplex???

Just tried it. Had to mux as MPEG-2. Not as SVCD. At least in WMP, it plays correctly when muxed as MPEG-2.

-kwag

Razorblade2000 09-11-2003 08:21 AM

hmmm... funnny:

ffmpeg -i '/windows/H/rip/119/VTS_01_1.VOB' -s 352x288 -b 795 -minrate 300 -maxrate 2500 -g 18 -bf 1 '/windows/E/11sept.mpg' -an
Input #0, mpeg, from '/windows/H/rip/119/VTS_01_1.VOB':
Duration: 00:50:42.2, bitrate: 13827 kb/s
Stream #0.0: Video: mpeg2video, 720x576, 25.00 fps, 8300 kb/s
Stream #0.1: Audio: 0x0000
Stream #0.2: Audio: 0x0000
Stream #0.3: Audio: 0x0000
Stream #0.4: Audio: 0x0000
Stream #0.5: Audio: 0x0000
Output #0, mpeg, to '/windows/E/11sept.mpg':
Stream #0.0: Video: mpeg1video, 352x288, 25.00 fps, q=2-31, 795 kb/s
Stream #0.1: Audio: mp2, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.5 -> #0.1
Error while opening codec for stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height






OR:



ffmpeg -i '/windows/H/rip/119/VTS_01_1.VOB' -an -s 352x288 -b 795 -minrate 300 -maxrate 2500 -g 18 -bf 1 '/windows/E/11sept.mpg'
Input #0, mpeg, from '/windows/H/rip/119/VTS_01_1.VOB':
Duration: 00:50:42.2, bitrate: 13827 kb/s
Stream #0.0: Video: mpeg2video, 720x576, 25.00 fps, 8300 kb/s
Stream #0.1: Audio: 0x0000
Stream #0.2: Audio: 0x0000
Stream #0.3: Audio: 0x0000
Stream #0.4: Audio: 0x0000
Stream #0.5: Audio: 0x0000
File '/windows/E/11sept.mpg' already exists. Overwrite ? [y/N] y
Output #0, mpeg, to '/windows/E/11sept.mpg':
Stream #0.0: Video: mpeg1video, 352x288, 25.00 fps, q=2-31, 795 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Gleitkomma-Ausnahme

Dialhot 09-11-2003 08:32 AM

I have that also, it's important to have the parameters in a certain order. Here, the "-an" must be before the name of the output to be taken in account.

Same if you do "-s 352x288 -i nameofthesource" the output won't be in 352x288 but in the source res :!:

Razorblade2000 09-11-2003 08:43 AM

the 2nd time i did:
"ffmpeg -i '/windows/H/rip/119/VTS_01_1.VOB' -an"... 8O

Dialhot 09-11-2003 08:55 AM

And it didn't work ?
You reported the error only in the first case, so I thought everything was correct with the second one.

Razorblade2000 09-11-2003 01:17 PM

the 2nd one was : "Gleitkomma-Ausnahme"
--> something to do with an floatcomma ... (dont really know how to translate this...)

kwag 09-11-2003 01:21 PM

Quote:

Originally Posted by Dialhot

Same if you do "-s 352x288 -i nameofthesource" the output won't be in 352x288 but in the source res :!:

-s MUST be after -i
Everything before -i is assumed as input.
[options] -i [options] output

-kwag

Razorblade2000 09-13-2003 06:55 AM

ok... i got it... I didn't compile with ac3 support... now it works...

btw:

no -hq in your commandline???

Razorblade2000 09-14-2003 11:26 AM

funny... after muxing as MPEG2 he gives me a much too big size in nero!

maybe because of the "Pack options" value 2048?

I think I'll try muxing as an svcd...

EDIT:
2 audio streams + muxed as svcd and workes like a charm :-D (mux rate = 0)

totonho03 09-15-2003 12:04 AM

Hello:

I just finished encoding vob 1 of Sleeping Beauty, with the following results:

1.- The audio resulted in Spanish. Is there a way to choose the audio languaje? Can it handle 2 languajes?
2.- When I tried to run -pass 2, which is the only thing I changed on the script, it gave me the following error message:
Code:

statistics are damaged at line 37361, parser out=0
Error while opening codec for stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

Am doing something wrong?
3.- I see pixelation in scenes where there is no movement: blue sky, clouds, etc.
4.- It took about 20 minutes to encode 1.048 Gigas, and I just lost the file while trying to run -pass 2. As I mentioned earlier, the only thing I changed was the following: "-pass 1" for "-pass 2" and somehow the first mpg file is now reading 0 Gb. Perhaps I did something wrong......

Thanks for your help.

Totonho03

kwag 09-15-2003 12:38 AM

Hi Otto,

I've experienced the same thing here. The only way around it, has been to edit the .log file that ffmpeg produces, by deleting lines at the end of the log file and saving the log again. I can't see any errors on the log, but after I delete 4 or 5 lines (from the end), then I can start my encode again with the "-pass 2" and it continues without errors.


-kwag

Razorblade2000 09-15-2003 06:47 AM

He once gave me a "Error while opening codec for stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height"...try compiling with ac3 support:
http://www.kvcd.net/forum/viewtopic.php?t=6208


select language:
http://www.kvcd.net/forum/viewtopic.php?t=6209

:D :D

only 18 threads so far... 2 of em marked with a [FAQ] in the topic... :wink:
and 1 with a [QUESTION] about 2 audio streams :D :lol:

Razorblade2000 10-05-2003 06:42 AM

How about a -bf 2 and a -g 25 (for PAL) ???
Works fine for me with the newest CVS of ffmpeg...
:D
this would be closer to the original kvcd


All times are GMT -5. The time now is 11:11 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.