leandromoreira / ffmpeg-libav-tutorial

FFmpeg libav tutorial - learn how media works from basic to transmuxing, transcoding and more. Translations: πŸ‡ΊπŸ‡Έ πŸ‡¨πŸ‡³ πŸ‡°πŸ‡· πŸ‡ͺπŸ‡Έ πŸ‡»πŸ‡³ πŸ‡§πŸ‡·
https://github.com/leandromoreira/ffmpeg-libav-tutorial
BSD 3-Clause "New" or "Revised" License
9.93k stars 956 forks source link

How to work with rgb values instead of grayscale #103

Closed MurageKibicho closed 2 years ago

MurageKibicho commented 3 years ago

Hello, thank you so much. I love this tutorial. This may be really dumb but I got stuck trying to work with RGB values instead of a grayscale image. My question is, how can I call sws_scale within the decode_packet function. This is what I tried but it does not work. Thank you for your time.

sws_scale(sws_ctx,(unsigned char const * const *)(frame->data),(frame->linesize),
            0,codecContext->height,pFrameRGB->data,pFrameRGB->linesize);