digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   FFMPEG: Letterboxing with ffmpeg (aspect ratio) (http://www.digitalfaq.com/archives/encode/5928-ffmpeg-letterboxing-ffmpeg.html)

el_mozo 10-02-2003 04:55 AM

Letterboxing with ffmpeg (aspect ratio)
 
Anyone was succesful transcoding a 16:9 file to a 4:3 *VCD using ffmpeg? By defaults it creates a very stretched image (it doesn't keep the aspect ratio). I would like to add black borders on top and bottom, but looks like I can't (you can't use negative -crop values like in transcode to add black borders).

Maybe there is some option / way to do it with ffmpeg that I couldn't find?

I think ffmpegX for mac/osx does it, does anyone know how?

Cheers

Razorblade2000 10-02-2003 08:19 AM

Uhhhmm... this is funny too...
He actually DOES add black borders...
I think he writes sth in the mpeg header...
If you use mplayer in Fullscreen, these black bars disappear somehow... but in windowed mode, they are there...

(I used the "-aspect" parameter)

el_mozo 10-02-2003 08:48 AM

Quote:

He actually DOES add black borders...
He?? Who is he?? :lol: Do you mean ffmpeg or ffmpegX?

Quote:

If you use mplayer in Fullscreen, these black bars disappear somehow... but in windowed mode, they are there...

(I used the "-aspect" parameter)
So, could you paste here the complete ffmpeg command you used? I can't get the correct ratio on the output..

Thisi is what I used:
Code:

ffmpeg  -i /downloads/dvd/movie/file-1-1.vob -s 352x288 -r 25  -ac 2 -ar 44100 -ab 128  -b 890 -minrate 300 -maxrate 2500 -aspect 4:3  -g 18  -pass 1 movie-1-2.mpg

Razorblade2000 10-02-2003 08:53 AM

he= ffmpeg

I think you were using -aspect the wrong way...

I used e.g.
blablabla -aspect 1.85

(blablabla=kwags encoding tip)


so for 4:3 this would be:
-aspect 1,3333

but maybe this is all nonsense :D :wink: :lol:

el_mozo 10-02-2003 09:13 AM

But, the aspect ratio for VCD has to be 4:3, hasn't it?

Anyway, I can't test it until I get home, but, do you get black borders (I mean new black borders, which weren't on the original file) using that aspect ratio?

Cheers

Razorblade2000 10-02-2003 10:48 AM

uhhhmmm... maybe...
but as a kvcd-user I don't care much about standards
*g*

Black Borders ARE displayed... but NOT in fullscreen...

EDIT:
Damn... somehow the borders arent displayed on my standalone...
I have to switch manually to 16:9

Razorblade2000 10-05-2003 07:26 AM

anything new???
still won't work fine...

el_mozo 10-05-2003 05:36 PM

I gave up :cry:

I couldn't see any difference on the output files, using "-aspect 4:3", "-aspect 1.333", "-aspect 1,333", "-aspect 16:9", "-aspect 1.777" or "-aspect 1,777". Always the same stretched output.

What version of ffmpeg are you guys using? Do you get good (not stretched) output while encoding 16:9 vobs (from DVD) to VCD, or KVCD?

Maybe we'll have to wait for a new ffmpeg version...

kwag 10-05-2003 06:06 PM

I always get the full Anamorhpic output ( or the same aspect of my input ). No way to control it :!:
I'm with you mozo. I'll just keep checking every new version every now and then.

-kwag

japie 10-06-2003 03:34 AM

ffmpeg doesn't add black borders, youll need another utilty to do that job. Maybe there's a way to insert something with the -vhook but I have no idea how. (maybe for subs too)
This is the main reason why I'am using a chain like:
Code:

mkfifo -m 660 stream.yuv
mkfifo -m 660 resized_stream.yuv
mplayer -benchmark -noframedrop -nosound -vo yuv4mpeg -osdlevel 0 $1 &
cat stream.yuv | yuvscaler -v 0 -M WIDE2STD -O SIZE_352x288 -n p > resized_stream.yuv &
ffmpeg -f yuv4mpegpipe -i resized_stream.yuv -an (+ options)...

encode audio seperatly and mux...

Razorblade2000 10-06-2003 04:10 PM

do these commands create new files???
or just a kind of frameserving?

japie 10-06-2003 11:17 PM

Quote:

Originally Posted by Razorblade2000
do these commands create new files???
or just a kind of frameserving?

It's frameserving (or piping).

Razorblade2000 10-12-2003 08:44 AM

could you please tell me what each command does? got a lil curious... *g*

Would the mplayer command include postprocessing? 8O

japie 10-12-2003 10:52 AM

Code:

mkfifo -m 660 stream.yuv
mplayer -noframedrop -nosound -vop scale=352:240 -vo yuv4mpeg -osdlevel  $1 &
ffmpeg -f yuv4mpegpipe -i stream.yuv -an (+ options)...

First we create the pipe:
mkfifo -m 660 stream.yuv
After that we start mplayer to "fill" the stream with raw yuv images; -vo yuv4mpeg, it will serve frame for frame as fast as it's read from the pipe.
-vop scale does the scaling, you can use any mplayer filter in this.
The ffmpeg line explains itself, it only differs from direct encoding that we have to tell it to use a yuvstream: -f yuv4mpegpipe -i streamname

Razorblade2000 10-13-2003 01:50 PM

Hmmmm... I somehow can't get any results... always an error :-(
I guess i'll give mencoder a try... should be the same results as ffmpeg...

japie 10-14-2003 12:38 PM

Currently I'am testing a rework of my mkxvcd script using transcode to add direct dvd ripping (for backup purposes off-course)
I make an post if suxsesfull.

Razorblade2000 10-14-2003 03:53 PM

You should really take a look at this:
http://www.kvcd.net/forum/viewtopic.php?t=6822
sooooo many nice options!


All times are GMT -5. The time now is 06:36 PM  —  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.