Hi! I am working on extending fobs4jmf (fobs.sf.net), a java wrapper around ffmpeg. The current problem is this:
Whenever I have audio tracks with more than two channels (for example, a 4 channel wav file), I am unable to give only 2 channels to java (as it needs to get only 2). request_channels is only advisory, as I read (http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2007-December/039192.html) and indeed, it does not work. The way ffplay does it, is to set channels to 4 in the wanted_spec struct, but SDL returns only 2 channels in its resulting spec struct, so effectively, SDL does the downmixing (or throwing away of excess channels). I don't really care whether excess channels are just thrown away or I get a real downmix, I just want to be able to play *some* sound. What's the programmatical way of doing this? Can I somehow manually only request the first two channels? Mplayer has the -af channels=2 function for this, which works as expected. libav's av_audio_resample_init tells me downmixing of more than 2 channels is unsupported (reproducible with using ffmpeg -ac 2 on a multichannel file). I am a newb in all of this, so please be patient and try to explain suggested code if you can! The current code can be found at http://www.orpheus.co.at/fobs/Decoder.cpp http://www.orpheus.co.at/fobs/Decoder.h Lines 333-420 are the interesting part. Any help is really appreciated, I've invested so much time for the accompanying processes that I really need to get this working. Please help! Thanks a lot in advance! th -- View this message in context: http://www.nabble.com/Preferred-method-of-downmixing-to-stereo-tp24292405p24292405.html Sent from the libav-users mailing list archive at Nabble.com. _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
