如何判断是否使用ffmpeg或ffprobe设置了视频的快速启动 [英] How to tell if faststart for video is set using ffmpeg or ffprobe

查看:86
本文介绍了如何判断是否使用ffmpeg或ffprobe设置了视频的快速启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法弄清楚如何确定MP4视频上是否设置了快速启动.

I am having trouble figuring out how to determine if faststart is set on an MP4 video.

我了解"moov atom"是需要位于文件开头才能启用快速启动的数据,而不是位于文件末尾的数据.

I understand that "moov atom" is the data that needs to be located at the beginning of the file for faststart to be enabled, instead of at the end of the file.

我特别想使用ffmpeg或ffprobe来确定它是否已移到开头.

I specifically want to use ffmpeg or ffprobe to determine if it has been moved to the beginning or not already.

从侧面看,我知道我可以运行以下命令将其从头到尾移动(但我想知道它是否已经存在):

On a side note, I understand I can run the following command to move it from the end to the beginning (but I want to find out if it is already there):

ffmpeg -i infile.mp4 -map 0 -c:v copy -c:a copy -c:s copy -c:d copy -c:t copy -movflags +faststart outfile.mp4

推荐答案

运行

ffmpeg -v trace -i file.mp4 2>& 1 |grep -e类型:'mdat'-e类型:'moov'

这将产生类似的输出,

[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000036ca40]类型:'mdat'父级:'root'sz:62740 48 65044[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000036ca40]类型:'moov'父级:'root'sz:2264 62788 65044

由于moov出现在第二个位置,因此在此示例中位于结尾.

Since moov appears second, it is at the end in this example.

在类似bash的外壳上,转义单引号:

On bash-like shells, escape the single quotes:

ffmpeg -v trace -i file.mp4 2>& 1 |grep -e类型:\'mdat \'-e类型:\'moov \'

对于Windows,可以使用findstr,

For Windows, findstr can be used,

ffmpeg -v trace -i file.mp4 2>& 1 |findstr/l类型:'moov'类型:'mdat'"

这篇关于如何判断是否使用ffmpeg或ffprobe设置了视频的快速启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆