[FFmpeg-user] How can I convert rbg to yuv420p loseless?

mokacao mokacao at gmail.com
Sun Aug 18 11:07:24 CEST 2013

I'm doing a convert picture to MP4 video, the original image is PIX_FMT_BGRA
format, now converted from RGB to YUV420P, I found many black spot around
the picture, the follow is part of the core code, please help me to how to
clear these black dots, or can tell me what information is missing, thank

libffmpeg::SwsContext* swsContext = libffmpeg::sws_getContext( srcW, srcH,
libffmpeg::PIX_FMT_BGRA,codecContext->width, codecContext->height,

libffmpeg::sws_scale( swsContext , srcData, srcLinesize, 0, frame->Height,
data->VideoFrame->data, data->VideoFrame->linesize );

original png file

yuv420p image file(scale and clip)

View this message in context: http://ffmpeg-users.933282.n4.nabble.com/How-can-I-convert-rbg-to-yuv420p-loseless-tp4660765.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.

More information about the ffmpeg-user mailing list