"Stream HVEC is not hvc1" -- HVEC transcoding does not work at all

I have a channels dvr server running version 2023.05.19.2045 on an HP EliteDesk 800 G4 Mini:

HP HP EliteDesk 800 G4 DM 35W (TAA)
Linux Ubuntu
22.04 (kernel: 5.19.0-45-generic)

CPU

6 cores / Intel(R) Core(TM) i5-8500T CPU @ 2.10GHz

I have "Use HEVC for transcoding" enabled as the 8th Gen 8500T processor should be able to encode HVEC.

When I attempt to play "regular" recordings made earlier from a HDHomeRun -- remotely on an IOS device with up to date channels software -- I get the following errors in the logs:

"[HLS] ffmpeg: file62-bf47e2f7ff4f: [hls @ 0x8c23500] Stream HEVC is not hvc1, you should use tag:v hvc1 to set it."

Is this a boot options flag item or something I can set in Ubuntu ?

EDIT: When watching a live TV channel I get the following errors:

Starting encoder for ch27.1 in /home/bb/dvrmedia/Streaming/ch27.1-dANY-bf47e2f7ff4f-3263759685/encoder-15-2528608853 at 15 (26.526333) (encoder=hevc_vaapi, resolution=1080, deinterlacer=hardware, bitrate=4848, segment_size=0.01)
2023/06/25 23:40:43.340990 [HLS] ffmpeg: ch27.1-dANY-bf47e2f7ff4f-14-hevc-aac-copy--4848-384-1080-6-0---false-false-0.01-0: [hls @ 0x8d30340] Stream HEVC is not hvc1, you should use tag:v hvc1 to set it.

EDIT 2:
Updating to latest beta - 2023.06.23.0108 -- did not fix the problem

It's just a warning and can be ignored

There is a real problem here -- turning on HVEC transcoding does not work "at all"

I should have made that clearer --

This is running on linux with an 8th gen intel processor.

The streaming does not start up with HVEC enabled.

Streaming then works fine with HVEC disabled.

Hardware Transcoder Probe
×Close
amf
[Parsed_color_0 @ 0x323a200] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from 'color=black:640x480':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_amf))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0x326aa00] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1
[h264_amf @ 0x3266540] DLL libamfrt64.so.1 failed to open
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
exit status 1
nvenc
[Parsed_color_0 @ 0x3140200] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from 'color=black:640x480':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0x3189f80] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1
[h264_nvenc @ 0x316c100] Cannot load libcuda.so.1
[h264_nvenc @ 0x316c100] Nvenc unloaded
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
exit status 1
vaapi+deint
[AVHWDeviceContext @ 0x9107340] libva: VA-API version 1.16.0
[AVHWDeviceContext @ 0x9107340] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x9107340] Initialised VAAPI connection: version 1.16
[AVHWDeviceContext @ 0x9107340] VAAPI driver: Intel i965 driver for Intel(R) Coffee Lake - 2.4.0.pre1 (2.4.0.pre1).
[AVHWDeviceContext @ 0x9107340] Driver not found in known nonstandard list, using standard behaviour.
[Parsed_color_0 @ 0x9116d00] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from 'color=black:640x480':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0x9144a00] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1
[auto_scale_0 @ 0x9147240] w:iw h:ih flags:'' interl:0
[trim_in_0_0 @ 0x9145500] auto-inserting filter 'auto_scale_0' between the filter 'graph 0 input from stream 0:0' and the filter 'trim_in_0_0'
[auto_scale_0 @ 0x9147240] w:640 h:480 fmt:yuv420p sar:1/1 -> w:640 h:480 fmt:nv12 sar:1/1 flags:0x0
[Parsed_deinterlace_vaapi_2 @ 0x9143e80] Picking 4 (MotionCompensated) as default deinterlacing mode.
Output #0, null, to '/dev/null':
Metadata:
encoder : Lavf59.16.100
Stream #0:0: Video: wrapped_avframe, 1 reference frame, vaapi(tv, progressive), 640x480 (0x0) [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn
Metadata:
encoder : Lavc59.18.100 wrapped_avframe
No more output streams to write to, finishing.
frame= 2 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.12 bitrate=N/A speed=15.9x
video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (color=black:640x480):
Input stream #0:0 (video): 4 packets read (1843200 bytes); 4 frames decoded;
Total: 4 packets (1843200 bytes) demuxed
Output file #0 (/dev/null):
Output stream #0:0 (video): 2 frames encoded; 2 packets muxed (896 bytes);
Total: 2 packets (896 bytes) muxed
success!
vaapi@/dev/dri/renderD128
[AVHWDeviceContext @ 0x91d4280] libva: VA-API version 1.16.0
[AVHWDeviceContext @ 0x91d4280] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x91d4280] Initialised VAAPI connection: version 1.16
[AVHWDeviceContext @ 0x91d4280] VAAPI driver: Intel i965 driver for Intel(R) Coffee Lake - 2.4.0.pre1 (2.4.0.pre1).
[AVHWDeviceContext @ 0x91d4280] Driver not found in known nonstandard list, using standard behaviour.
[Parsed_color_0 @ 0x91e3d00] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from 'color=black:640x480':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0x9210280] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1
Output #0, null, to '/dev/null':
Metadata:
encoder : Lavf59.16.100
Stream #0:0: Video: wrapped_avframe, 1 reference frame, yuv420p(progressive), 640x480 (0x0) [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn
Metadata:
encoder : Lavc59.18.100 wrapped_avframe
No more output streams to write to, finishing.
frame= 3 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.12 bitrate=N/A speed=4.18x
video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (color=black:640x480):
Input stream #0:0 (video): 4 packets read (1843200 bytes); 4 frames decoded;
Total: 4 packets (1843200 bytes) demuxed
Output file #0 (/dev/null):
Output stream #0:0 (video): 3 frames encoded; 3 packets muxed (1344 bytes);
Total: 3 packets (1344 bytes) muxed
success!
vaapi@/dev/dri/renderD129

Tested using a remote Appletv -- h.264 transcoding works fine. When HVEC transcoding is enabled in the server web interface, remote streaming does not work. Is there a driver that needs to be updated/installed or does this linux distro (lbuntu 22.04) have an issue with HVEC?

Not sure. HEVC is an experimental feature and doesn't work on all hardware.

1 Like

Without the tag apple devices will not recognize the video as a proper hevc stream. The same change had to be made for MCE Buddy a while back.

There are two separate things:

First, the "Stream HEVC is not hvc1" is just a warning that ffmpeg is printing when the imported recording does not have the tag. It does not have any impact on Channels being able to handle or play the file.

Separately, we do set that flag for transcodes we do, but we don't serve HEVC for anything other than our own client, so it won't ever be seen by a standard Apple player.

The bottom line is what @tmm1 said, this feature is experimental and not fully supported across all source video types and DVR hardware configurations because we haven't been able to fully test it across them. It's a lot of work and debugging that we haven't been able to do yet.

1 Like

Thank you @eric. I appreciate the response.

I have been playing with this setting, and Get very mixed results.
Seems to work fine with the web browser streaming.

But, setting my Apple TV app to Home Streaming Xmbps to force transcode, results in no playback at all. With many errors in the logs. Which varies what is output with OTA or TVE channels.

2023/08/07 14:26:34.001060 [ENC] Starting encoder for ch11.1 in E:\CDVR\Streaming\ch11.1-dANY-ip192.168.0.17-1334248920\encoder-9-2807801225 at 9 (8.334267) (encoder=hevc_mf, resolution=1080, deinterlacer=blend, bitrate=7232, segment_size=0.01)
2023/08/07 14:26:34.307511 [HLS] ffmpeg: ch11.1-dANY-ip192.168.0.17-8-hevc-aac-copy--7232-384-1080-6-0--blend-false-false-0.01-0: [hevc_mf @ 0000000002727580] format negotiation failed (1/0)
2023/08/07 14:26:34.318406 [HLS] ffmpeg: ch11.1-dANY-ip192.168.0.17-8-hevc-aac-copy--7232-384-1080-6-0--blend-false-false-0.01-0: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
2023/08/07 14:26:34.319431 [HLS] ffmpeg: ch11.1-dANY-ip192.168.0.17-8-hevc-aac-copy--7232-384-1080-6-0--blend-false-false-0.01-0: [aac @ 00000000027219c0] 2 frames left in the queue on closing
2023/08/07 14:26:34.319431 [HLS] ffmpeg: ch11.1-dANY-ip192.168.0.17-8-hevc-aac-copy--7232-384-1080-6-0--blend-false-false-0.01-0: [aac @ 00000000027eafc0] 2 frames left in the queue on closing
2023/08/07 14:26:34.380063 [ENC] Encoder stopped for ch11.1 in E:\CDVR\Streaming\ch11.1-dANY-ip192.168.0.17-1334248920\encoder-9-2807801225 after starting from 9 without encoding any segme

2023/08/07 14:26:04.720588 [ENC] Starting encoder for ch6072 in E:\CDVR\Streaming\ch6072-dANY-ip192.168.0.17-3408020067\encoder-16-957027908 at 16 (28.683389) (encoder=hevc_mf, resolution=720, deinterlacer=blend, bitrate=7877, segment_size=0.01)
2023/08/07 14:26:05.038421 [HLS] ffmpeg: ch6072-dANY-ip192.168.0.17-15-hevc-copy-copy--7877-0-720-0-0--blend-false-false-0.01-0: [hevc_mf @ 000000000396b6c0] format negotiation failed (1/0)
2023/08/07 14:26:05.049053 [HLS] ffmpeg: ch6072-dANY-ip192.168.0.17-15-hevc-copy-copy--7877-0-720-0-0--blend-false-false-0.01-0: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
2023/08/07 14:26:05.130164 [ENC] Encoder stopped for ch6072 in E:\CDVR\Streaming\ch6072-dANY-ip192.168.0.17-3408020067\encoder-16-957027908 after starting from 16 without encoding any segments
2023/08/07 14:26:05.140989 [ENC] Starting encoder for ch6072 in E:\CDVR\Streaming\ch6072-dANY-ip192.168.0.17-3408020067\encoder-16-1287776404 at 16 (28.683389) (encoder=hevc_mf, resolution=720, deinterlacer=blend, bitrate=7877, segment_size=0.01)
2023/08/07 14:26:05.456381 [HLS] ffmpeg: ch6072-dANY-ip192.168.0.17-15-hevc-copy-copy--7877-0-720-0-0--blend-false-false-0.01-0: [hevc_mf @ 00000000038ab6c0] format negotiation failed (1/0)
2023/08/07 14:26:05.467207 [HLS] ffmpeg: ch6072-dANY-ip192.168.0.17-15-hevc-copy-copy--7877-0-720-0-0--blend-false-false-0.01-0: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
2023/08/07 14:26:05.527057 [ENC] Encoder stopped for ch6072 in E:\CDVR\Streaming\ch6072-dANY-ip192.168.0.17-3408020067\encoder-16-1287776404 after starting from 16 without encoding any segments. Marked segment as failed.

Are there any combinations of hardware & host OS that have been shown to work ok with HEVC?

Gen 9 Intel or later & Ubuntu does not work. ? Gen 9 Intel or later & Windows 10? Gen 9 Intel & MacOS?

From some minor research I have done there seems to be some issues in ffmpeg related to HEVC encoding .. but MacOS and Windows I believe can use different encoding pathways.

I use my DVR server remotely often and getting a 30-50% reduction in streaming bandwidth requirement for live TV could allow me to go to a lower tier of internet service and save some $$.

So far we've been testing the most on macOS on Apple Silicon because that's the setup I have for my main DVR.

1 Like

A HP elitedesk 800 G4 mini can be had refurbished for ~$150. It has an i5-8500T 6 core coffee lake 9.5 gen processor and burns 35 watts. One hour of comskip processing takes ~3 minutes or so. Add a 2TB spinner for around $60 and you have a very decent, inexpensive, small power efficient DVR machine. If only it would do HEVC transcoding.

Perhaps not the best thread for this reply, but can someone explain why there is a push for HEVC for remote streaming?

When doing rips and transcodes of my own disc collection, I compared HEVC with AVC across different types of content and resolutions, and my personal results all showed that for resolutions up to 1080P there was negligible difference in file size. HEVC only showed real benefit for resolutions of 4K and up.

Unless you're planning to remotely stream at 4K, is there any other compelling reason to necessitate HEVC transcoding?

(I am not trying to start a flame war. I am genuinely curious why other users need this feature.)

HEVC's compression allows for much lower file sizes at the same encoding rates as AVC. It's why it's used for 4K video in the first place, so file sizes aren't enormous.

Because of all of this, HEVC offers 2 advantages:

  1. Much higher bitrates at the same file size
  2. Much lower file sizes at the same bitrates

I have a i5-12400 Win 11 and HEVC transcoding works fine. Used it with various other applications and video encoding softwares fine.

Channels, like I mentioned already, very buggy. Though, not sure if it is client side that cause the issues, seems to be. As it works fine in browser in pc but fails to work on my Apple tv

HEVC is far superior to h264 at lower bitrates. I use that for all my encodes. It is also the much more newer and so why not use it.

But the sources Channels is using, dont think it make much difference. Think the use case for many would be to stream lower bitrate use less data and have better image quailty. Though the mew AV1 format may be better designed for that use. But full native support for that codec will take a while

Interesting; my own personal experience has not shown this out for non-4K content. In any case, I'll concede the issue.

My objective is to be able to stream a live ATSC-1 MPEG-2 HDHomeRun (OTA or Prime) capture remotely at "full" quality using maybe 2-3mbps .. That is not possible using H.264. Don't know if it is possible using HEVC. I have no way of trying short of buying a M1 Mac mini to test on.

Is channels DVR using the ffmpeg "hevc_videotoolbox" flag on the mac platform for performing hevc encoding ?

Yes. We use videotoolbox for the hardware encoding on macOS and are using it for both H.264 and HEVC.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.