Jump to content

HEVC Direct play issue


Recommended Posts

Posted (edited)

Hi,

 

I've recently noticed that HEVC direct play do not seems to work anymore...

 

I'm using Windows Server 4.7.11.0, and with latest Adnroid, Windows or XBOX client, any HEVC content are no more played with direct play, but transcoded to H264.

 

Maybe I have missed semething in the configurations.. But this was functional in the past.

 

I do no know exactly when it stopped working.

Test done:

If I'm preventing "Video re-encode if required" for the user... The video is taking more time to start.. But functionning well with direct HEVC play.

 

ffmpeg-transcode-6b58529d-9c4d-401e-981d-a2839de1ff3e_1.txt ffmpeg-remux-ebe6fd12-517d-46a5-b68e-6a194f49a4f2_1.txt

ffmpeg-directstream-604fc4f4-7646-48ed-9c56-f5b92f4370e3_1.txt

Edited by pdeliot
Happy2Play
Posted

@pdeliotDevs will have to comment but looks related to the "CodecTag":"HEVC".  As playback info is limited to "hevc-codectag=hvc1,hev1".

  • Agree 1
Posted

HI, it can still direct play hevc, but only the hevc profiles that the device supports. Does this answer your question?

Posted (edited)

It was working on any tested devices in the past...

 

HEVC is working on all these device when diabling "auto convert" in Emby sever! (as shown in the attached logs.. and properly displayed)

 

All target devices are supporting HEVC...

Tested on:

-Various Samsung phones

-Windows 10 and 11 with HEVC extention (operational on other video player, including Windows film and TV)

-XBOX one, XBOX X

 

It looks like a lack in Emby client HEVC support detection...

ffmpeg-directstream-604fc4f4-7646-48ed-9c56-f5b92f4370e3_1.txt

Edited by pdeliot
Posted
3 hours ago, pdeliot said:

It looks like a lack in Emby client HEVC support detection

Hi.  Actually I believe the issue is what was identified above.  The codec tag on these items is unexpected. 

  • Like 1
GrimReaper
Posted

But what would Codec Tag:HEVC even indicate? Thought that there are only 2 codec tags with main difference between hvc1 and hev1 being where the parameter sets are stored - where does HEVC fall-in there? And it is based on what specs? 

  • Agree 1
Happy2Play
Posted

I will guess a bad encode or non-standard encode as I can't seem to find anything on that "CodecTag":"HEVC".  As the device only technically supports "hevc-codectag=hvc1,hev1".

But yes this can be overridden occasionally depending on differences.

  • Agree 1
Posted

What software encoded these videos?

Darkseidd
Posted

idk about others setup, but this is my setup to ensure DirectPlay is always in place.

 

its been years since last i saw log with *transcode* name on the log's name.

 

 

Screenshot_20230310-003038.png

GrimReaper
Posted
38 minutes ago, Darkseidd said:

idk about others setup, but this is my setup to ensure DirectPlay is always in place.

 

its been years since last i saw log with *transcode* name on the log's name.

 

 

Screenshot_20230310-003038.png

I would assume that you either don't have a very wide variety of clients or you're very meticulous about pre-processing/formatting your media, as that setup would result in trouble-free operation in very limited number of installations, and is way more likely to create additional issues than it is to solve them if it were applied more widely in general. 

  • Agree 1
Posted
46 minutes ago, Luke said:

What was the command line?

Very trivial:

ffmpeg -i myinputfile.mp4 -map 0 -c:v hevc myoutputfile.ts

Using ffmpeg 6.0 on windows.. but the behavior can bee seen with video encoded by 5.1 or older...

Posted (edited)

I've got a mp4/hevc taken from my phone...

Native file format: no transcode

Remuxing (not rencoded) to mp4 with ffmpeg: no transcode

    ffmpeg.exe -i 20221222_133612.mp4 -map 0 -c:a copy -c:v copy T1.mp4

Remuxing (not rencoded) to ts with ffmpeg: transcode

    ffmpeg.exe -i 20221222_133612.mp4 -map 0 -c:a copy -c:v copy T2.ts

Edited by pdeliot
Happy2Play
Posted

My upstanding it should be hev1 by default not "CodecTag":"HEVC".

But sound like you have to add the tag.

ffmpeg -i input-hev1.mp4 -c:v copy -tag:v hvc1 -c:a copy output-hvc1.mp4

ffmpeg - Encode H265 to hvc1 codec - Stack Overflow

1 hour ago, pdeliot said:

Rebuilt  (not rencoded) to ts with ffmpeg: transcode

    ffmpeg.exe -i 20221222_133612.mp4 -map 0 -c:a copy -c:v copy T2.ts

Not enough info as changing containers is not always that simple.

  • Agree 1
Posted (edited)
45 minutes ago, Happy2Play said:

My upstanding it should be hev1 by default not "CodecTag":"HEVC".

But sound like you have to add the tag.

ffmpeg -i input-hev1.mp4 -c:v copy -tag:v hvc1 -c:a copy output-hvc1.mp4

ffmpeg - Encode H265 to hvc1 codec - Stack Overflow

Not enough info as changing containers is not always that simple.

I guess this is the default way for ffmpeg to "tag" HEVC  for some stream containers...

Unfortunatelly  changing the "tagging" (then at least remuxing) on the  12 000+ video files  I have in my library is not an option.

 

And this was not a issue with older Emby versions... Then .. What has changed?

How to make it work without modifiying the files?

 

 

Edited by pdeliot
Happy2Play
Posted
3 minutes ago, pdeliot said:

I guess this is the default way for ffmpeg to "tag" HEVC  for some stream containers...

Unfortunatelly  changing the "tagging" on the  12 000+ video files  I have in my library is not an option.

 

And this was not a issue with older Emby versions... Then .. What has changed?

How to make it work without modifiying the files?

 

 

Will have to test but have never seen that as a tag.  As there is no documentation anywhere on anything that supports it even if you can get it to work.

Can you find any documentation that is a legitimate codec_tag.  But just adding support for something can cause more issues than it is worth also.

Posted
8 minutes ago, Happy2Play said:

Will have to test but have never seen that as a tag.  As there is no documentation anywhere on anything that supports it even if you can get it to work.

Can you find any documentation that is a legitimate codec_tag.  But just adding support for something can cause more issues than it is worth also.

I agree you technically that implementing something out the standard can cause issue...

But.. ffmpeg is the most popular tool to encode video today (including Emby)... 

ffmpeg default implementation can be wrong.. but is probably one of the most used.

 

Secondly: this has always worked with Emby.

I've chosen Emby because it is was open source.. And because it is a great tool.

 

Regarding the way my files are encoded... 

I've chosen HEVC and m2ts, ffmpeg encoder and associated encoding options, after extensive tests of Emby behavior with resulting files...

 

Unfortunately today, I'm facing more and more regression with Emby, including now this one...

 

It is becoming scary to loos all this Investment, and painful..

 

Happy2Play
Posted

Devs and/or experienced encoders will have to comment as I am just going off the togs and what the device says.  Have never seen that codec_tag and can't find anything on it on the internet so to me suggest a problem.  But personally, don't encode anything into ts or utilize it unless the serve is doing it behind the scenes.

But with the little research I have done correcting them defective encoding tagging should resolve the issue.

With testing it appears to the "TS" container as in mkv or mp4 it does not have that codec_tag but still something a dev would have to explain.

Happy2Play
Posted (edited)

Codec is not the problem the tags are.

And neither of those show anything about supported "&hevc-codectag=hvc1,hev1".

@Luke@softworkz

But in a mp4 container the attached file above is "codec_tag_string": "hev1",'

And mkv is "codec_tag_string": "[0][0][0][0]",.

But in a ts container it is "codec_tag_string": "HEVC",.

So this becomes a specific Container issue with the way the TAG is handled.

Only did "-c copy" to change containers.

 

Spoiler

MP4

            "index": 0,
            "codec_name": "hevc",
            "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
            "profile": "Main",
            "codec_type": "video",
            "codec_tag_string": "hev1",
            "codec_tag": "0x31766568",

MKV

            "index": 0,
            "codec_name": "hevc",
            "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
            "profile": "Main",
            "codec_type": "video",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",

 

TS

            "index": 0,
            "codec_name": "hevc",
            "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
            "profile": "Main",
            "codec_type": "video",
            "codec_tag_string": "HEVC",
            "codec_tag": "0x43564548",

 

Edited by Happy2Play
rbjtech
Posted (edited)

The HEVC tag is 'now' valid as that is what ffmpeg (emby + I guess a recent ffmpeg change, just tested the nightly build) has made for TS files.

An older ffmpeg does not use 'HEVC' - it uses codec_tag_string=[36][0][0][0] on the particular ffmpeg version I was testing.

So I think emby just needs to accommodate both - or maybe raise a bug report to ffmpeg to get them to revert it to as it was for TS files ?

Edited by rbjtech
  • Like 1
Posted

Yes we'll have to look into this. Thanks.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...