【问题标题】:How to get frame information from fragmented mp4如何从碎片化的mp4中获取帧信息
【发布时间】:2021-02-28 15:20:28
【问题描述】:

我正在使用以下命令生成 fmp4 文件

ffmpeg -rtsp_transport tcp -i rtsp://someuser:somepassword@somedomain:someport/Streaming/Channels/101 -acodec copy -vcodec copy -hls_segment_type fmp4 -hls_time 2 -hls_list_size 10 -hls_flags delete_segments+append_list+split_by_time -hls_playlist_type event test.m3u8

我需要知道每个片段的确切持续时间和帧数。不幸的是 -vstats 似乎被忽略了。

我尝试使用

探测其中一个片段

ffprobe -show_frames ./test0.m4s

但我明白了

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb68e80b000] could not find corresponding track id 1 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb68e80b000] could not find corresponding trex (id 1) [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb68e80b000] could not find corresponding track id 0 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb68e80b000] trun track id unknown, no tfhd was found [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb68e80b000] error reading header ./test0.m4s: Invalid data found when processing input

我假设这是因为尚未加载初始化段,但我找不到这样做的选项。

如果我尝试用

探测初始化段

ffprobe -show_frames ./init.mp4

我没有得到帧信息和错误

Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 2560x1440): unspecified pixel format Consider increasing the value for the 'analyzeduration' and 'probesize' options

不胜感激。

【问题讨论】:

    标签: ffmpeg mp4 ffprobe fmp4


    【解决方案1】:

    我假设这是因为尚未加载初始化段

    正确。

    实现您需要的一种方法是将cat 初始化段和媒体段一起发送到ffprobe

    $ cat ./init.mp4 ./test0.m4s | ffprobe -show_frames -
    

    【讨论】:

    • 谢谢。只是要清楚,如果这是唯一的方法,那么就无法发现每个片段中的帧是什么,因为文件必须在处理之前连接在一起。
    • 我不太明白你在问什么,但是,再次查看 OP,片段的确切持续时间将在片段之前的 EXTINF 标记中发出信号。假设内容是固定帧率,你应该可以通过简单的除法来确定帧数。
    猜你喜欢
    • 2021-02-07
    • 2014-05-23
    • 2012-01-26
    • 1970-01-01
    • 2020-12-31
    • 2023-03-19
    • 1970-01-01
    • 1970-01-01
    • 2018-10-02
    相关资源
    最近更新 更多