No sound playing avi with 2 audio streams

For help and support with PS3 Media Server in general
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

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: 1916
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

Re: No sound playing avi with 2 audio streams

Postby hungry » Sun Oct 27, 2013 7:13 pm

I'm sorry to dig up the old post, but it seems to me that 1.90.1 is still affected by this bug.

Here's the mediainfo for the file I'm trying to play:
Code: Select all
General
Complete name                    : D:\Downloads\Cartoons\Каникулы Гуфи.avi
Format                           : AVI
Format/Info                      : Audio Video Interleave
File size                        : 1.45 GiB
Duration                         : 1h 14mn
Overall bit rate                 : 2 784 Kbps
Movie name                       : A Goofy Movie (Rus/Eng) /Perfection Series/
Director                         : Great Dragon | 25KADR
Writing application              : VirtualDubMod 1.5.10.2 (build 2542/release)
Writing library                  : VirtualDubMod build 2542/release
Copyright                        : August 22, 2008

Video
ID                               : 0
Format                           : MPEG-4 Visual
Format profile                   : Advanced Simple@L5
Format settings, BVOP            : 1
Format settings, QPel            : Yes
Format settings, GMC             : No warppoints
Format settings, Matrix          : Default (H.263)
Muxing mode                      : Packed bitstream
Codec ID                         : XVID
Codec ID/Hint                    : XviD
Duration                         : 1h 14mn
Bit rate                         : 2 385 Kbps
Width                            : 720 pixels
Height                           : 400 pixels
Display aspect ratio             : 16:9
Frame rate                       : 25.000 fps
Color space                      : YUV
Chroma subsampling               : 4:2:0
Bit depth                        : 8 bits
Scan type                        : Progressive
Compression mode                 : Lossy
Bits/(Pixel*Frame)               : 0.331
Stream size                      : 1.24 GiB (86%)
Writing library                  : XviD 1.1.2 (UTC 2006-11-01)

Audio #1
ID                               : 1
Format                           : AC-3
Format/Info                      : Audio Coding 3
Format profile                   : Dolby Digital
Mode extension                   : CM (complete main)
Codec ID                         : 2000
Duration                         : 1h 14mn
Bit rate mode                    : Constant
Bit rate                         : 192 Kbps
Channel(s)                       : 2 channels
Channel positions                : Front: L R
Sampling rate                    : 48.0 KHz
Bit depth                        : 16 bits
Compression mode                 : Lossy
Stream size                      : 102 MiB (7%)
Alignment                        : Split accross interleaves
Interleave, duration             : 40 ms (1.00 video frame)
Interleave, preload duration     : 500 ms
Title                            : Rus

Audio #2
ID                               : 2
Format                           : AC-3
Format/Info                      : Audio Coding 3
Format profile                   : Dolby Digital
Mode extension                   : CM (complete main)
Codec ID                         : 2000
Duration                         : 1h 14mn
Bit rate mode                    : Constant
Bit rate                         : 192 Kbps
Channel(s)                       : 2 channels
Channel positions                : Front: L R
Sampling rate                    : 48.0 KHz
Bit depth                        : 16 bits
Compression mode                 : Lossy
Stream size                      : 102 MiB (7%)
Alignment                        : Split accross interleaves
Interleave, duration             : 40 ms (1.00 video frame)
Interleave, preload duration     : 500 ms
Title                            : Eng


Here's the debug log:
Code: Select all
DEBUG 2013-10-27 22:07:53.232 [New I/O server worker #3-1] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi
INFO  2013-10-27 22:07:53.232 [New I/O server worker #3-1] Starting transcode/remux of Каникулы Гуфи.avi
DEBUG 2013-10-27 22:07:53.233 [New I/O server worker #3-1] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi
DEBUG 2013-10-27 22:07:53.245 [New I/O server worker #3-1] Reading mencoder_mt: default: true, previous: false, current: true
DEBUG 2013-10-27 22:07:53.257 [New I/O server worker #3-1] Creating pipe \\.\pipe\mencoder1382897273257
INFO  2013-10-27 22:07:53.269 [New I/O server worker #3-1] Successfully initialized buffer to 50,000,000 bytes.
DEBUG 2013-10-27 22:07:53.271 [Thread-205] Waiting for pipe connection \\.\pipe\mencoder1382897273257
DEBUG 2013-10-27 22:07:53.320 [mencoder.exe-46] Starting "C:\Program Files (x86)\PS3 Media Server\win32\mencoder.exe" -ss 0 D:\DOWNLO~1\Cartoons\42C3~1.AVI -msglevel statusline=2 -oac lavc -of mpeg -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 2 -lavdopts debug=0:threads=2 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=256:threads=2:keyint=25:vqmax=5:vqmin=2:vrc_maxrate=9000:vrc_buf_size=1835 [color=#FF0000]-aid 0[/color] -nosub -noautosub -ofps 25 -lavdopts fast -mc 0 -noskip -af lavcresample=48000 -srate 48000 -o \\.\pipe\mencoder1382897273257
DEBUG 2013-10-27 22:07:53.323 [mencoder.exe-46] Reading pipe: \\.\pipe\mencoder1382897273257
DEBUG 2013-10-27 22:07:53.323 [mencoder.exe-46] Attaching thread: mencoder.exe-46
DEBUG 2013-10-27 22:07:53.340 [Thread-209] MEncoder SB41 (C) 2000-2012 MPlayer Team
DEBUG 2013-10-27 22:07:53.340 [Thread-209] Custom build by SubJunk, http://www.spirton.com
DEBUG 2013-10-27 22:07:53.340 [Thread-209]
DEBUG 2013-10-27 22:07:53.344 [Thread-209] success: format: 0  data: 0x0 - 0x5cd07800
DEBUG 2013-10-27 22:07:53.344 [Thread-209] libavformat version 54.29.105 (internal)
DEBUG 2013-10-27 22:07:53.346 [Thread-209] AVI file format detected.
DEBUG 2013-10-27 22:07:53.347 [Thread-209] [aviheader] Video stream found, -vid 0
DEBUG 2013-10-27 22:07:53.347 [Thread-209] [aviheader] Audio stream found, -aid 1
DEBUG 2013-10-27 22:07:53.347 [Thread-209] [aviheader] Audio stream found, -aid 2
DEBUG 2013-10-27 22:07:53.369 [Thread-208] AVI: invalid audio stream ID: 0 - ignoring (nosound)
DEBUG 2013-10-27 22:07:53.378 [Thread-209] VIDEO:  [XVID]  720x400  24bpp  25.000 fps  2385.2 kbps (291.2 kbyte/s)
DEBUG 2013-10-27 22:07:53.379 [Thread-209] [V] filefmt:3  fourcc:0x44495658  size:720x400  fps:25.000  ftime:=0.0400
DEBUG 2013-10-27 22:07:53.379 [Thread-205] Result of \\.\pipe\mencoder1382897273257 : true
DEBUG 2013-10-27 22:07:53.380 [Thread-209] PACKET SIZE: 2048 bytes, deltascr: 884
DEBUG 2013-10-27 22:07:53.380 [Thread-209] libavcodec version 54.64.100 (internal)
DEBUG 2013-10-27 22:07:53.380 [Thread-209] Opening video filter: [expand osd=1]
DEBUG 2013-10-27 22:07:53.380 [Thread-209] Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
DEBUG 2013-10-27 22:07:53.380 [Thread-209] ==========================================================================
DEBUG 2013-10-27 22:07:53.382 [Thread-209] Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
DEBUG 2013-10-27 22:07:53.382 [Thread-208] Unsupported PixelFormat 61
DEBUG 2013-10-27 22:07:53.382 [Thread-208] Unsupported PixelFormat 53
DEBUG 2013-10-27 22:07:53.382 [Thread-208] Unsupported PixelFormat 81
DEBUG 2013-10-27 22:07:53.384 [Thread-209] Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
DEBUG 2013-10-27 22:07:53.384 [Thread-208] Limiting audio preload to 0.4s.
DEBUG 2013-10-27 22:07:53.384 [Thread-209] ==========================================================================
DEBUG 2013-10-27 22:07:53.384 [Thread-208] Increasing audio density to 4.
DEBUG 2013-10-27 22:07:53.384 [Thread-208] [mpeg4 @ 0113f220]Invalid and inefficient vfw-avi packed B frames detected
DEBUG 2013-10-27 22:07:53.384 [Thread-209] Movie-Aspect is undefined - no prescaling applied.
DEBUG 2013-10-27 22:07:53.385 [Thread-209] videocodec: libavcodec (720x400 fourcc=3267706d [mpg2])
DEBUG 2013-10-27 22:07:53.405 [Thread-209] Movie-Aspect is 1.80:1 - prescaling to correct movie aspect.
DEBUG 2013-10-27 22:07:53.407 [Thread-208] [VD_FFMPEG] DRI failure.
DEBUG 2013-10-27 22:07:53.409 [Thread-209] Writing header...
DEBUG 2013-10-27 22:07:53.410 [Thread-209] INITV: 0.200, 0.160, fps: 25.000
DEBUG 2013-10-27 22:07:53.410 [Thread-209]
DEBUG 2013-10-27 22:07:53.420 [New I/O server worker #3-1] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi
DEBUG 2013-10-27 22:07:53.421 [New I/O server worker #3-1] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi
DEBUG 2013-10-27 22:07:53.423 [StartPlaying Event] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi
INFO  2013-10-27 22:07:53.423 [StartPlaying Event] Started sending D:\DOWNLO~1\Cartoons\42C3~1.AVI to PlayStation 3 on 192.168.100.138
DEBUG 2013-10-27 22:07:53.433 [New I/O server worker #3-2] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi
DEBUG 2013-10-27 22:07:53.434 [New I/O server worker #3-2] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi
DEBUG 2013-10-27 22:07:53.450 [New I/O server worker #3-3] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi
DEBUG 2013-10-27 22:07:53.450 [New I/O server worker #3-3] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi
DEBUG 2013-10-27 22:07:54.435 [New I/O server worker #3-2] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi
DEBUG 2013-10-27 22:07:55.591 [UPNP-AliveMessageSender] Sending ALIVE...
DEBUG 2013-10-27 22:07:59.731 [New I/O server worker #3-3] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi
DEBUG 2013-10-27 22:07:59.736 [New I/O server worker #3-1] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi
DEBUG 2013-10-27 22:07:59.736 [New I/O server worker #3-1] Forcing short path name on D:\Downloads\Cartoons\Каникулы Гуфи.avi


As you may notice, mencoder is invoked with -aid 0, hence the "no sound" error.
Is there anything that can be done to this strange behavoir?
hungry
 
Posts: 1
Joined: Sun Oct 27, 2013 7:01 pm

Re: No sound playing avi with 2 audio streams

Postby Raptor399 » Sun Oct 27, 2013 11:20 pm

Looks like MencoderVideo.java starts numbering audio tracks from 0 instead of 1. It could be patched to use the same checks for FLV and AVI like a bit below.

However, it would be interesting to find out why "params.aid.getId()" would not return the same track ids as detected in the file - which would probably overcome the problem as well and sounds like a much more consistent idea to me.
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am


Return to General Help and Support

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 13 guests