<div dir="ltr"><div class="gmail_quote">On Wed, Jun 6, 2012 at 9:12 AM, Carl Eugen Hoyos <span dir="ltr"><<a href="mailto:cehoyos@ag.or.at" target="_blank">cehoyos@ag.or.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sampath Subasinghe <susiriss@...> writes:<br>
<br>
>      I was wondering whether this is what you meant.<br>
<br>
This is broken (because odd width is not supported by<br>
yuv rawvideo):<br>
ffmpeg -i ref.ppm ref.yuv<br>
ffmpeg -s 45x32 -i ref.yuv ref2.ppm<br>
<br>
The following does work and produces the same black edge:<br>
$ ffmpeg -i out.ppm -pix_fmt yuv420p -strict experimental out.ljpg<br>
$ ffmpeg -i out.ljpg ref2.ppm<br>
<br>
Carl Eugen<br></blockquote><div><br>I am not using the latest build, but for me the round-trip worked without artifacts, see attached images and console output:<br><br><b>ffmpeg -i C:\Users\acohen\Downloads\ref.ppm  -pix_fmt yuv420p t.yuv<br>
</b><i>ffmpeg version N-35295-gb55dd10, Copyright (c) 2000-2011 the FFmpeg developers built on Nov 30 2011 00:58:17 with gcc 4.6.2<br>  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope<br>
ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-<br>
libxvid --enable-zlib</i><br><i>  libavutil    51. 29. 1 / 51. 29. 1<br>  libavcodec   53. 39. 1 / 53. 39. 1<br>  libavformat  53. 22. 0 / 53. 22. 0<br>  libavdevice  53.  4. 0 / 53.  4. 0<br>  libavfilter   2. 50. 0 /  2. 50. 0<br>
  libswscale    2.  1. 0 /  2.  1. 0<br>  libpostproc  51.  2. 0 / 51.  2. 0<br></i>Input #0, image2, from 'C:\Users\acohen\Downloads\ref.ppm':<br>  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A<br>    Stream #0:0: Video: ppm, rgb24, 45x32, 25 tbr, 25 tbn, 25 tbc<br>
w:45 h:32 pixfmt:rgb24 tb:1/1000000 sar:0/1 sws_param:<br>[buffersink @ 00000000003369B0] auto-inserting filter 'auto-inserted scale 0' between the filter 'src' and the filter 'out'<br>[scale @ 0000000000337C60] w:45 h:32 fmt:rgb24 -> w:45 h:32 fmt:yuv420p flags:0x4<br>
Output #0, rawvideo, to 't.yuv':<br>  Metadata:<br>    encoder         : Lavf53.22.0<br>    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 45x32, q=2-31, 20<br>0 kb/s, 90k tbn, 25 tbc<br>Stream mapping:<br>
  Stream #0:0 -> #0:0 (ppm -> rawvideo)<br>Press [q] to stop, [?] for help<br>frame=    1 fps=  0 q=0.0 Lsize=       2kB time=00:00:00.04 bitrate= 435.2kbits/s <br>video:2kB audio:0kB global headers:0kB muxing overhead 0.000000%<br>
<br><b>ffmpeg -pix_fmt yuv420p -s 45x32 -i t.yuv t.ppm</b><br><span style="color:rgb(204,153,51)">[rawvideo @ 000000000038D660] Estimating duration from bitrate, this may be inaccurate<br></span>Input #0, rawvideo, from 't.yuv':<br>
  Duration: N/A, start: 0.000000, bitrate: N/A<br>    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 45x32, 25 tbr, 25<br> tbn, 25 tbc<br><span style="color:rgb(255,204,51)">I<span style="color:rgb(204,153,51)">ncompatible pixel format 'yuv420p' for codec 'ppm', auto-selecting format 'rgb24'<br>
</span></span>[buffer @ 000000000038D5E0] w:45 h:32 pixfmt:yuv420p tb:1/1000000 sar:0/1 sws_param:<br>[buffersink @ 000000000038F490] auto-inserting filter 'auto-inserted scale 0' between the filter 'src' and the filter 'out'<br>
[scale @ 000000000038F6F0] w:45 h:32 fmt:yuv420p -> w:45 h:32 fmt:rgb24 flags:0x4<br>Output #0, image2, to 't.ppm':<br>  Metadata:<br>    encoder         : Lavf53.22.0<br>    Stream #0:0: Video: ppm, rgb24, 45x32, q=2-31, 200 kb/s, 90k tbn, 25 tbc<br>
Stream mapping:<br>  Stream #0:0 -> #0:0 (rawvideo -> ppm)<br>Press [q] to stop, [?] for help<br>frame=    1 fps=  0 q=0.0 Lsize=       0kB time=00:00:00.04 bitrate=   0.0kbits/s<br>video:4kB audio:0kB global headers:0kB muxing overhead -100.000000%<br>
</div></div></div>