Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg - Convert MP4 to WebM, poor results

Tags:

ffmpeg

I am trying to encode a video to webm for playing through a HTML5 video tag. I have these settings...

ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:a 128k -b:v 1M -c:a libopus output.webm

The results aren't great, video has lost lot's of it's sharpness. Looking at the original file I can see the bitrate is 1694kb/s.

Are there any settings I can add or change to improve the output? Would maybe a 2 pass encode improve things?

like image 370
fightstarr20 Avatar asked Nov 27 '17 11:11

fightstarr20


People also ask

Does converting WebM to MP4 reduce quality?

Use WinX Video Converter WinX Video Converter is the optimal choice for you to convert WebM video files because it will not damage video quality after converting it to MP4. You don't have to worry about image quality loss. Besides, 47X real-time faster processing speed is one of its advantages as well.

How do I use FFmpeg without losing quality?

Instead of -sameq (removed by FFMpeg), use -qscale 0 : the file size will increase but it will preserve the quality.

Can you convert MP4 to WebM?

Go to Add Media > Add Video and select one or more MP4 files for conversion. Open the Video tab in the lower part of the app window, click WebM as your desired format. Click the Save to button and choose the destination folder for your output videos. When you're done, click Convert.

Does FFmpeg support WebM?

Because WebM is a well-defined format, FFmpeg automatically knows what video and audio it can support and will convert the streams to be a valid WebM file. may result in a file with the same codecs as input.


1 Answers

Try with

ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -b:a 128k -c:a libopus output.webm 

Adjust the CRF value till the quality/size tradeoff is ok. Lower values produce bigger but better files.

like image 54
Gyan Avatar answered Sep 28 '22 20:09

Gyan