CasparCG / server

CasparCG Server is a Windows and Linux software used to play out professional graphics, audio and video to multiple outputs. It has been in 24/7 broadcast production since 2006. Ready-to-use downloads are available under the Releases tab https://casparcg.com.
GNU General Public License v3.0
904 stars 269 forks source link

MXF Multichannel Audio Routing #144

Closed premultiply closed 6 years ago

premultiply commented 11 years ago

I tried the new multichannel feature with some broadcast MXF files (XDCAM HD and AVC Intra 100). Most of these files have a channel layout of 8 x 1 (mono) channel. This should be mapped to the output channels 1 to 8 (in this case). The last build of 2.0.4 does only output 1 mono channel in that case. Normal MPEG2 clips with single stereo audio track are fine. The output channel configuration in my config file is set to "passthru".

When the mode in config file is set to "stereo" the first mono channel will output (copied) on channel 1 and 2.

Is this a internal problem or how can this be fixed by configuration options?

I can provide demo files for this but they are large...

premultiply commented 11 years ago

Here you can find the clip: http://ok54.df-kunde.de/TEST_XDCAM.mxf

hummelstrand commented 11 years ago

Thank you!

/ Jonas Hummelstrand +46-733-970000 http://about.me/hummelstrand

premultiply commented 11 years ago

Decklink Input also does not pass through all channels at the moment. Only channels 1 & 2 (stereo) walk trough.

yakatape commented 11 years ago

with the issue 61, ffmpeg producer only decode the first audio stream. So if you want to deal with several audio streams in HD using XDCAM, you need to re encode the file like this way : ffmpeg -i XDCAM.mxf -f mxf -map 0:0 -vcodec copy -filter_complex "[0:1] [0:2] [0:3] [0:4] amerge=inputs=4 [label_1]" -map [label_1]:0.1 -acodec pcm_s16le XDCAM_1StreamWith4stereo.mxf This is an example for 4 stereo audio stream, you can do the same think with 8 stream and 1 mono.

premultiply commented 11 years ago

Yes, but thats is no solution for generic automated control of CasparCG playout.

TomKaltz commented 10 years ago

@premultiply I believe this is solved via the new multi-channel audio handling. It may be a little complicated to set up but please check it out and let us know whether this issue can be closed. Thanks!

premultiply commented 10 years ago

I tried it now with the 2.0.7b1: No luck. No change in behavior. :-( Still only 1st mono channel is output on channel 1. all other channels are muted.

hummelstrand commented 10 years ago

Thanks for reporting. If you could provide a map of a standardized audio mapping for these kinds of files, it would become much easier to implement.

/ Jonas Hummelstrand +46-733-970000 http://about.me/hummelstrand

premultiply commented 10 years ago

Mmmh i do not think that there is something like a standard for it. SDI has 16 channels wich you can fill up and use.

But the internal mapping for CasparCG in theory is very simple: Take every audio input track and map each channel of each of the tracks to the first unused output channel. So first channel of first track will be output on channel 1 and you will have a as many output channels as channels are included in file in total. Just completely ignore the track layout and just count up the channels.

Very easy. It is the same way as every videoserver is inplemented.

elanvrt commented 10 years ago

Exactly my thought, premultiply. I also encounter many files, such as the ones produced by our EVS and AJA KiPro machines appear with multiple mono channels, rendering CasparCG useless for playback for just this reason it plays only the first of two or more mono sound tracks. I experimented with different sound channel settings in server 2.0.6 and 2.0.7, without any useful result.

yakatape commented 10 years ago

In Broadcast Industry, MXF SD format (like IMX50, DVC) use 1 single audio stream with 1 to 8 audio channels included (8 is the max allowed in one audio stream). For MXF HD Format (like XDCAMHD422, DVCPRO, AVC...) the standard configuration is one audio channel per audio stream. The SDI allow 16 audio channels so the common configuration is 16 audio streams of one mono audio channel. But you can find also MXF files with (for example) 4 streams and 2 channels or 1 stream of 2 channel and 1 stream with 6 channels,..., there is no fixed rules.

You can find a lot of samples here : http://opencubetech.com/page47/ http://hamburgpromedia.com/Testfiles/MXF_MPEG_Testfiles.php

TKooijmans commented 9 years ago

Anything new on this problem? We have also problems with MXF OP1a files rendered from Premiere CC2014. It would be very nice if we could fix this!

ronag commented 9 years ago

No one is working on this currently as far as I know and I don't currently know of any intentions of fixing it.

Workaround is to re-map the audio files using the ffmpeg tool. You can create a simple script which does it. It is very fast, basically just a file copy.

TKooijmans commented 9 years ago

Hi Robert, I tested the example script above and that worked. Do you have an example to do this from within Visual Studio (2010)?

ronag commented 9 years ago

What do you mean "do this from within visual studio"?

If you want it within casparcg done properly you would need to rewrite quite a bit of the code. The ffmpeg producer does kind of need a complete re-write anyway and fixing this would be included in that. However, somebody needs to do it or fund the work.

TKooijmans commented 9 years ago

Hi Robert, I mean a simple conversion tool with ffmpeg.exe or dll. I tested some scripting with ffmpeg.exe and that works so it would be nice to have a small program to point to a Adobe MXF file and automaticly copy the file in the right format to the casperCG directory.

keenanhuda commented 9 years ago

did anyone has solve this problems, we have the same problems with separating 2 mono channel mxf op1a build by mediacomposer using avid interplay transfer

jesperstarkar commented 8 years ago

This bug is alive and real. 1) A single stream/track with multiple channels gets mapped correctly and the channel_layout routing works as expected. 2) The problem is, like mentioned above, if you have multiple streams with just one mono channel in each, typical MXF wrappers of XDCam or similar broadcast standards.

premultiply commented 8 years ago

Maybe have a look at the code of the melted Playoutserver (part of MLT Framework). https://github.com/mltframework This audio mapping problem is solved there as expected: All input channels are mapped as output channels regardless of the input track one by one.

ronag commented 6 years ago

2.2