FFMPEG resize video not working in browser or IOS

匿名 (未验证) 提交于 2019-12-03 08:59:04

问题:

I have tried to compress video using FFMPEG command and it's compress properly but I couldn't see in browser as like original video.

I have used below all command but didn't success.

ffmpeg -i /var/www/html/test.mp4 -c:v copy -bsf:v h264_mp4toannexb -an /var/www/html/test123.mp4

ffmpeg -i /var/www/html/test.mp4 -s 640x480 -c:v copy -bsf:v h264_mp4toannexb -an /var/www/html/test123.mp4

ffmpeg -i /var/www/html/test.mp4 -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis /var/www/html/test111.mp4

ffmpeg -i /var/www/html/test.mp4 -s 720x960 -b:v 120k -vcodec mpeg1video -acodec copy /var/www/html/test112.mov

ffmpeg -i INPUT -attach /var/www/html/test.mp4 -metadata:s:2 mimetype=application/x-truetype-font /var/www/html/test2.mp4

ffmpeg -y -i "/var/www/html/test.mp4" -c:v libx264 -preset slow -pix_fmt yuv420p -c:a libvo_aacenc -b:a 128k "/var/www/html/test2222.mp4"

ffmpeg -y -i "/var/www/html/test.mp4" -ar 22050 -ab 512 -b 700k -f mp4 -s 514*362 -strict -2 -c:a aac "/var/www/html/test2222222.mp4"

ffmpeg -i /var/www/html/test.mp4 -c copy -movflags +faststart /var/www/html/test222.mp4

ffmpeg -i /var/www/html/test.mp4 -c copy -movflags +faststart /var/www/html/test222.mp4

ffmpeg -i /var/www/html/test.mp4 -s 720x480 -c:a copy /var/www/html/test22.mp4

ffmpeg video compressed but not playing in browser

ffmpeg -i /var/www/html/test.mp4 -c:v libx264 /var/www/html/test111.mp4

ffmpeg -i /var/www/html/test.mp4 -r 60 -s hd720 /var/www/html/test111.mp4

Do you have any Idea? How to compress video as like Original with work in All browser?

回答1:

try something like:

./ffmpeg -y -i /var/www/html/test.mp4 -s 1280x720 -c:v libx264 -b 3M -strict -2 -movflags faststart /var/www/html/testOBM.mp4 

The above will give you a 1280x720 output, at 3Mbps using h264 in an mp4 container, and will then do a second pass to move the moov element to the front of the file enabling it to start streaming faster (see this answer for some more detail).

You may want to adjust the framesize and bitrate depending on quality and connection speed you want to support



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!