```py import av inp = av.open('f.mp3', 'r') out = av.open('f.ogg', 'w') ostream = out.add_stream('libopus') for frame in inp.decode(audio=0): for packet in ostream.encode(frame): out.mux(packet) out.close() ```