[Ffmpeg-devel] -pad parameters

herve.flores herve.flores
Tue Jun 6 10:55:26 CEST 2006


Le 6 juin 06 ? 09:05, Luca Abeni a ?crit :

> Hi Herv?,
>
> On Sun, 2006-06-04 at 13:24 +0200, herve.flores wrote:
> [...]
>> 2nd, I'm on Mac 10.4.6 on PPC
> [...]
>> power-mac-g4-de-herve:~ herve$  ffmpeg -v 1 -i ~/test_pad.mp4 -s
>> 720x436 -padtop 70 -padbottom 70 -padcolor 000000 -r pal -f
>> image2pipe -vcodec ppm - | ffmpeg -v 1 -f image2pipe -vcodec ppm -i -
>> -y -f rawvideo -vcodec mpeg2video -target dvd -aspect 4:3 -an ~/
>> Desktop/output.m2v
>> FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
>>    configuration:  --enable-pthreads --enable-static --disable-shared
>> --enable-a52 --enable-x264 --enable-gpl --enable-amr_nb --enable-
>> amr_wb --enable-xvid --enable-mp3lame --enable-libogg --enable-libgsm
>> --enable-dts --enable-faac --disable-ffplay
>>    libavutil version: 49.0.0
>>    libavcodec version: 51.9.0
>>    libavformat version: 50.4.0
>>    built on Jun  4 2006 12:57:51, gcc: 4.0.1 (Apple Computer, Inc.
>> build 5341)
>> FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
>>    configuration:  --enable-pthreads --enable-static --disable-shared
>> --enable-a52 --enable-x264 --enable-gpl --enable-amr_nb --enable-
>> amr_wb --enable-xvid --enable-mp3lame --enable-libogg --enable-libgsm
>> --enable-dts --enable-faac --disable-ffplay
>>    libavutil version: 49.0.0
>>    libavcodec version: 51.9.0
>>    libavformat version: 50.4.0
>>    built on Jun  4 2006 12:57:51, gcc: 4.0.1 (Apple Computer, Inc.
>> build 5341)
>> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/herve/test_pad.mp4':
>>    Duration: 00:00:07.6, start: 0.000000, bitrate: 460 kb/s
>>    Stream #0.0(und), 25.00 fps(r): Video: mpeg4, yuv420p, 720x576
>>    Stream #0.1(und): Audio: mp4a / 0x6134706D, 48000 Hz, stereo
>> Output #0, image2pipe, to 'pipe:':
>>    Stream #0.0, 25.00 fps(c): Video: ppm, rgb24, 720x576, q=2-31, 200
>> kb/s
>> Stream mapping:
>>    Stream #0.0 -> #0.0
>> Press [q] to stop encoding
>> Input #0, image2pipe, from 'pipe:':ime=1.9 bitrate=248835.0kbits/s
>>    Duration: N/A, bitrate: N/A
>>    Stream #0.0, 25.00 fps(r): Video: ppm, rgb24, 720x576
>> Assuming PAL for target.
>> Output #0, dvd, to '/Users/herve/Desktop/output.m2v':
>>    Stream #0.0, 25.00 fps(c): Video: mpeg2video, yuv420p, 720x576,
>> q=2-31, 6000 kb/s
>> Stream mapping:
>>    Stream #0.0 -> #0.0
>> frame=  191 q=0.0 Lsize=  232068kB time=7.6 bitrate=248835.0kbits/s
>> video:232068kB audio:0kB global headers:0kB muxing overhead 0.000000%
>> frame=  191 q=2.0 Lsize=    1814kB time=7.6 bitrate=1955.3kbits/s
>> video:1752kB audio:0kB global headers:0kB muxing overhead 3.526752%
> I just tried, and I cannot reproduce the problem on x86. So, I  
> think it
> is an endianess problem.

thanks for your reply (I cannot try with other platforms, I don't  
know anybody that "can make a compile" on windows)

> My ibook is currently broken, so I cannot test on PPC.
>
I can reproduce the result at friends on Mac PPC (their own compile  
from svn)
this is not a problem ;-)

>> PS: with an output to yuv4mpegpipe or a direct encoding (no pipe)
>> there is no such pb (black remains black)
> I am just guessing, but I do not think the problem is the pipe. The
> problem seems to be that you are using ppm, which uses the rgb24 pixel
> format (if you use yuv4mpegpipe,
...yuv4mpegpipe has some endianness pb too (with non-monotone  
timestamps) ;-)
> you do not use rgb24). Maybe rgb24 is
> the problem... Is this pixel format endian-dependent?

sorry I'm not dev (just apprentice-dev ;-))
I don't manage to understand your code

> Herv?,, do you really need "-f image2pipe -vcodec ppm"? Can you try  
> "-f
> yuv4mpeg" instead? (if my guess is correct, this should fix the
> problem).

if I need ... yes :-(((
PS: this is not my whole command, just an simplified example just to  
highlight the problem
(but I can encode with different ways, using:
- ffmpeg-decoding without pad->ppm | ffmpeg-ppm->yuv4mpegpipe with  
pad | ? | ffmpeg encoding
- ffmpeg-decoding without pad->ppm | ppmtoy4m->yuv | yuvscaler for  
the add of black lines | ? | ffmpeg encoding
...there is a lot of "stupid soluces" that rocks ;-)
PS2: the black lines -> green lines is only for the add "-pad", the  
rest of the stream (the input video) keeps its good colors (maybe a  
lack of conversion of the hexa color -> RGB?)

> [...]
>> parameter "-pad..." cancels parameter "-aspect":
> Well, I do not know much about the "aspect" parameter... Anyway, I'll
> try to have a look
>
> [...]
>> The last strange thing is that with (-s 644x576 -padright 38 -padleft
>> 38) or (-s 520x576 -padright 100 -padleft 100) the resulting display
>> size is the same:
>> - real size        : 720*576
>> - display size : 1272*576px
> I just tried:
> ./ffmpeg -v 1 -i test_pad.mp4 -s 644x576 -padright 38 -padleft 38  - 
> padcolor 000000 -aspect 16:9 -r pal -vcodec mpeg2video -y test.m2v
> FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
>   configuration:  --disable-v4l2
>   libavutil version: 49.0.0
>   libavcodec version: 51.9.0
>   libavformat version: 50.4.0
>   built on Jun  6 2006 08:31:34, gcc: 4.0.4 20060507 (prerelease)  
> (Debian 4.0.3-3)
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_pad.mp4':
>   Duration: 00:00:07.6, start: 0.000000, bitrate: 460 kb/s
>   Stream #0.0(und), 25.00 fps(r): Video: mpeg4, yuv420p, 720x576
>   Stream #0.1(und): Audio: mp4a / 0x6134706D, 48000 Hz, stereo
> Output #0, mpeg2video, to 'test.m2v':
>   Stream #0.0, 25.00 fps(c): Video: mpeg2video, yuv420p, 720x576,  
> q=2-31, 200 kb/s
> Stream mapping:
>   Stream #0.0 -> #0.0
>
> ./ffmpeg -i test.m2v
> FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
>   configuration:  --disable-v4l2
>   libavutil version: 49.0.0
>   libavcodec version: 51.9.0
>   libavformat version: 50.4.0
>   built on Jun  6 2006 08:31:34, gcc: 4.0.4 20060507 (prerelease)  
> (Debian 4.0.3-3)
> Input #0, mpegvideo, from 'test.m2v':
>   Duration: 00:00:00.0, start: 0.000000, bitrate: 86816 kb/s
>   Stream #0.0, 25.00 fps(r): Video: mpeg2video, yuv420p, 720x576,  
> 104857 kb/s
>
> So, it looks correct (720x576).

yes, output size is correct, and display size is correct too with  
this source AND  "-pad 38" pixels (and there is the bit of "aspect  
16:9" into the output stream)
with the add of 2 pixels more ( -s 640x576 -padright 40 -padleft 40)  
the output size is always correct but the display size is incorrect  
(pad determine its own "non standard-aspect parameter" according to  
the number of pixels add?!?) (and with this command line, there isn't  
the bit of "aspect 16:9" into the output stream)
then display size is incorrect playing with VLC or mplayer

PS: an user on PC Linux said the same "loose of parameter - 
aspect" (the endianess pb seems to be just with pad and ppm)

>
>
> 				Luca
> -- 
> Proud to be "coglione"

bye

Herv?



More information about the ffmpeg-devel mailing list