[Libav-user] Help complete

Slaus slavmfm at gmail.com
Sat Mar 14 13:57:45 EET 2020


On Sat, 2020-03-14 at 12:04 +0100, Carl Eugen Hoyos wrote:
> Am Fr., 13. März 2020 um 14:04 Uhr schrieb Slav <slavmfm at gmail.com>:
> > Hello. I am trying to implement program which reads out plain
> > images
> > (ready for some further usage) from video files, but got issues
> > with
> > sws_scale() complaining about wrong AVFrame format:
> > "[swscaler @ 0x558ef00721a0] bad src image pointers".
> 
> Did you look at doc/examples/scaling_video.c ?
> 
> Carl Eugen
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/libav-user
> 
> To unsubscribe, visit link above, or email
> libav-user-request at ffmpeg.org with subject "unsubscribe".

Thank you for your answer. Was told on stackoverflow.com to properly
allocate frame this way:

AVFrame* frame = av_frame_alloc();
frame->format = whatever;
frame->width = w;
frame->height = h;
av_frame_get_buffer(frame, 32);

and also then discovered that I needed to read resulting (converted)
pixels from sws_scale() output as frame->data[0] instead of frame-
>data. Updated repo https://github.com/SlavMFM/libav_bmp_example if
somebody googles this post. Cheers ^^



More information about the Libav-user mailing list