No sound playing avi with 2 audio streams

For help and support with PS3 Media Server in general

No sound playing avi with 2 audio streams

Postby Stilgar » Sun Nov 04, 2012 9:31 pm

Hi,

I found a possible bug in the new versions (at least in 1.70.1 and 1.60.0), in the version 1.54.0 it works fine.
Using the engine MEncoder, AVI files with two audio streams are reproduced without any sound.
If I remove one of the audio streams it works fine.
By the way, the MKV files with two audio streams also work fine.

This issue seems no related with the audio format. I have tested with these audio combinations (1st stream/2nd stream): AC3/AC3; AC3/mp3; mp3/AC3

The problem seems to be that the audio stream ID is incorrectly identified. It uses the 0 id instead of the "1" id:

-------------
DEBUG 2012-11-04 15:28:03.258 [mencoder.exe-7] Starting "D:\PS3 Media Server\win32\mencoder.exe" -ss 0 -quiet "D:\Movie.avi" -quiet -quiet -oac lavc -of mpeg -quiet -quiet -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 2 -lavdopts debug=0:threads=4 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=448:threads=4:keyint=5:vqscale=1:vqmin=1:vrc_maxrate=54000:vrc_buf_size=1835 -aid 0 -subdelay 20000 -fps 25 -ofps 25 -quiet -quiet -lavdopts fast -af lavcresample=48000 -srate 48000 -o \\.\pipe\mencoder1352039283039
DEBUG 2012-11-04 15:28:03.258 [mencoder.exe-7] Reading pipe: \\.\pipe\mencoder1352039283039
DEBUG 2012-11-04 15:28:03.258 [mencoder.exe-7] Attaching thread: mencoder.exe-7
DEBUG 2012-11-04 15:28:03.289 [Thread-40] MEncoder SB32 (C) 2000-2012 MPlayer Team
DEBUG 2012-11-04 15:28:03.289 [Thread-40] Custom build by SubJunk, http://www.spirton.com
DEBUG 2012-11-04 15:28:03.289 [Thread-40]
DEBUG 2012-11-04 15:28:03.343 [Thread-40] success: format: 0 data: 0x0 - 0x78cf3000
DEBUG 2012-11-04 15:28:03.343 [Thread-40] libavformat version 54.3.100 (internal)
DEBUG 2012-11-04 15:28:03.347 [Thread-40] AVI file format detected.
DEBUG 2012-11-04 15:28:03.347 [Thread-40] [aviheader] Video stream found, -vid 0
DEBUG 2012-11-04 15:28:03.347 [Thread-40] [aviheader] Audio stream found, -aid 1
DEBUG 2012-11-04 15:28:03.347 [Thread-40] [aviheader] Audio stream found, -aid 2
DEBUG 2012-11-04 15:28:03.414 [Thread-39] AVI: invalid audio stream ID: 0 - ignoring (nosound)
-------------

But in the version 1.54.0 it is been used the correct one:
-------------
DEBUG 2012-11-04 15:37:10.947 [mencoder.exe-5] Starting "D:\PS3 Media Server 1.54.0\win32\mencoder.exe" -ss 0 -quiet "D:\Movie.avi" -quiet -quiet -oac lavc -of mpeg -quiet -quiet -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavdopts debug=0:threads=4 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=448:threads=4:keyint=5:vqscale=1:vqmin=1:vrc_maxrate=54000:vrc_buf_size=1835 -aid 1 -subdelay 20000 -fps 25 -ofps 25 -quiet -quiet -lavdopts fast -af lavcresample=48000 -srate 48000 -o \\.\pipe\mencoder1352039830744
DEBUG 2012-11-04 15:37:10.947 [mencoder.exe-5] Reading pipe: \\.\pipe\mencoder1352039830744
DEBUG 2012-11-04 15:37:10.947 [mencoder.exe-5] Attaching thread: mencoder.exe-5
DEBUG 2012-11-04 15:37:10.994 [Thread-33] MEncoder SB32 (C) 2000-2012 MPlayer Team
DEBUG 2012-11-04 15:37:10.994 [Thread-33] Custom build by SubJunk, http://www.spirton.com
DEBUG 2012-11-04 15:37:10.994 [Thread-33]
DEBUG 2012-11-04 15:37:11.032 [Thread-33] success: format: 0 data: 0x0 - 0x78cf3000
DEBUG 2012-11-04 15:37:11.032 [Thread-33] libavformat version 54.3.100 (internal)
DEBUG 2012-11-04 15:37:11.035 [Thread-33] AVI file format detected.
DEBUG 2012-11-04 15:37:11.035 [Thread-33] [aviheader] Video stream found, -vid 0
DEBUG 2012-11-04 15:37:11.035 [Thread-33] [aviheader] Audio stream found, -aid 1
DEBUG 2012-11-04 15:37:11.035 [Thread-33] [aviheader] Audio stream found, -aid 2
-------------

As a workaround I could use a custom parameter like this:
container == avi :: -aid 1
With this parameter the first audio stream is always reproduced, but the second one cannot be selected anymore.

I think I will come back to the version 1.54.0 which seems to work fine in my case.

Other data:
-Windows 7 x64 SP1
-Java 1.7.0_09
-AMD Phenom 9850 Quad-Core Processor 2.50 GHz
-RAM 4 GB
-Renderer: Sony Bravia EX
-Wifi connection

Greetings.
Stilgar
 
Posts: 2
Joined: Sun Nov 04, 2012 5:46 pm

Re: No sound playing avi with 2 audio streams

Postby Raptor399 » Tue Nov 06, 2012 8:25 am

Thanks for sharing the analysis. It looks like the effect might be related to this piece of TODO code in MEncoderVideo.java, line 2359:

Code: Select all
            String aid = null;
            if (media != null && media.getAudioTracksList().size() > 1 && params.aid != null) {
               if (media.getContainer() != null && (media.getContainer().equals(FormatConfiguration.AVI) || media.getContainer().equals(FormatConfiguration.FLV))) {
                  // TODO confirm (MP4s, OGMs and MOVs already tested: first aid is 0; AVIs: first aid is 1)
                  // for AVIs, FLVs ans MOVs mencoder starts audio tracks numbering from 1
                  aid = "" + (params.aid.getId() + 1);
               } else {
                  // everything else from 0
                  aid = "" + params.aid.getId();
               }
            }
Raptor399
Project Member
 
Posts: 1683
Joined: Thu Mar 10, 2011 12:06 am

Re: No sound playing avi with 2 audio streams

Postby Stilgar » Tue Nov 06, 2012 10:04 am

Hi,
Now I'm using the version 1.54.0 with any problem, so it's OK for me.
Stilgar
 
Posts: 2
Joined: Sun Nov 04, 2012 5:46 pm


Return to General Help and Support

Who is online

Users browsing this forum: Bing [Bot] and 12 guests