Manuel Dahmen
2008-Feb-29 02:19 UTC
[theora] Poor encoding quality with etheora and aspect ratio problem
Hello, I wrote a theora video encoder based on etheora (and the examples provided with it) for Processing IDE (processing.org). I have some problem with the quality of encoded frames. eg. http://poux.be/tmp/movie.ogg And when I play the movie with mplayer or totem, the video resolution is changed from 640x480 to 854x480 (when i use ETHEORA_ASPECT_NORMAL in etheora_enc_setup). And if I try to encode in 1138x480 with ETHEORA_ASPECT_WIDE_SCREEN the width of the movie is doubled too. So I don't understand. I'd like to have the same resolution for encoding and for playing. eg. mplayer output: Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family [theora @ 0x892a230]Missing extradata! Could not open codec. VDecoder init failed :( Opening video decoder: [theora] Theora/VP3 VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12) VDec: using Planar YV12 as output csp (no 0) Movie-Aspect is 2.37:1 - prescaling to correct movie aspect. VO: [xv] 640x480 => 1138x480 Planar YV12 Selected video codec: [theora] vfm: theora (Theora (free, reworked VP3)) =========================================================================Audio: no sound I don"t understand why the movie is resized by the player. Thaks in advance for your help -- Manuel Dahmen
Ralph Giles
2008-Feb-29 09:55 UTC
[theora] Poor encoding quality with etheora and aspect ratio problem
On 29-Feb-08, at 2:19 AM, Manuel Dahmen wrote:> And when I play the movie with mplayer or totem, the video resolution > is changed from 640x480 to 854x480 (when i use > ETHEORA_ASPECT_NORMAL in etheora_enc_setup).This is a bug in etheora. It's passing the frame aspect ratio where libtheora expects the pixel aspect ratio, which is why it looks stretched. For 640x480 computer-sourced video like processing produces, the pixels are square anyway, but ETHEORA_ASPECT_PRESERVE is unfortunately also wrong (it sets a square frame aspect ratio). So you'll just have to wait until the bug is fixed. (if you want to hack it, change the default aspect_numerator and aspect_denominator in etheora.c to 1 and use ASPECT_PRESERVE.) -r