Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th September 2024, 00:54   #1  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 177
AVC to Animated WEBP

How do I convert an AVC video to a lossless animated webp file, and make the output have the same colors as the input?

Video information:
Code:
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Format settings, Slice count             : 4 slices per frame
Codec ID                                 : V_MPEG4/ISO/AVC
Bit rate mode                            : Variable
Bit rate                                 : 21.6 Mb/s
Maximum bit rate                         : 39.0 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.435
Time code of first frame                 : 00:59:59:00
Stream size                              : 3.70 GiB (85%)
Language                                 : English
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray
jay123210599 is offline   Reply With Quote
Old 1st October 2024, 14:53   #2  |  Link
GeoffreyA
Registered User
 
Join Date: Jun 2024
Location: South Africa
Posts: 123
Give this a go and see if it works:

Code:
ffmpeg -i INPUT -c:v libwebp_anim -lossless 1 OUTPUT.webp
Here is the help from FFmpeg:

Code:
Encoder libwebp_anim [libwebp WebP image]:
    General capabilities: dr1 delay
    Threading capabilities: none
    Supported pixel formats: bgra yuv420p yuva420p
libwebp encoder AVOptions:
  -lossless          <int>        E..V....... Use lossless mode (from 0 to 1) (default 0)
  -preset            <int>        E..V....... Configuration preset (from -1 to 5) (default none)
     none            -1           E..V....... do not use a preset
     default         0            E..V....... default preset
     picture         1            E..V....... digital picture, like portrait, inner shot
     photo           2            E..V....... outdoor photograph, with natural lighting
     drawing         3            E..V....... hand or line drawing, with high-contrast details
     icon            4            E..V....... small-sized colorful images
     text            5            E..V....... text-like
  -cr_threshold      <int>        E..V....... Conditional replenishment threshold (from 0 to INT_MAX) (default 0)
  -cr_size           <int>        E..V....... Conditional replenishment block size (from 0 to 256) (default 16)
  -quality           <float>      E..V....... Quality (from 0 to 100) (default 75)
GeoffreyA is offline   Reply With Quote
Old 20th October 2024, 01:23   #3  |  Link
jay123210599
Registered User
 
Join Date: Apr 2024
Posts: 177
@GeoffreyA I got this:
Code:
[libwebp_anim @ 0000022da2913a40] Using libwebp for YUV-to-RGB conversion. You may want to consider passing in RGB instead for lossless encoding.
How do I remove this warning?
jay123210599 is offline   Reply With Quote
Old 20th October 2024, 07:04   #4  |  Link
Z2697
Registered User
 
Join Date: Aug 2024
Posts: 196
Quote:
Originally Posted by Z2697 View Post
If you want control over this conversion you can use -vf zscale=min=709[:d=ordered],format=gbrap
Dude...
Z2697 is offline   Reply With Quote
Old 20th October 2024, 07:51   #5  |  Link
GeoffreyA
Registered User
 
Join Date: Jun 2024
Location: South Africa
Posts: 123
Quote:
Originally Posted by jay123210599 View Post
@GeoffreyA I got this:
Code:
[libwebp_anim @ 0000022da2913a40] Using libwebp for YUV-to-RGB conversion. You may want to consider passing in RGB instead for lossless encoding.
How do I remove this warning?
Adding Z2697's suggestion eliminates the warning:

Code:
ffmpeg -i INPUT -vf zscale=min=709,format=gbrap -c:v libwebp_anim -lossless 1 OUTPUT.webp
Having said that, does the use case mandate WebP?

Last edited by GeoffreyA; 20th October 2024 at 10:22.
GeoffreyA is offline   Reply With Quote
Reply

Tags
h.264 encoder, h.264/avc, image-quality, webp

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:24.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.