gpt4 book ai didi

ffmpeg在Video JS中重新编码手机上的mp4文件错误

转载 作者:行者123 更新时间:2023-12-04 23:24:33 26 4
gpt4 key购买 nike

我们正在使用 FFMPEG 将非常旧的 .flv 文件转换为 MP4。这些至少有 10 年的历史。
那时所有的都是用早期版本的 Adob​​e Premiere 渲染的。

在桌面浏览器上,所有文件都可以正常工作和流式传输(......看着它们感觉就像回到了一个世纪!)

但是,当在移动设备(android 和 ios)上请求同一页面上的视频时,Video JS 甚至不会出现。
也许编解码器太旧了,但我想知道用这一行转换它们时是否还有其他原因:

for i in *.flv; do ffmpeg -i "$i" "${i%.*}.mp4"; done

如果没有,是否可以在 Video JS 中检测到这一点,以便我们可以显示视频仅在桌面上可见的公告?

我希望这里有人有这方面的知识!

llogan 的要求添加
ffmpeg version N-78967-gbaec6d8 Copyright (c) 2000-2016 the FFmpeg developers   built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)   configuration: --prefix=/root/ffmpeg_build
--extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 libavutil 55. 19.100 / 55. 19.100 libavcodec 57. 28.100 / 57. 28.100 libavformat 57. 28.100 / 57. 28.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 39.102 /
6. 39.102 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a_4293_06.mp4': Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.28.100 Duration: 00:01:40.10, start: 0.023220, bitrate: 492 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 320x240, 376 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 123 kb/s (default)
Metadata:
handler_name : SoundHandler At least one output file must be specified

最佳答案

感谢 @llogan的评论我可以自己回答这个。

首先,我将ffmpeg升级到最新版本,然后研究了 -movflags +快速启动 .

我发现了一篇 2015 年的文章,其中包含有关如何将 .flv 转换为 .mp4 (https://addpipe.com/blog/flv-to-mp4/) 的大量信息

因此,为了使新的 .mp4 文件与移动设备兼容,您需要添加配置文件和级别,如下所示:

批量转换 :

for i in *.flv; do ffmpeg -y  -i "$i" -movflags +faststart -profile:v baseline -level 3.0 "${i%.*}.mp4"; done 

对于 单个文件 :
ffmpeg -i filename.flv -movflags +faststart -profile:v baseline -level 3.0 filename.mp4

然后终端在转换时显示这一行:

Starting second pass: moving the moov atom to the beginning of the file



这是必需的,但添加 -个人资料实际上使视频在移动设备上工作。

关于ffmpeg在Video JS中重新编码手机上的mp4文件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54120136/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com