开发者

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

开发者 https://www.devze.com 2023-03-22 09:36 出处:网络
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 pl

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 -qscal开发者_JAVA技巧e 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!


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.


Stop using WMV

The forword looking video codecs to use would be ones that also work with HTML5 video. Currently this is

  • Ogg Theora
  • H.264
  • VP8 (WebM)

As far as browsers go

  • Mozilla Firefox has built in support for Ogg Theora and WebM
  • Google Chrome has built in support for all 3, H.264 will be removed some time in the future
  • Internet Explorer 9.0 has built in support for H.264

H.264 has been the best choice because of its good balance between encoding time, file size, and quality. However it is burdened by a restrictive license, which is why Google is planning to drop it in favor of WebM. Despite this I would still say using a H.264/HTML5/Adobe Flash platform would be the best option.

0

精彩评论

暂无评论...
验证码 换一张
取 消