BendyCindy
08/22/17 12:46AM
How does one convert files to WebM?
Namely GIFs and MP4s.
Miss_Vulf
08/22/17 01:23AM
you can upload mp4s directly and the site will automatically convert them to webm
bipface
08/22/17 01:24AM
use FFMpeg

ffmpeg.exe -i input.mp4 -c:v libvpx-vp9 -b:v 0 -crf 20 output.webm

trac.ffmpeg.org/wiki/Encode/VP9

to get ideal behaviour with GIF or APNG inputs there are some additional options i normally use, which i can tell you later if you want

-------

i tried uploading an MP4 directly​ once, but the results were terrible
SolemnTagger
08/22/17 05:33AM
I'd reccomend WinFF: www.biggmatt.com/winff/

It's basically an easy-to-use repackaging of FFmpeg, with a GUI and presets you can choose from. Just open it, drop in an MP4 or GIF, under "Convert to" select "Google" and then under "Preset" select "Google WEBM Generic Widescreen". This setting will work for pretty much any widescreen video, which most are nowadays...but if you have a 4:3 video you can select "Google WEBM Generic Fullscreen". Then just click convert and BAM...a high-quality WEBM. Easy.

bipface said:
i tried uploading an MP4 directly​ once, but the results were terrible

Yeah the site's converter is garbage, the video will be extremely blocky. Best to convert to WEBM on your own then upload the WEBM.
slayerduck
08/22/17 01:07PM
bipface said:
to get ideal behaviour with GIF or APNG inputs there are some additional options i normally use, which i can tell you later if you want


Share the juice with us

POST: rule34.xxx/index.php?page=post&s=view&id=2479395

CURRENT:
ffmpeg -i 9f4827c01daf6483bd51f19f1a51449d.video -b:v 1512K -vcodec libvpx -cpu-used 5 -threads 8 ./test.webm

Uses VP8, TIME: 0.8 seconds

time ffmpeg -i 9f4827c01daf6483bd51f19f1a51449d.video -c:v libvpx-vp9 -b:v 0 -crf 20 ./test2.webm

Uses VP9, TIME: 88 seconds

The VP9 one takes exactly 100 times longer, any way to fix this? It appears to be locked in single thread and that's an issue


bipface
08/22/17 01:32PM


slayerduck said:
bipface said:
to get ideal behaviour with GIF or APNG inputs there are some additional options i normally use, which i can tell you later if you want

Share the juice with us

ffmpeg -default_fps 60 -max_fps 60 -i "input.apng" -vsync cfr -r 60 -crf 20 -b:v 0 "output.webm"

• the "-r 60" flag sets the output frame rate (doesn't affect playback speed)

• the "-max_fps 60" flag affects the input decoder; very important because the
default maximum is lower than 60

• i've had a few cases where "-default_fps 60" was the only way to get correct results; can't remember the exact reason, but can't hurt to always include it

• if you don't specify "-vsync cfr", ffmpeg sometimes doesn't use the correct
delay on the last frame (pretty sure this is a bug)

---

if you know the exact (constant) framerate of the input you can simply use:

ffmpeg -r 60 -i "input.apng" -vsync cfr -r 60 -crf 20 -b:v 0 "output.webm"

replacing 60 with the actual framerate

---

for lossless compression you can replace "-crf 20 -b:v 0" with "-lossless 1"
1


Reply | Forum Index