[Libav-user] Help complete

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] Help complete

Slaus
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". So, I formulated an example where I try allocate AVFrame with 4 different ways (found those on internet here and there) each of which failing in different ways.
Could you please help me finish it: https://github.com/SlavMFM/libav_bmp_example
Thanks in advance ^^

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help complete

Carl Eugen Hoyos-2
Am Fr., 13. März 2020 um 14:04 Uhr schrieb Slav <[hidden email]>:
>
> 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
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Help complete

Slaus
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 <[hidden email]>:
> > 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
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> [hidden email] 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 ^^

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".