1

I'd like to change the codec ffmpeg inside MLT is using to decode the producer file from native opus to libopus.

The FFmpeg command should be like: ffmpeg -acodec libopus -i 851515232352539900.mkv....

How can I specify that codec via MLT XML? Using acodec doesn't seem to work:

<producer id="producer1">
    <property name="resource">test.mp4</property>
    <property name="aspect_ratio">1</property>
    <property name="mlt_service">avformat</property>
    <property name="acodec">libopus</property>
  </producer>

Thanks!

Konstantin
  • 11
  • 1

1 Answers1

0

You do not mention your MLT version. But if it is recent enough, you should be able to use "acodec" to specify a codec to use:

https://github.com/mltframework/mlt/blob/master/src/modules/avformat/producer_avformat.c#L2852

consider running

melt -query audio_codecs

to see if MLT is aware of libopus

Brian
  • 1,200
  • 6
  • 8
  • Thanks Brian! Indeed `acodec` works fine, but `libopus` is not listed in audio_codecs so it was probably ignored. Is there a way to add libopus to the MLT? It seems to be performing much better than native opus codec. – Konstantin Jun 24 '20 at 09:51
  • If libopus is supported by the installation of avcodec that MLT is linked against, then it will show up automatically. MLT itself does not require special installation instructions to use libopus through avcoded. – Brian Jun 25 '20 at 02:39