Log in

View Full Version : Video to Gif Error


jay123210599
12th January 2025, 01:14
Whenever I use ffmpeg to try to convert a yuv420p video to gif, I get this:

[swscaler @ 0000019797c785c0] [swscaler @ 00000197921477c0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 000001979215e7c0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 000001979216ef00] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 000001979217f600] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 000001979264be80] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792658e40] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792665e40] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792672e00] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792698500] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792d600c0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792d6d080] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792dfbbc0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792e12f80] No accelerated colorspace conversion found from yuv420p to bgr8.

How do I fix this?

Z2697
12th January 2025, 02:10
Contribute to FFmpeg.

jay123210599
12th January 2025, 02:26
Contribute to FFmpeg.

I'm serious.

huhn
12th January 2025, 02:50
there is no information to work with...
you try to use hardware acceleration which the api can't do.

Z2697
12th January 2025, 04:27
I'm serious.

I'm also serious.

Z2697
12th January 2025, 04:30
there is no information to work with...
you try to use hardware acceleration which the api can't do.

If you mean GPU acceleration that's not actually the case here.
I didn't look into the specific piece of code which triggered this warning but I think what it actually means is instruction sets optimization / acceleration.
The warning is because the optimization / acceleration is not implemented.

GeoffreyA
12th January 2025, 07:17
If you mean GPU acceleration that's not actually the case here.
I didn't look into the specific piece of code which triggered this warning but I think what it actually means is instruction sets optimization / acceleration.
The warning is because the optimization / acceleration is not implemented.

Yes. Probably, it's just the plain C code, and that specific path hasn't got an SIMD version.

GeoffreyA
12th January 2025, 07:18
Whenever I use ffmpeg to try to convert a yuv420p video to gif, I get this:

[swscaler @ 0000019797c785c0] [swscaler @ 00000197921477c0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 000001979215e7c0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 000001979216ef00] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 000001979217f600] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 000001979264be80] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792658e40] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792665e40] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792672e00] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792698500] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792d600c0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792d6d080] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792dfbbc0] No accelerated colorspace conversion found from yuv420p to bgr8.
[swscaler @ 0000019797c785c0] [swscaler @ 0000019792e12f80] No accelerated colorspace conversion found from yuv420p to bgr8.

How do I fix this?

Is the result all right?

jay123210599
12th January 2025, 13:10
Here's the command I used:
ffmpeg -i yuv_video.mkv output.gif

Here's the information of my video:
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High 4:4:4 Predictive@L4
Format settings : CABAC / 3 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 3 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 8 s 13 ms
Bit rate : 92.5 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (23976/1000) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 1.860
Stream size : 88.3 MiB (98%)
Writing library : x264 core 157 r2935M 545de2f
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=0 / threads=18 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc=cqp / mbtree=0 / qp=0
Default : No
Forced : No
Color range : Limited
Matrix coefficients : BT.709

GeoffreyA
12th January 2025, 14:00
Adding the accurate-rounding flags removes the warning.

-sws_flags accurate_rnd+full_chroma_int

As noted a couple of weeks ago, a palette can be used for better quality, but it takes more time.

https://forum.doom9.org/showthread.php?p=2011227#post2011227

ffmpeg -colorspace bt709 -i INPUT -vf palettegen -sws_flags accurate_rnd+full_chroma_int "palette.png"
ffmpeg -colorspace bt709 -i INPUT -i "palette.png" -lavfi paletteuse -sws_flags accurate_rnd+full_chroma_int "OUTPUT.gif"