FireTV 4K Stick Stutter Step Video With Transcoding

The client endpoint is http://${CLIENT_IP}:57000/log. Same for tvOS/iOS/Android.

1 Like

After reproducing the problem, please click Submit Diagnostics on both the server and client.

On the server web UI it's under Help > Submit Diagnostics

On the client it's under Settings > Player

I would be curious if the same thing is happening with Software transcoding enabled on the server.

Thanks, that works for me and shows the FireTV dropping frames like mad, but does not reveal any reason.

Issue does not seem to occur with software based encoding enabled in section " Transcoder Video compression mode used for remote and web-based playback"

Will send diagnostics with hardware re-enabled.

Submitted diags as 042fa633-2e92-41c1-b650-58a1d2b0010d and from FireTV a moment before.
Includes only about 30 seconds video, but plenty of errors.

Thank you. Clearly lots of frames dropped. There seems to be some bad interaction between the nvidia hardware encoder and the FireTV hardware decoder.

Could you submit diagnostics from the player after playing in software decoding mode?

Are the GeForce drivers on the PC up to date?

Can you also run an HWE test and post all the generated logs:

Windows is not aware that there are newer Geforce drivers, but with several versions seemingly in parallel, it can be hard to tell. They were up to date when I installed the card less than a month ago.

Note also that ffmpeg recently began supporting AMD/Radeon GPUs. I initially encountered this problem using the APU in the Ryzen CPU, so if anything it is the way that ffmpeg configures hardware encoders. Or so it would seem.

2020/05/21 23:08:23.604149 [HWE] Trying h264_amf: C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_amf -profile:v high -level 42 -b:v 400k -maxrate:v 600k -f null -y nul
[Parsed_color_0 @ 00000000025c3e80] 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, 25 tbc
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 @ 00000000038b3500] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[h264_amf @ 00000000026aa5c0] AMF initialisation succeeded via D3D11.
[h264_amf @ 00000000026aaa00] CreateComponent(AMFVideoEncoderVCE_AVC) failed with error 13
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!
2020/05/21 23:08:23.762813 [HWE] Failure: exit status 1
2020/05/21 23:08:23.762813 [HWE] Trying h264_nvenc: C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_nvenc -profile:v high -level 42 -b:v 400k -maxrate:v 600k -f null -y nul
[Parsed_color_0 @ 00000000025a3e80] 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, 25 tbc
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 @ 000000000375ce80] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[h264_nvenc @ 000000000268a5c0] Loaded Nvenc version 10.0
[h264_nvenc @ 000000000268a5c0] Nvenc initialized successfully
[h264_nvenc @ 000000000268a5c0] 1 CUDA capable devices found
[h264_nvenc @ 000000000268a5c0] [ GPU #0 - < GeForce GTX 1660 SUPER > has Compute SM 7.5 ]
[h264_nvenc @ 000000000268a5c0] supports NVENC
Output #0, null, to 'nul':
Metadata:
encoder : Lavf58.29.100
Stream #0:0: Video: h264 (h264_nvenc) (High), 1 reference frame, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 400 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc58.54.100 h264_nvenc
Side data:
cpb: bitrate max/min/avg: 600000/0/400000 buffer size: 800000 vbv_delay: -1
No more output streams to write to, finishing.
frame= 3 fps=0.0 q=24.0 Lsize=N/A time=00:00:00.12 bitrate=N/A speed=0.504x
video:0kB 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 (nul):
Output stream #0:0 (video): 3 frames encoded; 3 packets muxed (226 bytes);
Total: 3 packets (226 bytes) muxed
[h264_nvenc @ 000000000268a5c0] Nvenc unloaded
2020/05/21 23:08:24.143732 [HWE] Successfully encoded using h264_nvenc

Diagnostics under b91bae72-1e8e-4999-bdb4-22bfe6bf009f
with FireTV diag uploaded a moment before.

To be clear I meant web UI set to Hardware, and FireTV set to Video Decoder: Software

Interesting. What did you do to disable the APU and switch to the GPU?

That is what you said, I see now. Will do.
Find it under 8813092e-aee2-4c51-8bac-c819bf54d3a0

When you asked, frankly I could not recall. I think I did the simple thing and disabled the graphic output of the CPU in the BIOS and checked to see that the NVIDIA cpu was being used for plex transcodes, since that was the immediate target.
I see also that the correct (NVIDIA) GPU is being used for Channels under the performance tab of the task manager (especially when many sessions are active).

BTW, I ran across this issue in Channels, decided Plex might be a better alternative, then eventually discovered that they cannot handle merging channels from two viewing areas (Austin and San Antonio, in my case). So, that capability of Channels brought me back.

Thanks! I have all the information we need to investigate further.

One more thing you can try is the Old Transcoder checkbox in the experimental section at the bottom of the web UI

I gave it a shot earlier this evening. There was no apparent difference.

Thanks.

Given every other device works fine, there's something specific to the FireTV causing issues. Amazon has promised us several fixes to their hardware h264 decoder by the end of Q2, so that could be the root cause. I am surprised to see you're also seeing framedrops when using software decoding, but that might be a CPU limitation. Does it work any better at lower resolutions like 480p?

Yes, software decode does work quite a bit better at smaller sizes. The log seems to have few if any drops at 2Mbps 480p and it looks good visually.

1 Like

Great, sounds like we have narrowed down the issue. I'm hopeful this will be resolved with the next FireTV firmware update

That is good news. According to that thread, it could be any day, week or month now :wink: 'Q2'.

Do so few people use NVIDIA/AMD hardware transcoding that I am alone in encountering this issue? Is it reproducible for you?

The nvidia/AMD encoder support is much newer than the others, and not as well tested in our community. But there are users like @smswings14 and @thechannels using Quadros with a lot of success.

Personally I do not have a PC or any AMD/NVIDIA GPUs. I do most of my development on Mac and Linux and use Windows VMs for testing when necessary.

Given that the TiVo streamer has no issues with the encoded stream from you GeForce, this does seem like more of a FireTV stick specific issue.

Thanks for your help. I should count myself lucky not to have been waiting from the start of that thread almost a year ago.

Waiting is.

And I have a couple of TiVo 4K streamers in the meantime.

Wow! Glad I asked what the problem is.