I am trying to write Ogg Vorbis files with the following code:
output = av.open(str(outfile), "w")
out_stream = output.add_stream("libvorbis", rate=audio_stream.rate)
out_stream.options["global_quality"] = "9" # https://ffmpeg.org/ffmpeg-codecs.html#Options-21
for packet in container.demux(audio_stream):
for frame in packet.decode():
pkt = out_stream.encode(frame)
if pkt:
output.mux(pkt)
for pkt in out_stream.encode():
output.mux(pkt)
output.close()
Everything works, but I get an ogg vorbis file with bitrate ~112 kbps, definitely not q9. I also tried to add out_stream.qscale = True, but then the bitrate of the output file is ~ 65 kbps.
Is it a bug or I am doing something wrong? How do I set quality for libvorbis encoder?
I am trying to write Ogg Vorbis files with the following code:
Everything works, but I get an ogg vorbis file with bitrate ~112 kbps, definitely not q9. I also tried to add
out_stream.qscale = True, but then the bitrate of the output file is ~ 65 kbps.Is it a bug or I am doing something wrong? How do I set quality for libvorbis encoder?