我使用FFMPEG到流式傳輸編碼的AAC數據的數據,我使用av_interleaved_write_frame返回0,但沒有寫入
av_interleaved_write_frame()
寫幀。
的返回值是0 ,它意味着成功作爲description。
Write a packet to an output media file ensuring correct interleaving.
The packet must contain one audio or video frame. If the packets are already correctly interleaved, the application should call av_write_frame() instead as it is slightly faster. It is also important to keep in mind that completely non-interleaved input will need huge amounts of memory to interleave with this, so it is preferable to interleave at the demuxer level.
Parameters
s media file handle
pkt The packet containing the data to be written. pkt->buf must be set to a valid AVBufferRef describing the packet data. Libavformat takes ownership of this reference and will unref it when it sees fit. The caller must not access the data through this reference after this function returns. This can be NULL (at any time, not just at the end), to flush the interleaving queues. Packet's stream_index field must be set to the index of the corresponding stream in s.streams. It is very strongly recommended that timing information (pts, dts duration) is set to correct values.
Returns
0 on success, a negative AVERROR on error.
但是,我發現沒有寫入數據。
我錯過了什麼?如何解決它?
謝謝。我使用av_write_frame而不是av_interleaved_write_frame,但是我得到崩潰錯誤:致命信號11(SIGSEGV)在0x00000000(代碼= 1),線程13608.我將調試它。如果你有一些關於它的例子,那將是完美的!再次感謝。 –