[FFmpeg-user] bgra to yuv

Paul B Mahol onemda at gmail.com
Tue Mar 27 04:29:13 CEST 2012

On 3/27/12, Josh long <funkyirish at gmail.com> wrote:
>> Converting from one colorspace to another one may not be lossless.
>> So if you do not want distortions at all only colorspace conversions which
>> are
>> actually lossless should be used.
>> Aah, I've realized that ffmpeg first converts to yuv420 and then employs
> the libschroedinger codec.  For some reason I've been under the impression
> that yuv444p and bgra are lossless equivalents, so now I use the following
> code:

libschroedinger encoder in FFmpeg supports only yuv420p, yuv422p and yuv444p.

If your input is not one of this above you can not expect encoding to be

> #include<stdio.h>
> #include<stdlib.h>
> #include<string.h>
> main(){
>   char out[120];
>   int a;
>   for(a=0;a<25;a++){
>   sprintf(out,"ffmpeg -i 0libschbgra%d.avi -vcodec rawvideo -pix_fmt
> yuv444p -q 0 -global_quality 0 0libsch444%d.avi\n",a,a);
>   system(out);
>   sprintf(out,"ffmpeg -i 0libsch444%d.avi -vcodec libschroedinger -q 0
> -global_quality 0 0libsch%d.avi\n",a,a);
>   system(out);
>   sprintf(out,"ffmpeg -i 0libsch%d.avi -vcodec rawvideo -pix_fmt bgra -q 0
> 0libschbgra%d.avi\n",a,a+1);
>   system(out);
>   }
> }
> This ends up in garbage as well so I'm going to try to convert to yuv444p
> once and then stay there;  I'll post that when it finishes.  However I've
> noticed that after converting from bgra to yuv444p my video is all
> grayscale and split into 9 sections  which consist of 3 seemingly repeated
> columns of three different rows.  Is this a bug in vlc, or am I just doing
> this wrong?
> Thanks for the help again, I think this is getting closer.
> I'm also going to try converting to yuva444p, and then yuv444p in case that
> works better.
> Joshua
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

More information about the ffmpeg-user mailing list