FAQ  •  Register  •  Login

Issues playing h265 HEVC video on Samsung TV

<<

Rumbles

Streaming enthusiast

Posts: 31

Joined: Sun Sep 02, 2012 12:39 am

Post Mon Apr 25, 2016 7:32 pm

Issues playing h265 HEVC video on Samsung TV

Hi,

I've recently hit some issues playing back media files, they're pretty much always HEVC x265 videos. I'm trying to play them on my Samsung E series TV, I have the profile set on my TV, when I play them through the menu on the TV the files play back but they're so choppy they're unwatchable (green and pixelated bars across the screen). When I play them via UPnP on my phone, the device tells me they're not supported (but my UPnP device is also using the Samsung E series profile).

I've seen this post: viewtopic.php?f=10&t=21948 it seems to describe a similar issue, but there was no resolution.

I first tried updating serviio, and recompiling ffmpeg, with x265 support:

ffmpeg version N-79154-ga55c953 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265

This seems to work fine for most files, but not the HEVC files.

I've attached a copy of debug logs from me starting up serviio, trying to play the file through the Samsung TV menu (it takes a few seconds to start up then plays all choppy) I then tried to play back using my phone and it turned my request down.

I noticed after I had finished playing that the init script I use doesn't stop serviio, so I had to kill it, when I did this I noticed the ffmpeg session that should have stopped when I stopped playing back the video was still running:

serviio 14943 14771 99 20:13 pts/1 00:01:34 ffmpeg -threads auto -i /media/storage/share/Media/TVShows/11.22.63/Season 1/11.22.63 - S01E02 - The Kill Floor.mkv -y -threads auto -c:v mpeg2video -pix_fmt yuv420p -b:v 15360k -maxrate:v 15360k -bufsize:v 15360k -r 24000/1001 -g 15 -c:a ac3 -b:a 192k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /tmp/Serviio/transcoding-temp-2501-sam_ef-ORIGINAL.stf

Strange... it seems to hang around until I kill the main serviio process.

Anyway, any suggestions as to how to fix HEVC video transcoding I would appreciate the help!
Attachments
serviio.tar
Tarred serviio.log
(404.75 KiB) Downloaded 296 times
<<

atc98092

User avatar

DLNA master

Posts: 3467

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Mon Apr 25, 2016 10:41 pm

Re: Issues playing h265 HEVC video on Samsung TV

What sort of hardware are you running on your Serviio box? It could be the CPU can't keep up with the transcoding.
Dan

Panasonic ST30 Plasma, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku 4, Ultra and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 8 gig ram, Windows 10 Pro, 18 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

Rumbles

Streaming enthusiast

Posts: 31

Joined: Sun Sep 02, 2012 12:39 am

Post Tue Apr 26, 2016 6:41 am

Re: Issues playing h265 HEVC video on Samsung TV

Hi and thanks for the reply, I'm running this on an AMD N36L Dual core 1.3GHz. Running htop when I play the video file takes my machine from idling around with a load around 0.1-0.2 to max out the CPUs. So I guess you're right, it's maxing out my CPU when I'm trying to play video.

So I tested an x264 video, playing to the same device and ffmpeg didn't even start up, but looking at the profile it should be transcoded... I was hoping to see how much of a difference it would make in playing a video format that works normally against one that is transcoded from h265, but I think most of the video I have is h264, so I'm doubtful I can find one easily to demonstrate with this morning.

Would you recommend I try recompiling ffmpeg again with more up to date sources? I built it about a month ago, so I guess it's unlikely there are many performance improvements...

Is there anything else you can suggest, short of upgrading the CPU in my venerable server...?

Finally, looking back to my OP I see in the ffmpeg process that starts up it doesn't look like it's using the libx265 codec when playing as it has "-c:v mpeg2video", am I right? Is there any way to make sure it uses 265?
<<

atc98092

User avatar

DLNA master

Posts: 3467

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Tue Apr 26, 2016 12:20 pm

Re: Issues playing h265 HEVC video on Samsung TV

I'm unfamiliar with the Samsung E series, but it's possible that it plays H264 without transcoding if the level is low enough. Since it appears to play without FFMPEG being called, that would seem to be the case.

I don't think recompiling FFMPEG would make much difference. Yours is recent enough to have H265 support.

That transcoding line is telling FFMPEG to convert the H265 to MPEG2 video. That's what the -c:v line does. It's using the libx265 codec or it wouldn't be able to transcode. The mpeg2video is the output of the file, not the library used to transcode.

I haven't experimented much yet with H265, as I have two devices that support it. I'll need to play an h265 file on one of my boxes that requires transcoding and see what it does to my CPU load. It's possible that your box just can't keep up. My test server has more power than yours, and sometimes it can't keep up with transcoding HD for my Roku 2.

You might try starting playback, then pausing the video to give the computer some time to get ahead of the transcoding. If playback is smooth for a while after you resume, you've identified the issue, lack of power. There's only two options to that. Either upgrade the computer or convert all your videos into a codec that doesn't require transcoding. Looks like H264 would be a good choice. If transcoding isn't necessary, it takes very little computer power to stream the video.
Dan

Panasonic ST30 Plasma, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku 4, Ultra and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 8 gig ram, Windows 10 Pro, 18 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

Rumbles

Streaming enthusiast

Posts: 31

Joined: Sun Sep 02, 2012 12:39 am

Post Tue Apr 26, 2016 6:06 pm

Re: Issues playing h265 HEVC video on Samsung TV

Hi,

Again thanks for the response.

I tried starting the transcode, pausing the playback, then pressing play again after a minute and when it restarted the quality was just as bad as it had been before I paused it.

So then I tried taking the ffmpeg process shown with "ps -ef | grep ffmpeg" and ran that as a separate process just to see how fast it was able to transcode the file, and it happily ran at 27-31 fps, mostly sitting on 29fps. I'm still not sure why this process continues after I have stopped playback, possibly because the server is maxed out and the trigger to stop the job never gets back to serviio, so it continues transcoding the file...?

According to the info printed out by ffmpeg the file had an average fps of 23.98, so in theory the machine should be able to keep up with the transcoding process. This is the info that's shown currently:

ffmpeg -threads auto -i /media/storage/share/Media/TVShows/11.22.63/Season\ 1/11.22.63\ -\ S01E02\ -\ The\ Kill\ Floor.mkv -y -threads auto -c:v mpeg2video -pix_fmt yuv420p -b:v 15360k -maxrate:v 15360k -bu[4/227]
15360k -r 24000/1001 -g 15 -c:a ac3 -b:a 192k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /media/storage/share/Media/TVShows/Test/testing.stf
ffmpeg version N-79154-ga55c953 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-li
bfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 32.100 / 57. 32.100
libavformat 57. 29.101 / 57. 29.101
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 40.102 / 6. 40.102
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, matroska,webm, from '/media/storage/share/Media/TVShows/11.22.63/Season 1/11.22.63 - S01E02 - The Kill Floor.mkv':
Metadata:
CREATION_TIME :
ENCODER : Lavf55.12.0
Duration: 00:53:52.25, start: 0.000000, bitrate: 450 kb/s
Stream #0:0: Video: hevc (Main), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
Stream #0:1(und): Audio: aac (HE-AAC), 48000 Hz, stereo, fltp (default)
Metadata:
title : Stereo
LANGUAGE : und
[AVFilterGraph @ 0x44fa060] [Eval @ 0x7ffe6deb8520] Undefined constant or missing '(' in 'auto'
[AVFilterGraph @ 0x44fa060] Unable to parse option value "auto"
[AVFilterGraph @ 0x44fcce0] [Eval @ 0x7ffe6deb8520] Undefined constant or missing '(' in 'auto'
[AVFilterGraph @ 0x44fcce0] Unable to parse option value "auto"
[mpeg2video @ 0x4501cc0] impossible bitrate constraints, this will fail
Output #0, mpegts, to '/media/storage/share/Media/TVShows/Test/testing.stf':
Metadata:
encoder : Lavf57.29.101
Stream #0:0: Video: mpeg2video (Main), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 15360 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default)
Metadata:
encoder : Lavc57.32.100 mpeg2video
Side data:
cpb: bitrate max/min/avg: 15360000/0/15360000 buffer size: 15360000 vbv_delay: -1
Stream #0:1(und): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
title : Stereo
LANGUAGE : und
encoder : Lavc57.32.100 ac3
Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> mpeg2video (native))
Stream #0:1 -> #0:1 (aac (native) -> ac3 (native))
Press [q] to stop, [?] for help
key function= 29 q=2.0 size= 732326kB time=00:19:23.16 bitrate=5157.7kbits/s speed=1.23x


At the end I got:

No more output streams to write to, finishing.=00:53:51.03 bitrate=3817.9kbits/s speed=1.31x
frame=77494 fps= 31 q=2.0 Lsize= 1505956kB time=00:53:52.22 bitrate=3816.8kbits/s speed=1.31x
video:1308915kB audio:75753kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.759377%
Input file #0 (/media/storage/share/Media/TVShows/11.22.63/Season 1/11.22.63 - S01E02 - The Kill Floor.mkv):
Input stream #0:0 (video): 77494 packets read (142212702 bytes); 77494 frames decoded;
Input stream #0:1 (audio): 75753 packets read (38785537 bytes); 75753 frames decoded (155142144 samples);
Total: 153247 packets (180998239 bytes) demuxed
Output file #0 (/media/storage/share/Media/TVShows/Test/testing.stf):
Output stream #0:0 (video): 77494 frames encoded; 77494 packets muxed (1340328874 bytes);
Output stream #0:1 (audio): 101004 frames encoded (155142144 samples); 101004 packets muxed (77571072 bytes);
Total: 178498 packets (1417899946 bytes) muxed


I then tried playing that file, VLC played it fine, playing via Bubble UPnP on my TV it played fine, and playing it directly from the TV it plays fine.

So it appears that my server can transcode the file fast enough to play it back on my TV, but it doesn't work when I attempt it.

Also, I'm still not able to play these h265 files via Bubble UPnP even though this device is set with the same profile as the TV, can you explain why that would be? A log of me attempting to play the same file should be in the original log dump I posted.
<<

atc98092

User avatar

DLNA master

Posts: 3467

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Wed Apr 27, 2016 12:33 pm

Re: Issues playing h265 HEVC video on Samsung TV

As to why FFMPEG continues after playback has been stopped, that's the way it works normally. Serviio only triggers FFMPEG to stop if another (different) video is requested from the same player. It will continue transcoding until it either finishes the file, or another request is made.

Here's another thing to try. Let the transcoding continue until the file is completed. Then go to your transcoding folder and find the file. It will have an .STF file extension. Change the extension to .MPG (and also name the file with the movie name) and copy the file into your folder where your videos are. Once it's been added to your Serviio library, try playing that file. It should not trigger FFMPEG, as it's already been transcoded. This way we can make sure it is streaming properly when transcoding isn't necessary.

Also, just a thought. Your set is older, so it isn't running the Tizen OS. But, for the latest TVs transcoded files will not play for some unknown reason. I don't know if it's something Samsung did in their firmware, or if it's specific to Tizen. If it's firmware related, it's possible (unlikely, but possible) that the older TV versions are affected as well. My JU7100 will play lots of files without transcoding. But my WTV files will not play, so Serviio transcodes. They still won't play, although when I do what I mentioned above (copying the transcoded file) it plays fine. Zip has been unable to figure out what Samsung did.
Dan

Panasonic ST30 Plasma, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku 4, Ultra and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 8 gig ram, Windows 10 Pro, 18 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

Rumbles

Streaming enthusiast

Posts: 31

Joined: Sun Sep 02, 2012 12:39 am

Post Wed Apr 27, 2016 3:06 pm

Re: Issues playing h265 HEVC video on Samsung TV

Hi,

Thanks for the reply.

Thanks for clarifying that transcoding behaviour is expected!

I did this (kind of) by manually. As I mentioned in the previous post, I ran the ffmpeg process manually and moved that file to somewhere visible to serviio, and it played fine. I just checked and the file I transcoded earlier was still in my tmp folder, so I have moved that in to my Media drive, and I can test that as well when I get home.

When I did this with the manually created file it played fine, but I can test again later with the file serviio created file and confirm.
<<

Rumbles

Streaming enthusiast

Posts: 31

Joined: Sun Sep 02, 2012 12:39 am

Post Wed Apr 27, 2016 7:29 pm

Re: Issues playing h265 HEVC video on Samsung TV

Hi,

I tried both the files left over in the tmp folder, moved them to my main media volume and changed the name and they played fine.

Any other suggestions?
<<

atc98092

User avatar

DLNA master

Posts: 3467

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Thu Apr 28, 2016 12:24 pm

Re: Issues playing h265 HEVC video on Samsung TV

Rumbles wrote:Hi,

I tried both the files left over in the tmp folder, moved them to my main media volume and changed the name and they played fine.

Any other suggestions?


I'm afraid it is sounding just like my JU series, in that it just won't play transcoded files. I don't know what Samsung did to their firmware. Maybe Zip has discovered the problem and figured out a solution.
Dan

Panasonic ST30 Plasma, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku 4, Ultra and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 8 gig ram, Windows 10 Pro, 18 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

Rumbles

Streaming enthusiast

Posts: 31

Joined: Sun Sep 02, 2012 12:39 am

Post Thu Apr 28, 2016 7:41 pm

Re: Issues playing h265 HEVC video on Samsung TV

That's pretty disappointing, how would there even be a differentiation between a file that is currently being transcoded with a file that has been fully transcoded before playback started?

Thanks for the help though!

Return to Samsung

Who is online

Users browsing this forum: No registered users and 4 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.