RPi Transcoding

rasplex

#16

hi,

i play mostly 1080P files with h264 and dd codec. i have experimented with dts (and dts-hd ma) but they only seem to cause me worry. mostly because dts has a tendancy to push the total file bandwidth over 20mbps and then it stutters.

if possible i would have pms transcode video if over 18mbps and transcode audio if over 1.5mbps. in an ideal world audio would be transcoded to something that supports 5.1, and in my particular case DTS at 640 kbps would be perfect.

thanks for lisenting !

- scott

Well from my investigations, it seems that we can specifiy maximum bitrates for audio transcoding as for video transcoding. The main thing is going to define the threshold.

Thanks for sharign the values which are working nicely for you that will help defining the proper values i shold use.

Also one thing i didnt mention, if you can provide me some samples video links on files that would need to be transcoded that would be helpful to build up a test set.

Feel free to PM me some links to some media samples if you can :)


#17

I use a ReadyNas NV+v2 as my server which cannot transcode anything (cpu not powerfull enough)

All of my files though play natively on rasplex absolutely fine.

The highest bitrate video I have is 17mb with 1.5mb DTS audio track (plays perfectly)

I do have a DTS capable receiver though.

Most of my videos are h264 or x264 with either DTS or DolbyDigital soundtracks but I do have a few old xvid videos that also play perfectly.

Also I have it all run through a gigabit wired network.

Thanks


#18

Can't we just create a profile configuration for rasplex and place it in the Profiles folder of the PMS ?

How does rasplex identifies itself? Would the PMS recognize it as the correct client platform and load the appropriate profile ? 

A profile looks like this and seams to be exactly what this thread is about... 



  
    
      
      
    
    
      
    
    
    
  
  
    
    
    
  
  
    
      
        
        
        
      
    
    
      
        
      
    
    
      
        
        
        
      
    
  



#19

Yes building such a file is part of the transcoding implementation, but this is not enough as when using PHT as a client it will also require some implementation on the client side.


Basically the client has to decide wether it will use transcoding or not. As of now in pht, the only thing that will trigger transcoding is the preference settings which will either directplay everything or transcode everything.


So the right way to do this is to have pht decide if it should directplay or transcode. If it decides to transcode, then we need a profile on PMS to let PMS know what we want him to do.


There will be a specific profile file for RPi that will be built according to the results of this thread :)


#20

I have problems playing back DTS-ES The audio drops out every few seconds, this is with a DTS/DTS-ES/DTS-MA receiver 


#21

If you could PM me a link with some sample, i could try to test it and see what happens with transcoding :)


#22

OK here are some news of the progress.

I ended up with a working profile and client implementation.

As of now it seems to give very good results. it has though some constraints on which i'd like to pick your thoughts :)

So here is how it works :

When a media is played, RasPlex checks for the following conditions :

  • Is the video codec known ? (h264, mpeg4)
  • Is the audio codec known (aac, ac3, mp3, dca (DTS), flac) ?
  • Is the video bitrate reasonnable ( < 20 Mbits) ? 

-> If all these conditions are met, then it will trigger DirectPlay.

-> If any of those is not met, then it will trigger Transcoding.(see below)

Here is what transcoding does.

  • Video stream : if the video stream has a known codec (list above) and bitrate < 20 mbits, then it will just forward the stream, if not stream is transcoded to H264 with a maximum bitrate of 20 mbps
  • Audio stream : if the audio stream has a known codec (list above) and bitrate < 1.5 mbits  then it will just forward the stream, if not stream is transcoded to AAC with a maximum bitrate of 1.5 mbps

This allows to handle separately both streams so that you can only transcode video if audio is supported an has a proper bitrate.

The only thing that I would have liked is to be able to dynamically specify the bitrates from PHT.

Like on RPi the limitation seems to be more around a global bandwith, that is you can play a 7 Mbps audio stream if you are running a 10 mbps video stream. it wont work if you play a 20 Mbits video stream with a 7 mbits audio because of total bandwidth limitation.

The idea would have been to define bitrates so that Audio birate + Video bitrates remain behind a threshold, but it seems that as of now you can only cap video and audio bitrates to fixed threshold when transcoding.

So maybe the best we can do is define this limit to 20 Mbits for video and 1.5 Mbit for audio. This will downgrade a bit the audio when you would have a lower bitrate video, but i guess that should be ok.

Any thought / comment  about this is welcome :)


#23

OK here are some news of the progress.

I ended up with a working profile and client implementation.

As of now it seems to give very good results. it has though some constraints on which i'd like to pick your thoughts :)

So here is how it works :

When a media is played, RasPlex checks for the following conditions :

  • Is the video codec known ? (h264, mpeg4)
  • Is the audio codec known (aac, ac3, mp3, dca (DTS), flac) ?
  • Is the video bitrate reasonnable ( < 20 Mbits) ? 

-> If all these conditions are met, then it will trigger DirectPlay.

-> If any of those is not met, then it will trigger Transcoding.(see below)

Here is what transcoding does.

  • Video stream : if the video stream has a known codec (list above) and bitrate < 20 mbits, then it will just forward the stream, if not stream is transcoded to H264 with a maximum bitrate of 20 mbps
  • Audio stream : if the audio stream has a known codec (list above) and bitrate < 1.5 mbits  then it will just forward the stream, if not stream is transcoded to AAC with a maximum bitrate of 1.5 mbps

This allows to handle separately both streams so that you can only transcode video if audio is supported an has a proper bitrate.

The only thing that I would have liked is to be able to dynamically specify the bitrates from PHT.

Like on RPi the limitation seems to be more around a global bandwith, that is you can play a 7 Mbps audio stream if you are running a 10 mbps video stream. it wont work if you play a 20 Mbits video stream with a 7 mbits audio because of total bandwidth limitation.

The idea would have been to define bitrates so that Audio birate + Video bitrates remain behind a threshold, but it seems that as of now you can only cap video and audio bitrates to fixed threshold when transcoding.

So maybe the best we can do is define this limit to 20 Mbits for video and 1.5 Mbit for audio. This will downgrade a bit the audio when you would have a lower bitrate video, but i guess that should be ok.

Any thought / comment  about this is welcome :)

It sounds right but what about the subtitles?


#24

I have problems playing back DTS-ES The audio drops out every few seconds, this is with a DTS/DTS-ES/DTS-MA receiver 

I think this was a firmware problem and has been resolved in the latest version of openelec (3.2.4)

Rasplex is still using version 3.2.2 ( atleast in the stable version 0.3.1)

A beta of openelec 4.0 was released today and hopefully the Rasplex guys can include this new version by the time they are ready to release 0.4.0 of Rasplex.


When a media is played, RasPlex checks for the following conditions :

  • Is the video codec known ? (h264, mpeg4)
  • Is the audio codec known (aac, ac3, mp3, dca (DTS), flac) ?
  • Is the video bitrate reasonnable ( < 20 Mbits) ? 

I assume mpeg4 includes xvid ?


#25

OE 4.0 means XBMC Gotham, that's in the plan but it means also that PlexInc has to merge with Gotham :)


#26

It sounds right but what about the subtitles?

We have two options there regarding transcoding, i have seen that subtitles can be directly included in video with transcoder or they can be rendered by RPI.

I am not sure yet which is the best way to go as i dont have much subititles medias on hand :)


#27

OE 4.0 means XBMC Gotham, that's in the plan but it means also that PlexInc has to merge with Gotham :)

Ahh ok. Version 3.2.4 of openelec fixed the DTS-ES problem anyway I think, something to do with the old kernal.

We have two options there regarding transcoding, i have seen that subtitles can be directly included in video with transcoder or they can be rendered by RPI.

I am not sure yet which is the best way to go as i dont have much subititles medias on hand :)

Mereged subtitles have always been absolutey fine for me on the raspberry pi.  

All mine with subtitles are MKV files with merged subtitles and these are easily selected in the menu.

Not so sure about external subtitles like .srt files etc... but i think these are ok too and don't need transcoding

 


When a media is played, RasPlex checks for the following conditions :

  • Is the video codec known ? (h264, mpeg4)
  • Is the audio codec known (aac, ac3, mp3, dca (DTS), flac) ?
  • Is the video bitrate reasonnable ( < 20 Mbits) ?

Is xvid included under mpeg4 ? because xvid plays natively without problems.


#28


Is xvid included under mpeg4 ? because xvid plays natively without problems.

I'm not sure as i dont have any xvid sample. I'll try to find one and see if its coming as mpeg4.

You can check the exact codec seen by PMS if you go on PMS -> select your movie -> information -> this displays the video codec and audio codec determined by PMS. Please have a look at it and lemme know if it shows mpeg4 or something else :)


#29
Video
  • Codec MPEG4
  • Bitrate 978 kbps
  • Bit Depth 8
  • Bvop 1
  • Chroma Subsampling 4:2:0
  • Codec I D XVID
  • Color Space yuv
  • Duration 40:58
  • Frame Rate 25.000 fps
  • Gmc 0
  • Height 352
  • Qpel 0
  • Scan Type progressive
  • Width 640

And that plays perfectly :)


#30

is this coming from PMS ? 


#31

Capture-2.jpg

yeah plex web interface


#32

would you mind copy paste what you have by clicking on the "View XML" just at the bottom of the window ? 


#33


#34

xml.jpg

might be easier to read like that


#35

Yeah thanks,

This file is mpeg4 / ac3 :)