How do I remux to BytesIO? #861
Unanswered
simunovic-antonio
asked this question in
1. Help
Replies: 2 comments
-
No idea here, and since you're using a modified version of PyAV this feels out of scope.. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Using the official build produces the same results. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Overview
I'm trying to remux a RTSP H264 stream from IP camera to fragmented MP4 stream to use it in a live streaming WebSocket solution. On the client side is the MediaSource object. Having trouble getting the bytes result from the output buffer, where getvalue() call end with an empty bytes object for all non-keyframe packets.
Here is the code:
Here is the output:
Expected behavior
I expect that every call to getvalue() returns a non-empty bytes object.
Actual behavior
Only after muxing keyframe packet I will get non-empty result in call to BytesIO.getvalue().
Research
I have seen a perhaps similar question in Issue #524 with no answers.
I have tried building PyAv with change in the mux_one method of the OutputContainer class.
Change was in using av_write_frame function instead of av_interleaved_write_frame.
My understanding was that the later one caches packets due to the need to interleave packets from multiple streams, but the former one does not.
But the end result is the same, get_value returns non-empty result only on key-frame packets.
Beta Was this translation helpful? Give feedback.
All reactions