gpt4 book ai didi

ffmpeg - 我可以使用 av_write_frame() 而不是 av_interleaved_write_frame() 吗?

转载 作者:行者123 更新时间:2023-12-04 22:46:06 26 4
gpt4 key购买 nike

我正在使用 ffmpeg 在 Windows 平台上编写一个 AV muxer DirectShow Filter,它将视频和音频流混合到 mp4/ts/flv 文件或 rtsp/rtmp/udp 流中,我确认视频/音频流的 dts是有序增加的,所以不需要 dts 重新排序,所以我可以使用 av_write_frame() 而不是 av_interleaved_write_frame() 吗? av_write_frame()直接将packet写入muxer,av_interleaved_write_frame()如果没有引用计数会复制packet,所以我更喜欢使用av_write_frame( ) 因为我认为它应该更有效率(没有复制或缓冲),我的想法是否正确?我可以使用 av_write_frame() 吗?

最佳答案

是的。作为documentation对于 av_write_frame() 状态:

This function passes the packet directly to the muxer, without any buffering or reordering. The caller is responsible for correctly interleaving the packets if the format requires it. Callers that want libavformat to handle the interleaving should call av_interleaved_write_frame() instead of this function.

关于ffmpeg - 我可以使用 av_write_frame() 而不是 av_interleaved_write_frame() 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54491521/

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