Jellyfin Forum
H.264 and H.265 unwatchable in browser and Jellyfin Media Player on my Mac - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: H.264 and H.265 unwatchable in browser and Jellyfin Media Player on my Mac (/t-h-264-and-h-265-unwatchable-in-browser-and-jellyfin-media-player-on-my-mac)

Pages: 1 2


H.264 and H.265 unwatchable in browser and Jellyfin Media Player on my Mac - dekomoon - 2023-07-11

I am unable to watch videos transcoded from AV1 to AVC and HEVC on my M1 Macbook Air running MacOS Ventura 13.4.

Because I can't figure out how to get Safari or Chrome to play HEVC content I resorted to AVC on my Mac's Firefox browser, but the colors are really washed out... This happened in other browsers too for AVC.

I also tried Jellyfin Media Player on my mac too. AV1 is unplayable (most of the frames were being dropped), but this was expected. I then tried to transcode to HEVC and AVC, but both stuttered and lagged too, but better than AV1.

I know that my Mac is more capable of playing AV1 and HEVC videos than that though. Because the same 4 minute AV1 video that Jellyfin Media Server was having trouble was downloaded in less than 5 second and played very well with minor stutters (but still annoying). One more thing is that my Mac has an HEVC decoder so it should not even stutter at all...

I also tried playing the video in my Jellyfin host's operating system (Ubuntu). I first tried in Firefox on my Ubuntu machine and AVC color was not washed out (but bitrate sucked so it looked bad either way). Then I tried running Jellyfin Media Player and it ran AV1 and HEVC flawlessly using my RTX 3060's decoder.

What is the problem on my Mac?

(Note: just checked again for the AV1 video I downloaded on Jellyfin Media Server... the colors are washed too... the original video in my server is not washed... I am so confused on why this is happening???)


RE: H.264 and H.265 unwatchable in browser and Jellyfin Media Player on my Mac - TheDreadPirate - 2023-07-12

We will need your jellyfin server logs. And ffmpeg logs. Upload them to pastebin and link them here.


RE: H.264 and H.265 unwatchable in browser and Jellyfin Media Player on my Mac - dekomoon - 2023-07-12

(2023-07-12, 12:48 AM)TheDreadPirate Wrote: We will need your jellyfin server logs.  And ffmpeg logs.  Upload them to pastebin and link them here.

My apologies. Here are the logs when I try to watch the video on my Mac's Jellyfin Media Player.

Jellyfin Server Log: https://pastebin.com/jxefwcH5
FFmpeg Transcode Log: https://pastebin.com/c6NUrtFg

Hmm this is the first time I have seen this warning, but maybe this warning in Jellyfin server log is the issue?
Code:
jellyfin-jellyfin-1  | [03:03:27] [WRN] [8] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.40.33:8096... to 192.168.40.3 in 0:00:01.6177933 with Status Code 206

Also, I am running Jellyfin inside a docker container. I am running Jellyfin image with the latest tag. Here is the log after inspecting Jellyfin/Jellyfin:latest on my local machine: https://pastebin.com/LkXC3vLE


RE: H.264 and H.265 unwatchable in browser and Jellyfin Media Player on my Mac - dekomoon - 2023-07-12

(2023-07-11, 11:14 PM)dekomoon Wrote: (Note: just checked again for the AV1 video I downloaded on Jellyfin Media Server... the colors are washed too... the original video in my server is not washed... I am so confused on why this is happening???)

On a side note, I figured out the reason why the color was washed out for the downloaded video. It was because I was using a media player (IINA) that does not play well with 10-bit videos. I switched to MPV and colors are correct now when I watch the video after downloading it.

Edit: now that I think about it, maybe direct play AV1 to my Mac might be a better idea too since AV1 is more efficient than HEVC at the same bitrate, plus after changing some settings (like enabling fast-decode option in SVT-AV1) for the videos, I am able to play the video on my Mac smoothly and I do not see any visual degradation to video quality. The only concern I have is that for some reason Jellyfin Media Player lags with all types of codecs (h.264, h.265 and av1). Would love to be able to stream AV1 smoothly if possible.

HEVC will be nice too, but I can not figure out how to increase the bitrate for the transcode above 35kbps (35kbps is the bitrate for the original AV1 video).


RE: H.264 and H.265 unwatchable in browser and Jellyfin Media Player on my Mac - TheDreadPirate - 2023-07-12

Glad you worked out the color issue.

Code:
PlayMethod=Transcode, TranscodeReason=DirectPlayError )

It looks like it tried to direct play, but had to transcode for some reason. It's not clear from the server logs why there was a direct play error. Client side bug?

Can you tell us a bit about your server? Your client is on a Mac, but your server appears to be linux with a Nvidia GPU? What are the full specs of your server?

The ffmpeg logs indicate that transcoding is happening fast enough, but I wonder if it is struggling to transcode AND serve the transcoded files.


RE: H.264 and H.265 unwatchable in browser and Jellyfin Media Player on my Mac - dekomoon - 2023-07-12

Color is still an issue when I play videos on my browser, but I have come to accept it as something MacOS related where browsers can't play 10-bit videos properly sadly. Then again, I have no plans to watch it in the browser as H264 at 35mbps for 4k60 is pretty bad haha.

(2023-07-12, 04:32 AM)TheDreadPirate Wrote:
Code:
PlayMethod=Transcode, TranscodeReason=DirectPlayError )
It looks like it tried to direct play, but had to transcode for some reason.  It's not clear from the server logs why there was a direct play error.  Client side bug?
The reason why is because I forced AV1 transcode on the client side plus specified in client setting that I prefer transcode to H265. When I do not force transcode AV1 videos, I only get the following log:

Code:
jellyfin-jellyfin-1  | deReason=0 ) media:/videos/39153bcb-028c-0c1b-636a-2dd63da8131f/stream.mkv?MediaSourceId=39153bcb028c0c1b636a2dd63da8131f&Static=true&VideoCodec=av1&AudioCodec=flac&AudioStreamIndex=1&api_key=<token>&SubtitleMethod=Encode&Tag=c5e9fe4a7d2644c887695a17391071
jellyfin-jellyfin-1  | 14
However the playback still lags and stutters sadly.

(2023-07-12, 04:32 AM)TheDreadPirate Wrote: Can you tell us a bit about your server? Your client is on a Mac, but your server appears to be linux with a Nvidia GPU? What are the full specs of your server?
Yes gladly! My host/server is running Ubuntu 22.04. Jellyfin is running as a container of the latest official Jellyfin's image. My Docker version is 24.0.4 of build 3713ee1. I passed my GPU to my docker container. Here is my compose file: https://pastebin.com/g82fNhqF


(2023-07-12, 04:32 AM)TheDreadPirate Wrote: The ffmpeg logs indicate that transcoding is happening fast enough, but I wonder if it is struggling to transcode AND serve the transcoded files.
Yes it seems to be transcoding above 60fps. Bitrate is only 35mbps (my apologies on my last reply on my mistake on kbps) so I do not think my network is the problem. Both my host and client is connected to Ethernet with a upload and download speed of 300mbps.


RE: H.264 and H.265 unwatchable in browser and Jellyfin Media Player on my Mac - TheDreadPirate - 2023-07-12

What GPU do you have?


RE: H.264 and H.265 unwatchable in browser and Jellyfin Media Player on my Mac - dekomoon - 2023-07-12

(2023-07-12, 03:38 PM)TheDreadPirate Wrote: What GPU do you have?

RTX 3060 on host. M1 Apple Silicon on client.


RE: H.264 and H.265 unwatchable in browser and Jellyfin Media Player on my Mac - dekomoon - 2023-07-13

I think I should probably create a git issue on GitHub for my problems with Jellyfin Media Server.

However before that, does anyone know how to check what version of the FFmpeg/decoder Jellyfin Media Server uses for decoding? I am suspecting one of the reasons for the bad AV1 performance is because it is using an outdated software decoder version.


RE: H.264 and H.265 unwatchable in browser and Jellyfin Media Player on my Mac - TheDreadPirate - 2023-07-13

It sounds like something with the M1's decoder since it played back fine on the 3060. I'm assuming "flawlessly" also meant the quality was good in addition to it playing smoothly. I've heard mixed things about video quality from the M1.

In Windows, the task manager (or HWInfo64) breaks down what parts of the GPU are being used. 3D, encode, decode, etc. Does MacOS has an equivalent? I'm curious if it is decoding in software and not hardware. If it is decoding in software, that would be an appropriate issue to submit to the server git since the web UI is part of the server code.

As for the version of ffmpeg. Jellyfin does not use an old version, but there are newer versions that will be packaged with Jellyfin when 10.9.0 is released. You can manually install the latest version and Jellyfin 10.8.10 should not care. But since that is on the server side, and we already determined that is transcodes ok when you played content in Ubuntu, upgrading ffmpeg probably won't make a difference. But it can't hurt to try.