简体   繁体   English

FFMPEG 为直播 h264 降低 fps stream 直接复制

[英]FFMPEG reduce fps for live h264 stream with direct copy

I found different articles on changing the fps with ffmpeg but none of them is matching for my exact purposes.我发现了有关使用 ffmpeg 更改 fps 的不同文章,但没有一篇文章与我的确切目的相匹配。

There is an ffmpeg command like below:有一个 ffmpeg 命令,如下所示:

ffmpeg -i RTSPCAMERAPRODUCEH264 -c:v copy -an -movflags +frag_keyframe+empty_moov -f mp4

This will remux my camerastream to fragmented mp4 perfectly.这将完美地将我的相机流重新混合为碎片化的 mp4。

Is there a way to force ffmpeg to lower the FPS to save bandwidth?有没有办法强制 ffmpeg 降低 FPS 以节省带宽?

Ie camera streams 30fps, it needs 1Mbps for fmp4 (sample numbers:):即相机流30fps,它需要1Mbps的fmp4(样本数:):

I'd like to know if it's possible to lower the FPS and get an output stream for which 500kbps (50% of original is enough) without re-encoding.我想知道是否有可能降低 FPS 并获得 output stream 500kbps(原始的 50% 就足够了)而无需重新编码。

ffmpeg -r 1 -i RTSPCAMERAPRODUCEH264 -c:v copy -an -movflags +frag_keyframe+empty_moov -f mp4

and

ffmpeg -i RTSPCAMERAPRODUCEH264 -c:v copy -an -movflags +frag_keyframe+empty_moov -r 1 -f mp4

do not seem to work.似乎不起作用。

A temporally coded video stream (like one with H264 codec) cannot arbitrarily drop intermediate packets, so this is not possible.时间编码的视频 stream (就像具有 H264 编解码器的视频)不能任意丢弃中间数据包,因此这是不可能的。 Only whole or trailing part of GOPs may be dropped.只能删除 GOP 的全部或尾随部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM