RPi Transcoding

I said I'd reply to this topic if 6-channel AAC needed transcoding, and it appears that it does.  On XBMC (raspbmc), I just use multichannel audio output and it works great, but that option is missing from RasPlex's audio options.  If that can't be added back as an audio option, then the transcoding profile needs to send AAC with greater than 2 channels to 5.1 AC3.  Then I can set AC3 passthru on the Pi and all is happy.

Either since installing the transcoding profile in PMS or updating a remote Pi to 0.4.0, Shared Content which once played smoothly is now constantly buffering on a remote Pi.

Is this a case of me needing to adjust the bandwidth setting on the Pi? I'm assuming the server doesn't do any of the transcoding now and it is all handled by the remote Pi?

Hi,

I'm very interesting by testing the profile installation on PMS with the new rasplex issue.

I have rasplex installed for my Pi but I can't find the profile for PMS.

WHere can I ind It? How it has to be installed?

Thanks

Hi,
 
I'm very interesting by testing the profile installation on PMS with the new rasplex issue.
I have rasplex installed for my Pi but I can't find the profile for PMS.

I'm not sure if you're asking for the custom profile that needs to be installed,
or if you're asking for information on where it is to be installed.
 

WHere can I ind It?

The custom profile was attached to one of the forum posts, though I suppose it may be a bit hard to find by manual searching.
I guess I may as well attach my copy of it to this post.

The place where it is to be installed varies with your operating system, as they use different folder structures for installed programs.
 

How it has to be installed?

The profile is an XML file that simply needs to be copied into the correct folder.

For a normal PMS installation under Windows this will be at:
"C:\Program Files (x86)\Plex\Plex Media Server\Resources\Profiles"

On other systems there should be a corresponding subfolder of the main PMS folder, though the absolute location differs.

I'm attaching the XML file to this post, in exactly the same form I downloaded it earlier.
Plex Home Theater-RaspberryPi.xml (1.07 KB)

Best regards: dlanor

Thank you for your answer.

I was searching for the xml file, you gave it to me

I was also searching where to put it in PMS folder, you respond to it

Thats great I will make some tests with this

There is no stupid question :)

Actually transcoding only works on video, so the question is mostly for videos :)

I have identifies i think the most common ones, but maybe i have missed a few. Also the maximum bitrate for transcoding is something i need to settle. As of now, 20 mbits would seem like a reasonnable limit, but if you guys have experience with higher bitrates working then we could reconsider this :)

On 0.4.0 RC I am getting reports of Audio transcoding too for wmav2. This audio codec direct played in version 9.9.19

Hi, not sure if this is the right place for this question but, anyway here i go:

I have some 10bit Anime that gets transcoded and works perfectly fine, but i'm wondering if it's possible to change the subtitle size which is embedded in the MKV 10bit video. For me the transcoded video's subtitle size covers roughly 25-30% of the screen and is not affected by the subtitle size setting.

Btw, the subtitle in question is .ass format.

Anyway, thanks for all the hard work love the transcoding feature.

Regards, Niklas

Hi, not sure if this is the right place for this question but, anyway here i go:

I have some 10bit Anime that gets transcoded and works perfectly fine, but i'm wondering if it's possible to change the subtitle size which is embedded in the MKV 10bit video. For me the transcoded video's subtitle size covers roughly 25-30% of the screen and is not affected by the subtitle size setting.
 
Btw, the subtitle in question is .ass format.

Anyway, thanks for all the hard work love the transcoding feature.


This subtitle scaling is not a RasPlex issue, but a generic problem with the transcoding of videos with embedded subtitles.

I'll try to explain why that's so.

When a subtitle is embedded in the video file and that file has to be transcoded then the subtitle can not be rendered onto the screen at the client side, because the client never sees the original file that the subtitle data is part of. Instead the PMS server has to render the subtitle onto the streamed video. This is a problem as the original video resolution usually is lower than the intended full screen display. When direct_played by a client, that client does the rendering of each video frame to the physical screen size, and then adds the text on top of it, so to speak. But the rendering PMS doesn't deal with the physical screen size, as it has to render the specified text size onto the original video data as part of the transcoding process, which likely makes the text larger in proportion to the video content than it was intended to be. Then the Plex client which receives this stream rescales it to fit the physical screen, which in many cases results in unpleasantly large text. (For small screens you get the opposite effect when viewing high res videos scaled down.)

I would try to fix this by using the mkvtoolnix tools to extract the text track from the MKV file, and supply it as a separate file instead. That way the RasPlex client should be able to render it as-is to the physical screen.

RasPlex itself has no special code for dealing with subtitles apart from what is implemented in Plex Home Theater for PCs, on which RasPlex is based.

Best regards: dlanor

This subtitle scaling is not a RasPlex issue, but a generic problem with the transcoding of videos with embedded subtitles.

I'll try to explain why that's so.

When a subtitle is embedded in the video file and that file has to be transcoded then the subtitle can not be rendered onto the screen at the client side, because the client never sees the original file that the subtitle data is part of. Instead the PMS server has to render the subtitle onto the streamed video. This is a problem as the original video resolution usually is lower than the intended full screen display. When direct_played by a client, that client does the rendering of each video frame to the physical screen size, and then adds the text on top of it, so to speak. But the rendering PMS doesn't deal with the physical screen size, as it has to render the specified text size onto the original video data as part of the transcoding process, which likely makes the text larger in proportion to the video content than it was intended to be. Then the Plex client which receives this stream rescales it to fit the physical screen, which in many cases results in unpleasantly large text. (For small screens you get the opposite effect when viewing high res videos scaled down.)

I would try to fix this by using the mkvtoolnix tools to extract the text track from the MKV file, and supply it as a separate file instead. That way the RasPlex client should be able to render it as-is to the physical screen.

RasPlex itself has no special code for dealing with subtitles apart from what is implemented in Plex Home Theater for PCs, on which RasPlex is based.

Best regards: dlanor

Ah okay, thanks for the detailed explanation. The PleXBMC AddOn for XBMC can change the size of the transcoding text, not sure how it's done only that it can. Would it maybe be possible to implement that feature into RasPlex? Anyway, thanks for the answer and huge fan of RasPlex.

Regards, Niklas

Ah okay, thanks for the detailed explanation. The PleXBMC AddOn for XBMC can change the size of the transcoding text, not sure how it's done only that it can. Would it maybe be possible to implement that feature into RasPlex? Anyway, thanks for the answer and huge fan of RasPlex.


If PlexBMC can do that, then I assume it's using some way to request PMS to modify the text size before 'burning' the text into the transcoded data stream. If that is the case, then it should also be possible for other clients like PHT to do the same, even if that's not currently implemented in this client.

However, I don't think it will be implemented separately for RasPlex, since the goal for RasPlex is to port PHT to the Raspberry Pi, not to create a new independent client. So the proper place to request such implementation is in the "Plex Home Theater" subforum.

Once it has been implemented for 'mainstream' PHT it will be ported to subsequent RasPlex versions as well.

Best regards: dlanor

this might be a silly question, but I'll ask it anyway.

Is it possible to have a different transcoding profile for wireless clients? I'm not sure that my wireless would sustain 20mbps and I currently enable transcoding specifically if I'm going to play a high bitrate movie. The current transcoding profile would be great for Ethernet, but I'm not sure if it will ensure media streamed over wireless would be stutter free

 I am thinking of changing the way transcoders values are used on PHT.

I might just use them as an override for the bitrate limits to overide teh default ones when used.

This will though require to modify also the default transcoding bitrate on the server side.

I think that would certainly help my situation :)

Just a quick post on transcoding, I was playing a 15gb film through rasplex/pi and selected 20mb transcode as I knew it wouldn't play through direct play due to size, anyway my problem was that halfway through the film there are various chapters where the framerate is obviously high as it went from the usual 20mb p/sec to over 25mb per sec this then obviously caused stuttering whilst playing and I had to wait until the cache caught up to 100% again.

My question is this, surly if I have not selected direct play, then the transcoding should limit the playback to 20-21 mb p/sec like it should do? and when the chapters that play over this should also be capped? or am I being stupid? BTW the pi has ben overclocked as per Dlanors guide, cache playback at 30% etc and I am running through 10gb sd card with 16gb usb which has been partitioned too. cheers Jon

Just a quick post on transcoding, I was playing a 15gb film through rasplex/pi and selected 20mb transcode as I knew it wouldn't play through direct play due to size, anyway my problem was that halfway through the film there are various chapters where the framerate is obviously high as it went from the usual 20mb p/sec to over 25mb per sec this then obviously caused stuttering whilst playing and I had to wait until the cache caught up to 100% again.


If your incoming stream really rose to 25 Mbps, then that was an error in the transcoding method at the PMS side.
 

My question is this, surly if I have not selected direct play, then the transcoding should limit the playback to 20-21 mb p/sec like it should do?


Yes, I absolutely agree.
It's the responsibility of the PMS server to ensure that the bitrate limit of a transcoded stream is not exceeded.
 

and when the chapters that play over this should also be capped? or am I being stupid?


Not at all stupid. PMS should never generate a stream with higher bitrate than the set limit.
That said, it may be difficult to predict rate peaks in media with variable bitrate, and adapt transcoding methods to cope with them.
 

BTW the pi has ben overclocked as per Dlanors guide, cache playback at 30% etc and I am running through 10gb sd card with 16gb usb which has been partitioned too. cheers Jon


That sounds fine to me, except for the odd SD card size.
I've never heard of any card with a 10GB size. (It's usually a power of two)

It may be that your problem was not entirely due to an RPi limitation, but rather a limitation of the PMS server, in case it's not powerful enough to transcode high bitrate movies reliably. I'm not saying that this necessarily caused the problem, but it's one more possibility to consider.

Best regards: dlanor

Transcoding's mostly working well for me, but I have one question / enhancement request.

I have some films which need transcoding due to video restrictions (eg. bitrate too high, or MPEG-2 codec), but where the audio is AC3/DTS and therefore could be played just fine without transcoding (on by setup I have audio passthrough to an external receiver).

Unfortunately the server is transcoding both the video and audio (with the audio being transcoded to 6-channel AAC (which my receiver doesn't natively support).  Two problems with this:

  • For some reason RasPlex is outputting this as 2-channel PCM to the receiver, so I'm losing surround sound.  I have 5.1 channels set up in preferences, so I assume this is just a bug?  Ah, in fact I think it's already been reported here: https://forums.plex.tv/topic/104611-aac-51-files-plays-as-stereo/.  Does this need a bug filed?
  • Even if 6-channel AAC was being output as 6-channel PCM, there's still going to be some quality loss from transcoding DTS to AAC in the first place.

Is this something you're planning on changing?  I notice there's a matroska transcode profile which does attempt to do this, but it's not currently used - any plans to reinstate it?

I've attached an XML description of an example file - it's correctly transcoded because the video bitrate is too high, but there's no reason not to pass through the DTS audio.

I notice there's a matroska transcode profile which does attempt to do this, but it's not currently used - any plans to reinstate it?

Where do you see this transcode profile?  Been trying to poke around at this myself.

Hi there, hoping someone can help me out. rasplex has been working perfect for me provided it does not do any transcoding. I've been reading through the forums and have followed suggestions given such as oveclocking, usb 3 stick and adding the .xml profile to PMS.

For some reason I am still not able to solve videos pausing when transcoding. 

MEDIA
Video Resolution 1080p
Duration 1:55:06
Bitrate 39698 kbps
Width 1920
Height 1080
Aspect Ratio 1.78
Container MKV
Video Frame Rate 24p
FILE
Accessible Yes
Exists Yes
Duration 1:55:06
File /share/Download/completed/Space.Pirate.Captain.Harlock.2013.Blu-Ray.1080p.AVC.ReMuX.DTS-HDMA.5.1-R2D2/Space.Pirate.Captain.Harlock.2013.Blu-Ray.1080p.AVC.ReMuX.DTS-HDMA.5.1-R2D2.mkv
Size 31.92 GB
Container MKV
VIDEO
Codec H264
Bitrate 39698 kbps
Language English
Bit Depth 8
CABAC 1
Chroma Subsampling 4:2:0
Codec I D V_MPEG4/ISO/AVC
Color Space yuv
Duration 1:55:06
Frame Rate 23.976 fps
Frame Rate Mode cfr
Has Scaling Matrix 0
Height 1080
Level 4.1
Profile high
Ref Frames 4
Scan Type progressive
Width 1920
AUDIO
Codec DCA
Channels 5.1
Bitrate 1536 kbps
Language 日本語
Bit Depth 24
Bitrate Mode VBR
Codec I D A_DTS
Duration 1:55:06
Profile ma
Sampling Rate 48000 Hz
SUBTITLES
Language 日本語
Codec I D S_HDMV/PGS
Format PGS
SUBTITLES
Language English
Codec I D S_HDMV/PGS
Format PGS
MEDIA
  •  

Where do you see this transcode profile?  Been trying to poke around at this myself.

The Raspberry Pi XML profile on the Plex server.

Where do you see this transcode profile?  Been trying to poke around at this myself.

The profile file for the RPi is named:

"Plex Home Theater-RaspberryPi.xml".

The location for that file varies with the installation OS of PMS, but for a Win7_x64 system it's normally:

"C:\Program Files (x86)\Plex\Plex Media Server\Resources\Profiles"

As you can see this is a subfolder of the main installation folder holding the PMS program, so it should be fairly easy to find on non-Windows platforms too.

Best regards: dlanor