Can't set video stream time_base
Created by: hubeichenxing
Hi, i have try to set video stream time_base with code bellow:
output = av.open("out.mp4", 'w')
stream = output.add_stream('h264', 24)
stream.pix_fmt = 'yuv420p'
stream.height = im_height
stream.width = im_width
stream.time_base = Fraction(1, 24)
print(stream.time_base)
print(stream.codec_context.time_base)
The command line output:
None
1/24
It means that the stream.time_base
is not be assigned but stream.codec_context.time_base
get it.
I use the container output
to save a video, the time_base
of packets is 1/12288
or other number, not 1/24
.
I want to save a video that the time_base
of AVStream
set with me, how can i do ?