Search code examples
videoencodingffmpegvideo-processingvideo-encoding

Encoding parameters in videos for web (low in size) while keeping quality good enough?


I'm trying to build a video sharing platform much like youtube. So far everything is going great, but i'm having difficulties with my encoding parameters in ffmpeg. I'm using a silverlight media player so the output file must be in wmv format.

The only thing i can play freely was -qscale parameter and it gets shabby after 8. And i downloaded some youtube videos and they seem to keep amazing quality (definitely not -qscale 8 can achieve) with very low file sizes.

So what i'm asking is some patterns that can help me convert a video to high, mid and low quality wmv videos.

The codec i use right now is pretty simple and useless is like this; (oh btw audio must keep 128k or higher quality for mid and high)

   ffmpeg -i a1.wmv -vcodec wmv2 -qscale 2 -s 852x480 -acodec wmav2 -ar 44100 -ab 128k -y a480.wmv
   ffmpeg -i a1.wmv -vcodec wmv2 -qscale 4 -s 640x360 -acodec wmav2 -ar 44100 -ab 128k -y a360.wmv
   ffmpeg -i a1.wmv -vcodec wmv2 -qscale 6 -s 354x200 -acodec wmav2 -ar 44100 -ab 128k -y a200.wmv

the output quality i achieve with this command is more than enough but the sizes are usually 10 times larger than a youtube video near the same or less quality.

Thanks in advance!


Solution

  • Try setting the video bitrate parameter, you should not be manipulating the qscale unless you want same compression for all frames and this would give different bitrates for different videos(read as widely varying filesize for videos of the same duration). So,ideal bitrate would be 3 Mb/s for a 720X480 video(of moderate complexity) for wmv2.