Topic: Any presets to port a mp4 video to webm?

Posted under General

I want to upload an animation and I am using Handbreak to port mp4 to webm, however, I don't know if anyone based on your advice has a default setting that can guarantee that the format will not be corrupted when uploaded to the web

I uploaded an animation before and it was removed due to poor compression quality-

You should use ffmpeg instead, even if more technical knowledge is required for it.

Each mp4 is obviously going to be different in terms of quality and which commands are better or worse for maintaining said quality, but my personal command for a simple convert to webm without too much thought is this:

ffmpeg -i videoname.mp4 -c:v libvpx-vp9 -crf 16 -b:v 0 -b:a 128k -c:a libopus videoname.webm

Adjust the crf between 0 and 51 if necessary, with lower numbers meaning higher quality and vice versa. However, lower numbers also means higher file sizes and e621 has a 100MB size limit.

SCTH

Member

Better to use two-pass. Also, depends whether it has audio.
That is, without audio:
ffmpeg -i videoname.mp4 -c:v libvpx-vp9 -crf 16 -b:v 0 -pass 1 -an -y NUL
ffmpeg -i videoname.mp4 -c:v libvpx-vp9 -crf 16 -b:v 0 -pass 2 -an videoname.webm
With audio, first command is the same, second command remove the -an and use -b:a 128k and -c:a libopus, as above.
CRF varies as WeRideAtDawn explained, but has to be the same in both commands.

scth said:
Better to use two-pass. Also, depends whether it has audio.
That is, without audio:
ffmpeg -i videoname.mp4 -c:v libvpx-vp9 -crf 16 -b:v 0 -pass 1 -an -y NUL
ffmpeg -i videoname.mp4 -c:v libvpx-vp9 -crf 16 -b:v 0 -pass 2 -an videoname.webm
With audio, first command is the same, second command remove the -an and use -b:a 128k and -c:a libopus, as above.
CRF varies as WeRideAtDawn explained, but has to be the same in both commands.

werideatdawn said:
You should use ffmpeg instead, even if more technical knowledge is required for it.

Each mp4 is obviously going to be different in terms of quality and which commands are better or worse for maintaining said quality, but my personal command for a simple convert to webm without too much thought is this:

Adjust the crf between 0 and 51 if necessary, with lower numbers meaning higher quality and vice versa. However, lower numbers also means higher file sizes and e621 has a 100MB size limit.

Well, thanks to you guys I learned two new things lol. I managed to transfer the video to webm

Gracias-

  • 1