Why can't m2ts (h264/dts) content be streamed rather than transcoded to PS3?

Discuss media renderers like Xbox 360, TVs, smartphones, etc.
Post Reply
ajkessel
Posts: 7
Joined: Sun Jan 20, 2019 7:06 am

Why can't m2ts (h264/dts) content be streamed rather than transcoded to PS3?

Post by ajkessel » Fri May 22, 2020 9:28 am

In theory, Sony PS3 should be able to play m2ts files without transcoding, including the common situation where video code is h264 and audio codec is dts. But by default UMS transcodes in this situation and at least when I tried manually disabling transcoding for the m2ts extension, I get a PS3 error when selecting an m2ts file.

I have in the past been able to get the PS3 to play some m2ts files with these codecs (and no transcoding) from the rygel media server but it doesn't seem to work universally.

Has anyone figured out what the magic ingredients are to stream this sort of content to the PS3 without transcoding? Is it not just not possible?

User avatar
SubJunk
Lead Developer
Posts: 3012
Joined: Sun May 27, 2012 4:12 pm

Re: Why can't m2ts (h264/dts) content be streamed rather than transcoded to PS3?

Post by SubJunk » Fri May 22, 2020 1:15 pm

That's what we use tsMuxeR for - it takes the streams and remuxes them into m2ts so the PS3 can understand it. You might have to manually enabled tsMuxeR in the settings

ajkessel
Posts: 7
Joined: Sun Jan 20, 2019 7:06 am

Re: Why can't m2ts (h264/dts) content be streamed rather than transcoded to PS3?

Post by ajkessel » Sat May 23, 2020 5:32 am

SubJunk wrote:
Fri May 22, 2020 1:15 pm
That's what we use tsMuxeR for - it takes the streams and remuxes them into m2ts so the PS3 can understand it. You might have to manually enabled tsMuxeR in the settings
Thanks for the tip! Enabling tsMuxeR and tsMuxeR-new does allow these files to stream to the PS3 without transcoding. However, the video quality is distorted--there are blocks of colored pixels that randomly appear on different parts of the screen. Any advice on how to troubleshoot that problem?

I captured the process list while streaming and see this:

Code: Select all

/usr/bin/ffmpeg -ss 0 -i /home/user/file.m2ts -c copy -f rawvideo -y /tmp/UMS-user/1590167663175ffmpegvideo
/usr/bin/ffmpeg -ss 0 -i /home/user/file.m2ts -ac 6 -f ac3 -c:a ac3 -ab 640k -y /tmp/UMS-user/1590167663175ffmpegaudio01
/home/user/ums-9.4.3/linux/tsMuxeR-new /tmp/UMS-user/pms-tsmuxer.meta /tmp/UMS-user/1590167663178tsmuxerout.ts
tsMuxeR-new is the executable that is included in the ums-9.4.3 tarball. Interestingly, I tried to set tsmuxer_new_path to a newer release of tsMuxeR-new but it appears UMS is still invoking the version that came with it rather than the newer build.

I also tried toggling tsmuxer_forcefps from true to false and tried switching to the latest build of ffmpeg from git, but it did not change the random colored pixels/distortion issues (although it did invoke the newer ffmpeg).

ajkessel
Posts: 7
Joined: Sun Jan 20, 2019 7:06 am

Re: Why can't m2ts (h264/dts) content be streamed rather than transcoded to PS3?

Post by ajkessel » Sat May 23, 2020 7:55 am

Update - I swapped in tsMuxer-new 2.6.11 under the ums directory for version 2.2.3(b) by overwriting the binary file in the UMS folder. That seems to have eliminated the pixel distortion issue.

I also tried swapping in tsMuxer built from source from https://github.com/justdan96/tsMuxer.git and the streaming worked but without any audio.

With the newer tsMuxer-new build, I'm able to stream m2ts files with no transcoding and no distortion, but if I try an mkv file, I get "This content cannot be played. (800288E1)" on the ps3. Yet, if I take the same mkv and re-package it as an m2ts with no transcoding (i.e. ffmpeg -c copy), it plays fine. So there is something awry with how UMS is remuxing the mkv on the fly such that it won't work on the PS3, even where remuxing an m2ts with the same content and codecs on the fly works fine.

User avatar
SubJunk
Lead Developer
Posts: 3012
Joined: Sun May 27, 2012 4:12 pm

Re: Why can't m2ts (h264/dts) content be streamed rather than transcoded to PS3?

Post by SubJunk » Sat May 23, 2020 4:14 pm

This seems like some good investigation you've done, thanks. I remember doing similar things a few years ago. We could never get tsMuxeR working well with all media types. We did our best by having different versions included but it was never perfect which is why we ended up disabling the engine by default. I'm willing to keep doing more research though if you are.

When you say "if I take the same mkv and re-package it as an m2ts with no transcoding (i.e. ffmpeg -c copy), it plays fine." are you using tsMuxeR at all in that process? If FFmpeg is completely working for this purpose then maybe we should start doing that instead of using tsMuxeR

User avatar
SubJunk
Lead Developer
Posts: 3012
Joined: Sun May 27, 2012 4:12 pm

Re: Why can't m2ts (h264/dts) content be streamed rather than transcoded to PS3?

Post by SubJunk » Sun May 24, 2020 9:02 am

Here's an FFmpeg issue I created last time I looked into this, maybe they have fixed it but not yet closed the issue https://trac.ffmpeg.org/ticket/2515

ajkessel
Posts: 7
Joined: Sun Jan 20, 2019 7:06 am

Re: Why can't m2ts (h264/dts) content be streamed rather than transcoded to PS3?

Post by ajkessel » Mon May 25, 2020 11:02 am

SubJunk wrote:
Sat May 23, 2020 4:14 pm
This seems like some good investigation you've done, thanks. I remember doing similar things a few years ago. We could never get tsMuxeR working well with all media types. We did our best by having different versions included but it was never perfect which is why we ended up disabling the engine by default. I'm willing to keep doing more research though if you are.
Yes, absolutely happy to debug and test extensively. Would really like to get this working seamlessly.
When you say "if I take the same mkv and re-package it as an m2ts with no transcoding (i.e. ffmpeg -c copy), it plays fine." are you using tsMuxeR at all in that process? If FFmpeg is completely working for this purpose then maybe we should start doing that instead of using tsMuxeR
Just ffmpeg. For example, file.mkv gives the PS3 error. But if I run the following:

Code: Select all

# ffmpeg -i file.mkv -map 0 -c copy file.m2ts
file.m2ts then streams to the PS3 without issue on UMS.

Post Reply