-
Notifications
You must be signed in to change notification settings - Fork 417
Closed
Description
In the remuxing documentation example packets are used and skipped if no dts is available in the packet. Is it possible to create an output with the same number of frames as the input using the decode to frame method?
This produces a different size output file much smaller (50%) from the input.
fps = src_stream.average_rate
codec_name = src_stream.codec_context.name
out_stream = ovideo_container.add_stream(codec_name, rate=fps)
out_stream.width = src_stream.codec_context.width # Set frame width to be the same as the width of the input stream
out_stream.height = src_stream.codec_context.height # Set frame height to be the same as the height of the input
out_stream.pix_fmt = src_stream.codec_context.pix_fmt
for frame container.decode(video=0):
.. other processing then
output_encoded = out_stream.encode(out_frame)
ovideo_container.mux(output_encoded)
Trying the following to set the parameters produces the following error.
out_stream = ovideo_container.add_stream(template=src_stream)
.
.
.
out_packet = out_stream.encode(out_frame)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "av/stream.pyx", line 153, in av.stream.Stream.encode
File "av/codec/context.pyx", line 490, in av.codec.context.CodecContext.encode
File "av/frame.pyx", line 52, in av.frame.Frame._rebase_time
Metadata
Metadata
Assignees
Labels
No labels