You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
add_mux_stream does not work properly with matroska. #2198
Hello. Thank you for the update. I tried to use the add_mux_stream method from yesterday’s update, but I’m getting an error when muxing a Matroska (.mkv) container. Below is the test code.
importavimportnumpyasnpfromfractionsimportFractiontb=Fraction(1, 24)
cc=av.CodecContext.create("libx264", "w")
cc.width=1920cc.height=1080cc.time_base=tbcc.framerate=1/tbcc.pix_fmt="yuv420p"cc.bit_rate=6*1024*1024frame=av.VideoFrame.from_ndarray(np.zeros((1080, 1920, 3), dtype=np.uint8))
withav.open("test.mkv", "w") asc:
s=c.add_mux_stream("libx264", rate=24, width=640, height=640) # Since the shape can change, it doesn't matter...foriinrange(24):
frame.pts=iframe.time_base=tbforpincc.encode(frame):
p.stream=sc.mux(p)
forpincc.encode(None):
p.stream=sc.mux(p)
If you change add_mux_stream to add_stream or convert the MKV file to MP4, this code will work without any issues.
When muxing MP4 files, an error occurs if the width and height are missing, so I tried to include as much information as possible, but nothing seemed to work.
Activity
Extract codec extradata in add_mux_stream for Matroska
Extract codec extradata in add_mux_stream for Matroska
Extract codec extradata in add_mux_stream for Matroska
Extract codec extradata in add_mux_stream for Matroska
Extract codec extradata in add_mux_stream for Matroska
Extract codec extradata in add_mux_stream for Matroska
Extract codec extradata in add_mux_stream for Matroska
Extract codec extradata in add_mux_stream for Matroska
Extract codec extradata in add_mux_stream for Matroska