Libswscale is a library for image/video scaling and colorspace/pixelformat conversion routines.
Questions tagged [swscale]
39 questions
6
votes
0 answers
swscaler@0dd9e620: deprecated pixel format used, make sure you did set range correctly"
I am decoding RTSP video stream with FFMpeg.
At display time (call to cv::imshow(...)), I get the following exception:
[swscaler @ 0d55e5c0] deprecated pixel format used, make sure you did
set range correctly
I am converting the pixel format…

Tariq
- 2,274
- 4
- 24
- 40
4
votes
2 answers
sws_scale, YUV to RGB conversion
I need convert YUV to RGB. I also need the RGB values to be in the limited range (16-235).
I try to use sws_scale function for this task.
My code you can see below. But after conversion I got the black pixel is (0, 0, 0) instead of (16, 16,…

Валентин Никин
- 357
- 2
- 11
3
votes
0 answers
FFMpeg libswscale XBGR32 to NV12 almost working but colors are wrong
I am getting a Linx DMA-BUF from the GPU in XBGR32 format and I need to use FFMpeg's libswscale to convert it on the ARM to NV12.
I've been able to almost get it working based on various SO posts and the documentation.
Here is the LCD screen that is…

PhilBot
- 748
- 18
- 85
- 173
3
votes
2 answers
Pixel format conversion issue [FFMPEG]
I wrote a small program using ffmpeg's libraries. which does the following-
1)decode a frame.
2)convert frame to rgb24 .
3)convert rgb24 frame back to yuv420p.
4)encode the yuv420p frame and pack it into video file.
But the end video is not same as…

gaurav
- 365
- 5
- 14
2
votes
2 answers
Why does ffmpeg output slightly different RGB values when converting to gbrp and rgb24?
By using one the following command-lines, it is possible to convert a video stream to an RGB buffer:
ffmpeg -i video.mp4 -frames 1 -color_range pc -f rawvideo -pix_fmt rgb24 output.rgb24
ffmpeg -i video.mp4 -frames 1 -color_range pc -f rawvideo…

F.X.
- 6,809
- 3
- 49
- 71
2
votes
2 answers
Using swscale for image composing
I have an input image A and a resulting image B with the size 800x600 stored in YUV420 format and I need to scale image A into 100x100 size and place it into resulting image B at some point (x=100, y=100). To decrease memory and CPU usage I put…

armigero
- 73
- 6
2
votes
0 answers
FFMPEG (swscale) - Is it possible to set the conversion coefficients?
Im using sws_scale function to convert from YUVA420P to RGBA in my c++ program.
It seems that alpha passed "straight" and does not effect the RGB channels but I do want to pre-multiply alpha.
Is it possible with swscale to set the conversion matrix…

aviyaChe
- 145
- 1
- 9
2
votes
1 answer
AVFrame has a negative linesize
I am using libav (2.7 built for MSVC) to open a camera using dshow:
input_format = av_find_input_format("dshow");
avformat_open_input(format_context, "video=Integrated Camera", input_format, 0);
When I open the video stream it is "raw video"…

Chris
- 574
- 7
- 24
2
votes
0 answers
ffmpeg record change color
Im try record video from screen, for write to video file im use ffmpeg(libavcodec). But on result i see other colors, my example:
AVCodec *codec;
AVCodecContext *c= NULL;
AVStream *video_stream;
AVOutputFormat *out;
AVFormatContext *out_context;
int…

Антон Михайлов
- 55
- 9
2
votes
1 answer
FFMpeg RGB32 to NV12 using SWScale
I'm trying to convert RGB32 frames to NV12 Frames to feed into an encoder.
m_iWidthIn = 1920;
m_iHeightIn = 1080;
m_iWidthOut = (((iWidthIn + 31) >> 5) << 5) //32bit align
m_heightOut = (((iHeightIn + 31) >> 5) << 5) //32bit…

KevinA
- 619
- 6
- 25
1
vote
0 answers
Error when passing the scaled frame to the encoder `Encoder did not produce proper pts, making some up`
When I am passing the scaled frame to the encoder, I keep getting the error from the container mp4 code. The sws context is defined as:
encoder->sws_ctx = sws_getContext(1920, 1080,
AV_PIX_FMT_YUV420P,
…

lokit khemka
- 349
- 3
- 11
1
vote
1 answer
"sws_scale_frame" function not found in libswscale/swscale.h
I am trying to scale a video from 1080p to 480p. However, whenever I am calling sws_scale_frame() function, I keep getting undefined reference. When I checked the header file, I found that the function signature is missing from the header file. I…

lokit khemka
- 349
- 3
- 11
1
vote
1 answer
Turn off sw_scale conversion to planar YUV 32 byte alignment requirements
I am experiencing artifacts on the right edge of scaled and converted images when converting into planar YUV pixel formats with sw_scale. I am reasonably sure (although I can not find it anywhere in the documentation) that this is because sw_scale…

flansel
- 35
- 4
1
vote
1 answer
FFMPEG convert NV12 format to NV12 with the same height and width
I want to use FFmpeg4.2.2 to convert the input NV12 format to output NV12 format with the same height and width. I used sws_scale conversion, but the output frame's colors are all green.
P.S. It seems no need to use swscale to get the same…

Chun Wang
- 19
- 2
1
vote
1 answer
How does FFMPEG 4.4 convert NV12 format to YUV420 on Windows?
I want to use FFmpeg to convert the input NV12 format to YUV420P.
I tried to use sws_scale conversion, but the colors are all green.
I have successfully converted YUYV422 to 420P using sws, but FAILED to convert NV12 to YUV420.
What should I…

NecroDriver
- 13
- 1
- 4