HTML5网页上播放mp4失败的原因
这个不错:
https://blog.youkuaiyun.com/jacke121/article/details/84568802
解决方法1:
FFMPEG -i 3333.mp4 -c:v libx264 -strict -2 1111.mp4
mp4 convert
ffmpeg转:
https://github.com/wicak29/jarConv/blob/f809cb9a60e812c54a262ed579645f88eba4e2aa/vidConf.py
https://github.com/vblaker/My_Tutorials/blob/eb53c9ae7b93300febe0709aca070264e82b4d64/Tutorials/ConvertToMP4.py
https://blog.youkuaiyun.com/liwb1987/article/details/46877481
转载:https://jalena.bcsytv.com/archives/1202
http://ffmpeg.org/
现在Html5也逐渐普及了,设备对于mp4/webm/ogv的支持也逐渐广泛,但是Html5视频的转换软件却不是太多,这个Ffmpeg确实不错。而且功能也强大。
HTML5先网页直接打开mp4 如果打不开 先用格式工厂转化下格式 转成标准mp4 就行了
讯捷视频转换器也可以
查看原文:http://newmiracle.cn/?p=535
-
<pre name="code" class="plain">REM “H.264 / ACC”
-
"D:\Program Files\FFmpeg\bin\ffmpeg.exe" -y -i %1 -vcodec libx264 -vprofile high -preset slow -b:v 900k -maxrate 1200k -bufsize 1000k
-
-vf scale=trunc(oh*a/2)*2:480 -threads 0 -acodec libvo_aacenc -b:a 128k %1.mp4
-
REM “Standard” web video (480p at 500kbit/s):
-
"D:\Program Files\FFmpeg\bin\ffmpeg.exe" -i %1 -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k
-
-vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k %1_Standard.mp4
-
REM 360p video for older mobile phones (360p at 250kbit/s in baseline profile):
-
"D:\Program Files\FFmpeg\bin\ffmpeg.exe" -i %1 -vcodec libx264 -vprofile baseline -preset slow -b:v 250k -maxrate 250k -bufsize 500k
-
-vf scale=-1:360 -threads 0 -acodec libvo_aacenc -ab 96k %1_360p.mp4
-
REM 480p video for iPads and tablets (480p at 400kbit/s in main profile):
-
"D:\Program Files\FFmpeg\bin\ffmpeg.exe" -i %1 -vcodec libx264 -vprofile main -preset slow -b:v 400k -maxrate 400k -bufsize 800k
-
-vf scale=-1:480 -threads 0 -acodec libvo_aacenc -ab 128k %1_480p.mp4
-
REM High-quality SD video for archive/storage (PAL at 1Mbit/s in high profile):
-
"D:\Program Files\FFmpeg\bin\ffmpeg.exe" -i %1 -vcodec libx264 -vprofile high -preset slower -b:v 1000k -vf scale=-1:576 -threads 0
-
-acodec libvo_aacenc -ab 196k %1_High.mp4
-
REM webm (VP8 / Vorbis)
-
"D:\Program Files\FFmpeg\bin\ffmpeg.exe" -y -i %1 -vcodec libvpx -quality good -cpu-used 5 -b:v 700k -maxrate 700k -bufsize 1000k -qmin 10 -qmax 42
-
-vf scale=trunc(oh*a/2)*2:480 -threads 4 -acodec libvorbis -f webm %1.webm
-
REM ogv (Theora / Vorbis)
-
"D:\Program Files\FFmpeg\bin\ffmpeg.exe" -i %1 -b 1500k -vcodec libtheora -acodec libvorbis -ab 160000 -g 30 -s 640x360 %1.ogv
遍历目录下的所有mpg文件,挨个转换到该目录!
1 | for/r%1%%iin (*.mpg)do "D:\Program Files\FFmpeg\Convert.bat"%%i |
代码很简单,但是很实用,如果文件格式太乱,可以使用文件列表的形式来进行
1 | for/r%1%%iin (list.txt)do "D:\Program Files\FFmpeg\Convert.bat"%%i |
大概就这些了,更多方法可以查看FFmpeg的使用说明