Weird switching of audio from 2.0 -> 5.1 (tsMuxeR bug?)

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Weird switching of audio from 2.0 -> 5.1 (tsMuxeR bug?)

Post by ExSport »

Some post remembered me my tests published on another forum so copying also here if someone will spot similar weirdness or SubJunk will have any idea 8-)
I tested sample.mkv file also on PS3 with latest MEncoder (SB46) and found weird things ("keep AC3 tracks" ticked):
- On PanTV all encoder engines switched to 5.1 automatically
- On PS3 only MEncoder and FFMPEG engines switched to 5.1 automatically but not tsMuxeR!
- PanTV and PS3 generates same MEncoder parameters but PS3 played in 2.0 only
- When I jumped to pure 5.1 part (starting after 2 mins) on PS3 and played it again from this position, PS3 still plays it in 2.0 (avoiding swithich from 2.0 to 5.1 in realtime)
Conclusion:
When MEncoder reencoded whole file by own, audio switched to 5.1 also on PS3.
When Mencoder remuxed audio and video separately to separate tracks/streams which tsMuxeR remuxed together, it doesn't switch to 5.1 on PS3 only.
:idea: Ehm, I have an idea: MEncoder generates MPEG file but txMuxeR m2ts file. It is only difference. Maybe PS3 can switch to 5.1 with MPEG (mpeg-ps) container but not with TS/M2TS (mpeg-ts)? We should test it...somehow.....
When I used tsMuxerGUI and converted sample.mkv file to .ts or .m2ts file:
- any of these files doesn't switch to 5.1 with pure streaming, MEncoder or tsMuxeR engine. Only FFMPEG works
When file was MKV without tsMuxeR touch, MEncoder was able to switch to 5.1 in realtime. After remuxing to ts/m2ts, MEncoder stopped switching to 5.1 :idea:
I don't know what exactly txMuxeR does with file, but it somehow "damaged" file so MEncoder stopped working afterwards but it worked before.
Culprit is somewhere in tsMuxeR I suppose.
EDIT:
Just tested these ts/m2ts files on PanTV (above in this post is for PS3 only) where it worked with any engine and:
- pure streaming switched to 5.1
- FFMPEG works, audio switched to 5.1
- Mencoder stopped working, now it plays in 2.0 only
- tsMuxeR stopped working, now it plays in 2.0 only
It seems tsMuxeR affected also my PanTV which worked before...
Do someone have any thoughts?
Original post: http://www.ps3mediaserver.org/forum/vie ... 215#p76215
blackjackc
Posts: 2
Joined: Sat Apr 13, 2013 3:41 am

Re: Weird switching of audio from 2.0 -> 5.1 (tsMuxeR bug?)

Post by blackjackc »

Hi,

I have the same issue. Sound gets way too slow when it should switch to 5.1 sound. With the "keep AC3"-box ticked I only have stereo sound. When I use the "MEncoder[AC3]"-option in the transcode menu, I have full 5.1 sound, which seems a bit strange to me since it should be the same when I select the file normally.

I attached the logs for both options.
Attachments
ums_dbg.zip
opened via Transcode -> MEncoder[AC3]
(38.68 KiB) Downloaded 601 times
ums_dbg1.zip
Normally opened
(37.87 KiB) Downloaded 584 times
User avatar
SubJunk
Lead Developer
Posts: 3797
Joined: Sun May 27, 2012 4:12 pm

Re: Weird switching of audio from 2.0 -> 5.1 (tsMuxeR bug?)

Post by SubJunk »

@ExSport: The behaviour will be different on PMS and UMS I think, since I fixed some bugs related to this. Unfortunately MediaInfo doesn't have a way to detect whether the audio in a file is 2.0 or 2.0 that changes to 5.1. I started a request for that feature in September 2012 (linky) but no updates so far.

@blackjackc: The difference is that when you use MEncoder via the transcode folder, it will strictly use MEncoder, whereas if you use it by selecting the file normally it will use tsMuxeR if you have that setting enabled in the MEncoder options page. So you can probably temporarily fix the issue by disabling that tsMuxeR option on the MEncoder options page.

I will look at implementing a better fix for it.
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: Weird switching of audio from 2.0 -> 5.1 (tsMuxeR bug?)

Post by ExSport »

Without testing it also with UMS I will not post it here;-)
In most cases (in past) I published some test scenarios or patches to PMS forum because I had no time to publish it on more sites and I know you integrates patches from PMS to UMS but not vice versa. So publishing it in PMS, it will be included also in Ums but publishing it in Ums, it will never reach PMS. And I like the best from both and right now it is UMS :-D
blackjackc
Posts: 2
Joined: Sat Apr 13, 2013 3:41 am

Re: Weird switching of audio from 2.0 -> 5.1 (tsMuxeR bug?)

Post by blackjackc »

SubJunk wrote:@blackjackc: The difference is that when you use MEncoder via the transcode folder, it will strictly use MEncoder, whereas if you use it by selecting the file normally it will use tsMuxeR if you have that setting enabled in the MEncoder options page. So you can probably temporarily fix the issue by disabling that tsMuxeR option on the MEncoder options page.
Then I will try disabling tsMuxer as well. As it turned out, using the Transcode-option won't work either. I have 5.1 sound, but there are wild skips and image problems after a while. I didn't have time to run the video long enough in the first try.

edit: Works like a charm. Found a solution for the skipping as well (setting max. transcode buffer to 0). So everything seems perfect now..thanks!
User avatar
SubJunk
Lead Developer
Posts: 3797
Joined: Sun May 27, 2012 4:12 pm

Re: Weird switching of audio from 2.0 -> 5.1 (tsMuxeR bug?)

Post by SubJunk »

blackjackc wrote:
SubJunk wrote:@blackjackc: The difference is that when you use MEncoder via the transcode folder, it will strictly use MEncoder, whereas if you use it by selecting the file normally it will use tsMuxeR if you have that setting enabled in the MEncoder options page. So you can probably temporarily fix the issue by disabling that tsMuxeR option on the MEncoder options page.
Then I will try disabling tsMuxer as well. As it turned out, using the Transcode-option won't work either. I have 5.1 sound, but there are wild skips and image problems after a while. I didn't have time to run the video long enough in the first try.

edit: Works like a charm. Found a solution for the skipping as well (setting max. transcode buffer to 0). So everything seems perfect now..thanks!
Glad it's working for you now. The skipping problems probably mean there wasn't enough free RAM on the computer at the time for the buffer to work properly.

I just tested and it looks like tsMuxeR just can't handle switching channels - not surprising since audio never did it when tsMuxeR was being developed.
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: Weird switching of audio from 2.0 -> 5.1 (tsMuxeR bug?)

Post by ExSport »

As I wrote in first post it is not true in all cases (shortened):
MKV file:
- On PanTV all encoder engines switched to 5.1 automatically - it means also tsMuxeR switched to 5.1 automatically
MKV file above remuxed to M2TS file via tsMuxeR-GUI:
- tsMuxeR stopped working, now it plays in 2.0 only
So tsMuxeR works on PanTV but not on PS3. But also it stopped working on PanTV when I used tsMuxeR again on file which was generated via tsMuxeR-GUI (streamed file worked)
So it is quite weird behavior and because of that I posted it there and thought there will be more discussion about it so we can somehow narrow it :mrgreen:
User avatar
SubJunk
Lead Developer
Posts: 3797
Joined: Sun May 27, 2012 4:12 pm

Re: Weird switching of audio from 2.0 -> 5.1 (tsMuxeR bug?)

Post by SubJunk »

Confirmed with my Panasonic TV. So I guess it is a bug with how the PS3 reads the stream from tsMuxeR
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: Weird switching of audio from 2.0 -> 5.1 (tsMuxeR bug?)

Post by ExSport »

Maybe it is both. The tsMuxeR and PS3 :mrgreen:
Because when you will play MKV on PanTV via tsMuxeR, it works. If you will remux it via GUI to m2ts, it works when file is streamed but when you will remux it on the fly with tsMuxeR again (inside UMS), 2.0->5.1 switching will stop working also on PanTV.
So it seems to me that tsMuxeR does some manipulation with the stream which will broke PS3 switching but PanTV is not so strict so switching works. But when remuxing is done again, another stream manipulation will broke it also for PanTV.
So I suppose something wrong is in tsMuxeR 8-)
It can be easily tested with another remuxers like MEncoder/ffMpeg/tsRemux--Download etc. or something like MKVToolnix/eac3to (but some of them can't remux file to m2ts) so we can avoid possible stream manipulation done directly in UMS (I know that in code there is some coding for rewriting header of RAW streams so with pure streaming we should avoid any stream manipulation from UMS side)
Can't test because I am not at home but will try to prepare some remuxed files and test them when get home (2-3 weeks?)
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: Weird switching of audio from 2.0 -> 5.1 (tsMuxeR bug?)

Post by ExSport »

Good point why probably switching behavior from 2.0-->5.1 is not same as on Panasonic TV:
https://github.com/ps3mediaserver/ps3me ... 8cdf252f01
Post Reply