archienz / ps3mediaserver

Automatically exported from code.google.com/p/ps3mediaserver
0 stars 0 forks source link

[Video] DTS/Flac -> LPCM remux sends wrong channels to wrong speakers [Mencoder/tsMuxer] #134

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Check DTS/Flac -> LPCM remux option
2. Play DTS mkv movie
3.

What is the expected output? What do you see instead?

expected : Correct channel on correct speaker (ie Front left channel on
front left speaker...)

actually: Front left and center speakers produce surrond channels
Front right is ok
Rear right speaker is muted
Rar left produces front channel
...

What version of the product are you using? On what operating system?

1.02.1 on Windows

If you are transcoding a media file, which engine are you using (mencoder,
avisynth/mencoder, tsmuxer?)

MPlayer audio, FFMpeg and High Quality Audio
The 3 engine equally fail

If the media file is in error (or does not play flawlessly), what are the
codec informations of this file (you can use following program:
mediainfo.sourceforge.net) ? 

Problem is systematically reproduced with different working media files 
media files are ok on the computer and when the remux option is not checked

Please provide any additional information below and PLEASE JOIN debug.log
file !!

Besides this, that's a wonderful software. Keep up the good work !

Original issue reported on code.google.com by nicolas....@gmail.com on 9 Jan 2009 at 11:09

GoogleCodeExporter commented 9 years ago
Seems to be the 21 issue.

Original comment by fabrice....@gmail.com on 9 Jan 2009 at 11:26

GoogleCodeExporter commented 9 years ago
LPCM ordering channels issue

Original comment by ps3mediaserver@gmail.com on 26 Jan 2009 at 8:16

GoogleCodeExporter commented 9 years ago
I finally found a couple of DTS movies playing flawlessly with the option 
checked.
The difference between the wrong and the good ones is the following line in the
debug.log file :

[Thread-215] DEBUG 11:52:16.140 Warning! Multi channels WAVE file for stream 2 
do not
contain channels configuration info. Applying default value: L R C LFE BL BR

My guess is that those default values are incorrect when channels configuration 
info
is missing. The incorrect ordering sounds to always be the same. 

If there is a way to change those default values, I am willing to help find the
correct order. 

I am using PMS v1.03 on winxp

Original comment by nicolas....@gmail.com on 27 Jan 2009 at 1:19

GoogleCodeExporter commented 9 years ago
There's this in the Readme :
Linear PCM Muxing
=================

The version 0.98 introduces a preliminary feature: Linear PCM remuxing with 
tsMuxer
(only working on Windows right now, struggled a few minutes without luck with 
pipes
and tsMuxer on linux). LPCM muxing is disabled by default, but you can safely 
enable it.
If there are some troubles with channels order, you can try the following switch
in the "Decoding settings" configuration line:

 -af channels=6:6:0:0:1:1:2:4:3:5:4:2:5:3 (NEW 1.01: it's ac3 decoding order, so not
this one)

this should be the right order, but in case of, you can also try this one: 

 -af channels=6:6:0:0:1:2:2:3:3:5:4:1:5:4
 NEW 1.01: -af channels=6:6:0:4:1:0:2:1:3:2:4:3:5:5
 NEW 1.01: -ac ffdca -af channels=6:6:0:4:1:0:2:1:3:2:4:3:5:5 

maybe this order is not correct as well. Feedback are welcome, of course :)

Original comment by fabrice....@gmail.com on 27 Jan 2009 at 1:26

GoogleCodeExporter commented 9 years ago
Many thanks

After a lot of trials & errors, the following parameters seems to do the trick 
with
all the movies I tried.

-af channels=6:6:0:3:1:1:2:0:3:5:4:4:5:2

One should just make sure stéréo is not inverted (FR/FL & RR/RL channels)

No sure either if this is just a workaround or if it can be integrated in the 
PMS
trunk in some way

Original comment by nicolas....@gmail.com on 27 Jan 2009 at 3:28

GoogleCodeExporter commented 9 years ago
I'm sorry about this, cause I think I've found the cause... (commit from 
yesterday): 
In the parsing code, the pcm data was shifted of 4 bytes, so channels 
0,1,2,3,4,5 was 
interpreted as 4,5,0,1,2,3...
I guess you have found the swapping trick to correct my mistake :)

Original comment by ps3mediaserver@gmail.com on 27 Jan 2009 at 5:27

GoogleCodeExporter commented 9 years ago
"The difference between the wrong and the good ones is the following line in the
debug.log file 
[Thread-215] DEBUG 11:52:16.140 Warning! Multi channels WAVE file for stream 2 
do not 
contain channels configuration info. Applying default value: L R C LFE BL BR"

Now I'm confused : I know how to remove this line (just adding some header data 
to 
the pcm stream) but I thought this had nothing to do with the problem

Original comment by ps3mediaserver@gmail.com on 27 Jan 2009 at 5:31

GoogleCodeExporter commented 9 years ago
Looks like it might be more than a shift (2 channel were correct in the swapping
trick)...

Just in case (found on the net) :

 Channel Arrangement for Multi Channel 5.1 Audio Formats
Format  Chan 0  Chan 1  Chan 2  Chan 3  Chan 4  Chan 5
5.1 WAV FL  FR  FC  LFE SL  SR
5.1 AC3 FL  FC  FR  SL  SR  LFE
5.1 DTS FC  FL  FR  SL  SR  LFE
5.1 AAC FC  FL  FR  SL  SR  LFE
5.1 AIFFFL  SL  FC  FR  SR  LFE

Anyway, looking forward to try the new build and give feedback

Original comment by nicolas....@gmail.com on 27 Jan 2009 at 5:47

GoogleCodeExporter commented 9 years ago
FYI: same process is now used for LPCM encoding in mencoder engine, and tsMuxer 
engine... so same channels swapping issues may occurs

Original comment by ps3mediaserver@gmail.com on 29 Jan 2009 at 3:45

GoogleCodeExporter commented 9 years ago
New version (1.04) still has channel ordering issues (different from previous 
version)
New correct mapping is (shifted by 4 bytes as you said) : 

-af channels=6:6:0:5:1:3:2:2:3:1:4:0:5:4

Moreover, the previously mentioned Debug Warning line has disappeared.

Original comment by nicolas....@gmail.com on 8 Feb 2009 at 7:44

GoogleCodeExporter commented 9 years ago
thanks, seems to work on the few samples I have
it's also working on every video ?

Original comment by ps3mediaserver@gmail.com on 9 Feb 2009 at 8:25

GoogleCodeExporter commented 9 years ago
Yes, it sounds fine on the different movies I tried.

Original comment by nicolas....@gmail.com on 9 Feb 2009 at 5:39

GoogleCodeExporter commented 9 years ago
I was experiencing this problem also.
The problem affects mencoder transcoding only - tsmuxer works just fine.

I tried setting "-af channels=6:6:0:5:1:3:2:2:3:1:4:0:5:4" for matroska files 
and it
helps. All the 5.1 mkvs I tested seem ok with the above change. I'm not sure if 
it's
100% correct but much better than the default setting which throws centre 
channel to
surround right etc.

Original comment by theodora...@gmail.com on 9 Feb 2009 at 7:58

GoogleCodeExporter commented 9 years ago
Tried with both TSMuxer and MEncoder, but still not working. Any other options
settings I'm missing? I have DTS/FLAC->LPCM checked under common settings, 
Demux with
Mencoder and encode to LPCM under TSMuxer settings, and -af channels=etc under 
Custom
Options in Mencoder settings. 

Original comment by mrnova...@gmail.com on 10 Feb 2009 at 3:16

GoogleCodeExporter commented 9 years ago
I actually put that in mencoder's "Expert settings: Codecs specific parameters" 
but
But I don't think the placement really matters..

This is what I have in there now ("use application default... " is unchecked):
container == iso :: -mt
container == avi :: -mt
container == matroska :: -mt -af channels=6:6:0:5:1:3:2:2:3:1:4:0:5:4
container == flv :: -mt
container == mov :: -mt -noass
container == rm  :: -mt

My mencoder "multithreading" is grayed out under mencoder settings (using 
Ubuntu 8.10
64bit).

Original comment by theodora...@gmail.com on 10 Feb 2009 at 9:12

GoogleCodeExporter commented 9 years ago
channel order fixed in the trunk, besides now you can stream DTS "as is"

Original comment by ps3mediaserver@gmail.com on 27 Feb 2009 at 11:09