First, you need to configure the consumer with the desired number of output
channels you want, because the default is 2. In melted you do that with
something like "USET U0 consumer.channels=8" before starting the consumer
for playback. Why 8 instead of 6? See this
http://permalink.gmane.org/gmane.comp.video.mlt.devel/2346
Next, the avformat producer defaults to the first audio track. You can
change that on the producer by setting the property audio_index=N where N
is an integer value corresponding to the stream index reported by meta
properties in the XML output, -1 to say no audio, or the special value
"all" to ask to read all of the audio tracks and their channels. For your
case, you want "all" and in melted you do something like "USET U0
producer.audio_index=all" _before_ loading a clip. This will make melted
set that property on all producers you load until you change that value.
Lastly, you might need to remap the audio channels from input to output and
for that you use the "audiomap" filter:
https://www.mltframework.org/plugins/FilterAudiomap/
However, melted does not make it easy to add filters. I think if you need
to do this, you need to make a MLT XML wrapper for the clip wherein you
attach the filter. Then, you load the XML file in melted instead of the
clip directly. When making this XML file, you can also set the audio_index
instead of doing it through melted MVCP. You can use melt to generate the
XML:
melt -profile atsc_1080i_50 test_audio_3.mp4 audio_index=all -attach
audiomap 0=0 1=1 2=4 3=5 4=2 5=3 -consumer xml:test_audio_3.mlt
On Thu, Oct 20, 2016 at 10:24 AM David Alonso Grande <dalon...@gmail.com>
wrote:
> Hello,
>
> I am using melted as a playout server with outputs: a decklink monitor
> card and avformat udp ouput.
>
>
> I do not have any problems when my input clips have only one audio
> channel, but if they have more than one I only get the first audio channel
> in the output.
> Can anyone help me?
>
> I provide *details below:*
>
> melt -version
> melt 6.3.0
>
>
> *INPUT CLIP:* test_audio_3.mp4
>
> *INPUT CLIP DETAILS:*
>
> mlt@OVE-DAG:~/test_files$ cat test_audio_3_details.txt
> <?xml version="1.0"?>
> <mlt LC_NUMERIC="en_US.UTF-8" version="6.3.0" title="test_audio_3.mp4">
> <profile description="automatic" width="1920" height="1080"
> progressive="1" sample_aspect_num="1" sample_aspect_den="1"
> display_aspect_num="1920" display_aspect_den="1080" frame_rate_num="25"
> frame_rate_den="1" colorspace="709"/>
> <producer id="producer0" in="0" out="10136">
> <property name="length">10137</property>
> <property name="eof">pause</property>
> <property name="resource">./test_audio_3.mp4</property>
> <property name="meta.media.nb_streams">5</property>
> <property name="meta.media.0.stream.type">video</property>
> <property name="meta.media.0.stream.frame_rate">25</property>
> <property name="meta.media.0.stream.sample_aspect_ratio">0</property>
> <property name="meta.media.0.codec.width">1920</property>
> <property name="meta.media.0.codec.height">1080</property>
> <property name="meta.media.0.codec.rotate">0</property>
> <property name="meta.media.0.codec.frame_rate">25</property>
> <property name="meta.media.0.codec.pix_fmt">yuv420p</property>
> <property name="meta.media.0.codec.sample_aspect_ratio">1</property>
> <property name="meta.media.0.codec.colorspace">709</property>
> <property name="meta.media.0.codec.name">h264</property>
> <property name="meta.media.0.codec.long_name">H.264 / AVC / MPEG-4 AVC
> / MPEG-4 part 10</property>
> <property name="meta.media.0.codec.bit_rate">4704236</property>
> <property
> name="meta.attr.0.stream.handler_name.markup">VideoHandler</property>
> <property
> name="meta.attr.0.stream.timecode.markup">01:00:00:00</property>
> <property name="meta.media.1.stream.type">audio</property>
> <property name="meta.media.1.codec.sample_fmt">fltp</property>
> <property name="meta.media.1.codec.sample_rate">48000</property>
> <property name="meta.media.1.codec.channels">2</property>
> <property name="meta.media.1.codec.name">aac</property>
> <property name="meta.media.1.codec.long_name">AAC (Advanced Audio
> Coding)</property>
> <property name="meta.media.1.codec.bit_rate">192000</property>
> <property
> name="meta.attr.1.stream.handler_name.markup">SoundHandler</property>
> <property name="meta.media.2.stream.type">audio</property>
> <property name="meta.media.2.codec.sample_fmt">fltp</property>
> <property name="meta.media.2.codec.sample_rate">48000</property>
> <property name="meta.media.2.codec.channels">2</property>
> <property name="meta.media.2.codec.name">aac</property>
> <property name="meta.media.2.codec.long_name">AAC (Advanced Audio
> Coding)</property>
> <property name="meta.media.2.codec.bit_rate">192004</property>
> <property
> name="meta.attr.2.stream.handler_name.markup">SoundHandler</property>
> <property name="meta.media.3.stream.type">audio</property>
> <property name="meta.media.3.codec.sample_fmt">fltp</property>
> <property name="meta.media.3.codec.sample_rate">48000</property>
> <property name="meta.media.3.codec.channels">2</property>
> <property name="meta.media.3.codec.name">aac</property>
> <property name="meta.media.3.codec.long_name">AAC (Advanced Audio
> Coding)</property>
> <property name="meta.media.3.codec.bit_rate">192000</property>
> <property
> name="meta.attr.3.stream.handler_name.markup">SoundHandler</property>
> <property name="meta.attr.major_brand.markup">isom</property>
> <property name="meta.attr.minor_version.markup">512</property>
> <property
> name="meta.attr.compatible_brands.markup">isomiso2avc1mp41</property>
> <property name="meta.attr.encoder.markup">Lavf57.36.100</property>
> <property name="seekable">1</property>
> <property name="meta.media.sample_aspect_num">1</property>
> <property name="meta.media.sample_aspect_den">1</property>
> <property name="aspect_ratio">1</property>
> <property name="audio_index">1</property>
> <property name="video_index">0</property>
> <property name="mute_on_pause">1</property>
> <property name="mlt_service">avformat</property>
> </producer>
> <playlist id="playlist0">
> <entry producer="producer0" in="0" out="10136"/>
> </playlist>
> <tractor id="tractor0" title="test_audio_3.mp4" global_feed="1" in="0"
> out="10136">
> <track producer="playlist0"/>
> </tractor>
> </mlt>
>
> As you can see: there are three audio tracks in the input clip.
>
>
> *MELT COMMAND:*
>
> melt eof=loop -profile atsc_1080i_50 test_audio_3.mp4 -consumer
> avformat:udp://224.168.225.202:2002?pkt_size=1316\&reuse=1
> <http://224.168.225.202:2002?pkt_size=1316%5C&reuse=1> real_time=1
> terminate_on_pause=0 f=mpegts vcodec=mpeg2video vb=5M s=1280x720 acodec=mp2
> ab=256k
>
>
> This is the melt command I am using (the same in melted server) but in
> udp://224.168.225.202:2002 multicast address I only get the first audio
> track.
>
> Any help would be really appreciated.
>
> Regards,
>
> David
>
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Mlt-devel mailing list
> Mlt-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mlt-devel
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel