Closed i3587616 closed 2 years ago
i think should bitrate be assign can do.but how can i assign the bitrate value by pyav
self.stream.codec_context.bit_rate = 2150000 i use this to do it.
it is fault,this can not solve the problem
vbr is good idea ,but how can i let pyav do it
i am so sorry,my unstand is wrong.vbr is just add cloud.then video is vbr. and bitrate preset will affect.
hello: i build a class like import av import av.datasets class VideoWriter(): def init(self, fileStr, size, fps,codec):
self.fileStr = fileStr
my problem : i use this to write frames what i need to video .but the rsl video is different with inputvideo eg.inputvideo is avc 格式档次 : Main@L4.0 but outvideo is avc 格式档次 : High@L4.0 格式参数设置, CABAC : Yes and size is 10M and i use opencv VideoWrite.write ,then outvideo is avc Baseline@L4.1 and size is 100M
i find opencv VideoWrite ,its frame to image is more good than my class did my problem is how can i choose the 格式档次 main or high or Baseline
i try self.stream.profile = 'High' but failed: AttributeError: attribute 'profile' of 'av.codec.context.CodecContext' objects is not writable
i only need to write frame what i need to a video and hope the video image as the same with orivideo how can i do it with pyav