Jump to content

Fire Stick 4k Max - Random video freeze on some H.264 files


ExpedientFalcon
Go to solution Solved by ExpedientFalcon,

Recommended Posts

ExpedientFalcon

I and family members have encountered, on two different Fire Stick 4k Max devices, for multiple different H.264 videos. that at a random point in playback, the audio will continue playing, but the video will freeze. This will consistently occur at the same point in the video, for each video where it occurs, but it does not occur on every video. I have attempted things such as remuxing mkv -> mp4 or mp4 -> mkv, which does not resolve the issue. I have my server configured to allow Direct Play only--this is on LAN, and the Fire Stick 4k Max should support direct play for every video and audio format I have on the server. I have not been able to find a pattern distinguishing the broken files from files that playback from start to end.

I have not found anything related to the issue in the server logs. I have sent logs from the Emby client on the Fire Stick. Server name is sylvanas, local user is Josh, log sent around 6:03 AM UTC. Thanks.

Link to comment
Share on other sites

chef
10 minutes ago, ExpedientFalcon said:

I and family members have encountered, on two different Fire Stick 4k Max devices, for multiple different H.264 videos. that at a random point in playback, the audio will continue playing, but the video will freeze. This will consistently occur at the same point in the video, for each video where it occurs, but it does not occur on every video. I have attempted things such as remuxing mkv -> mp4 or mp4 -> mkv, which does not resolve the issue. I have my server configured to allow Direct Play only--this is on LAN, and the Fire Stick 4k Max should support direct play for every video and audio format I have on the server. I have not been able to find a pattern distinguishing the broken files from files that playback from start to end.

I have not found anything related to the issue in the server logs. I have sent logs from the Emby client on the Fire Stick. Server name is sylvanas, local user is Josh, log sent around 6:03 AM UTC. Thanks.

I'm pretty sure they'll want to see the ffmpeg logs (the server generates) from when the stream was happening.

Does the file act the same way when you watch it on any of your own devices?

 

Link to comment
Share on other sites

ExpedientFalcon

I gave a couple of the problem files a test on the Windows Desktop client, watched through a few minutes past the point where they froze on the Fire Stick, and didn't encounter the same issue on the Windows client.

Since the file is going through Direct Play, there seems to be no ffmpeg log. The emby server log shows no unusual messages--only the normal "Playback started" message. It does not show a "Playback stopped" message until I manually stop playback.

Edited by ExpedientFalcon
Link to comment
Share on other sites

chef
8 hours ago, ExpedientFalcon said:

I gave a couple of the problem files a test on the Windows Desktop client, watched through a few minutes past the point where they froze on the Fire Stick, and didn't encounter the same issue on the Windows client.

Since the file is going through Direct Play, there seems to be no ffmpeg log. The emby server log shows no unusual messages--only the normal "Playback started" message. It does not show a "Playback stopped" message until I manually stop playback.

In some cases clients may request a higher bit rate then what the users internet connection can actually handle. This would cause playback issues.

What is strange is that the audio continues but the pictures freezes.

You could ask you friend to use the gear icon, found in the playback OSD on the fireTV interface, and lower the play back quality/bitrate. 

You could tell them to keep it at 1080p (or whatever the quality is), but drop the bitrate to 10-15mb/s.

You can also limit their request bitrate in the user options on the server.

This will stop their clients from requesting too much. 

In some cases this might cause transcoding.

Link to comment
Share on other sites

9 hours ago, ExpedientFalcon said:

I have sent logs from the Emby client on the Fire Stick

Hi.  Exactly what happened in these logs from your perspective?

I cannot see any sort of error on the client side.

Link to comment
Share on other sites

9 hours ago, ExpedientFalcon said:

I have my server configured to allow Direct Play only

If you re-enable the ability to remux and transcode, does the issue go away?

Link to comment
Share on other sites

ExpedientFalcon

Yes, if I enable remuxing, then I can click the "Playback Correction" in the app to force switch to Direct Stream, and the issue no longer occurs. I checked the ffmpeg command that runs, it does not convert the video or audio, only remuxes to .ts, yet this is enough to resolve it somehow. (Although this is still a workaround--I don't want to have to manually click "Playback Correction" every time the issue happens.)

The network bandwidth should not be an issue, this is all over LAN. The fact that it happens at the same point in the video, as well, tells me that this is not an intermittent networking issue. Something odd is going on with the streaming or decoding for these specific files. (To explain a bit better what's going on, on the videos where this occurs, the video will play back for some number of minutes, and then at some point, the video will freeze but audio will continue. In the video I'm currently using for testing, it's at 5:07. In another, it might be at 1:30. In one case it was as late as 50 minutes into the video. But it's not random, it's 100% reproducible at the same point in the video each time.)

Here are the server log with debug enabled for the Direct Play only stream, which shows nothing unusual (the video freeze occurs around 12:17:35), and the ffmpeg Direct Stream log which doesn't seem to show any errors or warnings during remuxing either.

Edited by ExpedientFalcon
Link to comment
Share on other sites

rbjtech

If you can re-produce at exactly the same point in the video, then it's almost certainly a corrupt video - not enough to throw the stream/remux, but enough to stall the video.

I have a 4K Max and it's playing an 80Mbit HEVC from a 4K Remux - which tbh surprised me, but it played it without issue (via a USB Ethernet 100Mbit adapter).

If you are on wifi - then the only other thing it could be is a higher than normal PEAK in network usage,  ie a very demanding change of scene - which may overload your wifi if the signal is borderline.

Link to comment
Share on other sites

What are the bitrates of these videos?  And, when the issue occurs is it in a part of the video that is likely to have a spike in the VBR?

Link to comment
Share on other sites

ExpedientFalcon

The bitrates vary, but the lowest bitrate one I've seen it occur on was a ~4Mbps 720p encode, and the freeze happened during a low-motion scene. So there doesn't seem to be a bitrate-related pattern.

I was considering that it could be some video corruption issue. But it seems odd because this is happening for a large number of videos. One pattern I have noticed is that the videos with issues all seem to be older encodes that I migrated from Plex some time ago (which, the set-top app I was using for it was much stricter and required Level 4.1 or below H.264). Which made me think possibly there's some encoder setting I used that doesn't play well with the Fire TV player. However, I didn't see anything obvious like open-gop or a huge number of ref frames. The other thing is that I think (although I'm not 100% certain) that they are all using AAC, but I don't know why this would be an issue, as I've played back other files in my library using H.264 and AAC with no problem.

Here's the mediainfo output from one of the files exhibiting the issue. They all seem to have encoder settings similar to this.

General
Complete name                            : The Boss Baby (2017).mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 4.13 GiB
Duration                                 : 1 h 37 min
Overall bit rate                         : 6 058 kb/s
Writing application                      : Lavf58.45.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings                          : CABAC / 5 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 5 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 1 h 37 min
Bit rate                                 : 5 590 kb/s
Width                                    : 1 920 pixels
Height                                   : 816 pixels
Display aspect ratio                     : 2.35:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.149
Stream size                              : 3.81 GiB (92%)
Writing library                          : x264 core 152 r2860 e55f2d0
Encoding settings                        : cabac=1 / ref=5 / deblock=1:-2:-2 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / fade_compensate=0.50 / psy_rd=1.00:0.20 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-3 / threads=12 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=5 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=18.0000 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=40000 / vbv_bufsize=30000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=3:1.00
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 37 min
Bit rate mode                            : Constant
Bit rate                                 : 460 kb/s
Channel(s)                               : 6 channels
Channel layout                           : C L R Ls Rs LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 321 MiB (8%)
Language                                 : English
Default                                  : Yes
Alternate group                          : 1

 

Link to comment
Share on other sites

  • 2 weeks later...
ExpedientFalcon

Thanks for the advice. I gave it a try in the Android app on my Fire Stick, and it has the same problem. Both of my Fire Sticks (both the 2021 4K Max) exhibit the same issue, at the same place in the same videos. However, I tried it on the Android app on my Galaxy Tab S7, and that plays the files back successfully.

Link to comment
Share on other sites

RanmaCanada

I think it's an issue with the 4k Max, as I've noticed that it will sometimes just freeze while in Emby for no reason whatsoever.  It's annoying as hell, as when I play the same file on my Roku it works, Emby Theatre it works, my Chinese Android box it works, my regular 4k firestick it works.  It is pretty consistent in that you can rewind the media and it will freeze again in the same freaking place.  It's just with the 4k Max.  It is using a new SOC so it's possible it might have some issues that need to be ironed out with updates.

  • Like 1
Link to comment
Share on other sites

ExpedientFalcon

I contacted Amazon via their feedback email address to report the issue, as it does seem like it is an issue related to hardware decoding on the 4k Max. Unfortunately, Amazon does not provide any response to feedback reports, so I'm in the dark as to when or if they will fix it. I'm not sure if there's a workaround that can be done on Emby's side, other than using conversion without transcoding.

Link to comment
Share on other sites

rbjtech

Is it possible to post a link to a sample of an offending file when the glitch happens ? - you said in your first post that you can reproduce the issue after remuxing - so a sample file should still retain the glitch.  Maybe use ffmpeg or mkvtoolnix etc to split/slice the file.

I've had no reports of any issues with the 4K Max from my users - This is mainly on 1080p h264/AAC 2.0 files - but also tested a few 4K hevc remux/AC3 without issues.

It does 'sound' like malformed/non-compliant frames within the bitstream - if the issue, survives a remux, then short of re-encoding or a hardware patch on the FireTV, I'm not sure there is a great deal that Emby can do to fix it.

Link to comment
Share on other sites

thefad3done

I am also experiencing this issue on my Amazon Fire 4k TV Max, it either pauses briefly or the sound goes out of sync with the video and I have to use the "playback correction" option. It's occurring far more frequently than it used to, across multiple files which play fine on other clients, including my aging LG TV app which my firestick replaced. 

Link to comment
Share on other sites

ExpedientFalcon
6 hours ago, rbjtech said:

Is it possible to post a link to a sample of an offending file when the glitch happens ? - you said in your first post that you can reproduce the issue after remuxing - so a sample file should still retain the glitch.  Maybe use ffmpeg or mkvtoolnix etc to split/slice the file.

I've attached a cut of the first ~5:30 of the video I've been primarily testing with. The freeze occurs at around 5:08

https://bit.ly/33NZ2la

Interestingly, the reason I had to cut such a large portion is because if I just cut out a small section, or even a minute before the freezing point, the freeze no longer occurs. But it does continue to occur if I cut from the start of the video, even if on playback I seek to right before the freeze. Very odd. (I used mkvmerge in both cases--remuxing with ffmpeg also maintains the freeze, although I have not tried trimming with ffmpeg.)

Edited by ExpedientFalcon
Link to comment
Share on other sites

rbjtech
2 hours ago, ExpedientFalcon said:

I've attached a cut of the first ~5:30 of the video I've been primarily testing with. The freeze occurs at around 5:08

https://bit.ly/33NZ2la

Interestingly, the reason I had to cut such a large portion is because if I just cut out a small section, or even a minute before the freezing point, the freeze no longer occurs. But it does continue to occur if I cut from the start of the video, even if on playback I seek to right before the freeze. Very odd. (I used mkvmerge in both cases--remuxing with ffmpeg also maintains the freeze, although I have not tried trimming with ffmpeg.)

Great - I'll take a look at this tomorrow - thanks :)

Link to comment
Share on other sites

RanmaCanada

I'd like to confirm you're not crazy as the video froze and I was unable to seek or do anything.  Tested on my 4k Max.

  • Haha 1
Link to comment
Share on other sites

rbjtech

Sorry, I didn't have access to my PC over the weekend so couldn't look at this - but if @RanmaCanada confirms it - then you can be certain it's a real problem.. ;)

Will try and look this week - but may not be able to add much to the debate beyond suggesting a re-encode (not a re-mux, as this will just copy the bad frames).

 

  • Thanks 1
Link to comment
Share on other sites

ExpedientFalcon

Yeah, I've been gradually reencoding my library into AV1 (from the original blurays), which plays back perfectly fine on the 4k Max. But it's going to be quite a while to get through all of them, hence still hoping for a solution. :) Really appreciate you taking the time to look into it. Certainly no rush needed.

Edited by ExpedientFalcon
  • Like 1
Link to comment
Share on other sites

rbjtech
18 minutes ago, ExpedientFalcon said:

Yeah, I've been gradually reencoding my library into AV1 (from the original blurays), which plays back perfectly fine on the 4k Max. But it's going to be quite a while to get through all of them, hence still hoping for a solution. :) Really appreciate you taking the time to look into it. Certainly no rush needed.

I haven't even played with AV1 encoding yet but know the 4K Max has h/w accelerated decoding (nice!)

I would be interested in what encoder are you using and the hardware it runs on assuming it's hardware accelerated ?

:)

 

Link to comment
Share on other sites

ExpedientFalcon

I'm currently using aomenc with av1an. I don't have hardware accelerated encoding, but av1an is a tool for chunked encoding which really helps with AV1, since multithreading in both aomenc and rav1e currently doesn't scale very well on its own. As far as performance, at cpu-used=4 I get between 4-7 FPS on 1080p content on my 3700X, depending on content type (animation is faster). cpu-used=6 can go much faster for a ~15% efficiency hit (but still compresses about 25% better than x264 veryslow according to metrics).

Some of us in the community have been focusing on getting it to preserve grain and details better, since one of the biggest complaints is that aomenc blurs a bit by default to favor lower filesize. We have a fork in progress for this purpose and a set of preferred settings for high-bitrate encoding. Feel free to join our community Discord and look around or ask questions too.

Edited by ExpedientFalcon
  • Thanks 1
Link to comment
Share on other sites

RanmaCanada

Once you get it settled, would you mind posting a command line with an explanation of what switches do what?  I've tried to wrap my head around it and no one can tell me how to encode with AV1.  Every time I ask for assistance be it on Doom9 or elsewhere I get hounded by gatekeeping a55holes who say "use this command line and only this command line" and they refuse to tell me why.  There is so little documentation for encoding AV1 that it feels like the community just doesn't want it to be adopted.  I've gotten into a few arguments with a user called BlueSword? who definitely takes the cake in regards to "if you don't understand what I'm telling you and question it, you're an idiot".

 

  • Agree 1
Link to comment
Share on other sites

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...