Project

General

Profile

Transcoding problem = codec problem?

Added by ma pomme over 8 years ago

Hello,

I have installed TVHeadend on Debian Wheezy.

When I watch TV with Kodi on another PC on my home network, it works fine.

But when I watch TV on the same PC with TVHeadend web interface, it stutters lot.
It does the same on my Android phone.

I think it happens because Kodi transcode the stream better than TVHeadend.

Do I have to install codecs on the Debian TVHeadend server?

What else can I do?


Replies (2)

RE: Transcoding problem = codec problem? - Added by Jonathan Thomson over 8 years ago

By default, TVHeadend does NOT transcode the data used by Kodi - in most cases the raw transport stream is simply repackaged into the htsp format and fed straight to Kodi - this barely registers CPU time as it's not re-encoding just changing the container format effectively.

The web interface however is different - the HTML 5 player that is used has very limited support for video and audio codecs so the stream HAS to be transcoded for it to even show in the player. You cannot pass a raw stream to the web player, it just won't work.

To further complicate things, each browser has different levels of support for video and audio codecs contained within a HTML5 video stream.

The stuttering is simply because your PC can't cope with transcoding the stream in realtime.

There is one very simple thing you can try but if this doesn't work you need to think about your hardware specs (or, use a player that supports either the "htsp" profile or the "pass" profile, neither of which employ transcoding);

1) Start the video stream in the web interface - ignore the fact that it's stuttering, we don't care for now
2) Now, with the player still open, click on the Status > Subscriptions tab and make a note of the profile that is in use by the HTML 5 player
3) You can now stop the video
4) Next go to Configuration > Stream and click on the profile name you discovered in step 2
5) Alter the 'Video Codec Preset' by changing it to something higher up the list (so if it's currently set to "Fast", try ."Faster" or "Fastest" etc.
6) Retry the video in the web interface
7) Repeat until you find a codec speed that works well with your machine

There are lots of combinations for transcoding which can make performance better (and worse if you get it wrong) but generally the default settings should work and if they don't it points towards an underspec'd machine.

As an example, by changing the 'webtv-h264-aac-matroska' profile (the default for the web interface normally) from 'Faster' to 'Ultrafast' I halved the amount of CPU time required with no noticeable loss in quality.

You will need to do the above steps again but instead of using the web interface, use your Android app to make sure you alter the settings for the correct profiles as they may be different.

StreamProfile.png (1.28 MB) StreamProfile.png Screenshot showing the stream profile currently in use when using the web video player
StreamProfile2.png (317 KB) StreamProfile2.png The settings for the profile currently in use - make the changes here

RE: Transcoding problem = codec problem? - Added by ma pomme over 8 years ago

Hello Jonathan,

Thank you for your detailed answer.

I will follow your advices and tell you if I succeed.

    (1-2/2)