-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] LG webos + Dolby Vision =⛔ movie stutters then hangs when resuming or skipping ahead #248
Comments
i just tried to play a movie and seem to have the same issue.. |
what is you TV model ? |
same issue on my LG C2 |
LG G2 |
Exactly the same issue I am facing now with my LG G3. At first, I thought it was the transcoding problem but on the server side, I can access all the temporary small parts of transcoded videos and I can play those on the server itself just fine using a normal media player, including the parts that hung on my LG G3. It's definitely something else that's the problem. |
I suspect every WebOS users have this issue with Dolby Vision content. I wonder if it is posted in the right place ? |
Hmmm, well, let's do this: https://jellyfin.org/docs/general/contributing/issues Under "Searching and Voting" section, it said the following:
I just did that on your opening post. Everyone, please do that as well. |
Hmmm, I think you need to do a couple more things. Like:
Check the above link and see what else you need to do right, otherwise it might affect their response. |
I did too :p |
@gnattu or @GeorgeH005, is it something you would know about ? |
I'm currently in the process of switching from Plex to Jellyfin and am reading up on any issues i might encounter and stumbled in here. I have 3 LG OLEDs, 77C1, 65C8 and a 48A1. I was however unable to replicate this on any of them. Resuming and skipping 20-30min causes no issues. |
This was an issue that had come up during testing, but only when using the fmp4 container. When using ts, I wasn't able to replicate it. The only slightly enlightening error that had occurred was the app crashing (when using fmp4) reportedly due to running out of memory. Csn't tell you much more than that. Maybe the Jellyfin webUI (that this app is wrapping) is just too heavy? Haven't conducted any research so I can't answer that. Edit: I am using a C3 and the tests were conducted on WebOS 23 |
My files are in MKV container and as far as I know, all 3 files are using Profile 8.1 and all 3 had the same issue. |
I struggled with this for a while and eventually gave up. Even videos by the same person have different symptoms. Fortunately, recent videos seem to be less prone to the problem. My guess is that the root of the problem lies with LG. Dolby Vision only works with MP4 and the This is a serious problem. |
you can still put a thumb up on the first post, to gain more visibility, maybe it will be fixed eventually :) |
Have you tried to see if you can reproduce the same issue in other ways: plex, dlna, usb... |
USB is fine even with mp4 if I remember correctly, plex and dlna I haven't tested. I could test Plex, but I would have to reconvert a file to mp4. |
Hi folks, I've narrowed my problem down to this issue as well. LG OLED C2 (WebOS v8.3.0-29 (number1-nameri) Playing .mkv files with Dolby Vision Profile 8.1 fails. Either first few frames then stops or green screen tearing and static. Seems to be exactly this combo .mkv with DV (only have profile 8.1 to test with). DV with .mp4 works fine and HDR10 on both containers works fine. Playing .mkv + DV via USB doesn't trigger the DV or HDR toaster pop up so unsure if it's playing with either but it does play regardless. |
If so, it sounds like it might be a remux issue. We might want to try raising an issue on the server side |
I had thought the same back then as well, but it was in a good enough point in my case, that it wasn't worth debugging the web client or server side. My suspicions lie on the client side. I will try to see if I find something worth exploring. |
How can I help on my side? I can reproduce it easily, please let me know what kind of log could be interesting |
I am very certain it is a client specific issue and it is even webOS/TV model specific issue. The problem is some webOS TV model has a very buggy native HLS player that is unable to handle Dolby Vision correctly and that is what Jellyfin is using to do the on-the-fly remuxing to enable dolby vision. The problem is that:
Currently your best choice is to manually remux the file into mp4 if you want to keep dolby vision and make your TV happly. We can do little for this other than some very unfortunate option like "disable dolby vision for this TV" so that the server will send the mkv as-is and just play the HDR10 fallback. The way to remux to mp4 is to jellyfin-ffmpeg (the upstream one may work worse), for example:
|
The problem seems to be that the hls player doesn't like not having the segments ready when seeking or resuming. If you look at the Jellyfin-web code, there was a hack for safari that made sure that there were segments available on playback start. By hacking that a bit to work on seek and on web0s (essentially forcing it to use live.m3u8 rather than master.m3u8) web0s can seek freely anywhere that has already been transcoded. This prevents the stall that we were seeing. Maybe we can introduce some kind of loading until there are segments ready instead of feeding it the url immediately and leaving it to handle it? |
This issue seems better suited to Jellyfin-web as this repo contains a wrapper that does not interfere with playback. |
Hmmm, ok, so I went and remux the .MKV file into MP4 using the above command you provided, using the ffmpeg in JellyFin's Server folder and absolutely no issues. I can see the dolby vision and dolby atmos popup on the top right hand corner of the TV when I play it with the JellyFin client on my LG G3 TV. So definitely it's an MKV + Dolby Vision problem in combination with LG TVs. |
LG TVs are UNable to playback Dolby Vision in MKV, neither with Jellyfin, nor with DLNA, not even with USB. That much we knew. The problem is that LG's hls player does not like not having fmp4 fragments ready as soon as it needs them it seems, which is a problem when we are transcoding/remuxing. The issue described here is reproducible even without dolby vision. I believe, apart from maybe implementing some extra loading in order to wait for the server to have some fragments ready, there is not much we can do. |
I'm not sure to understand. My LG TV can play DV in mkv very well with jellyfin, unless I skip ahead more than ~3min or if I resume a movie I already started. Would it help if I try from a usb stick or with dlna to confirm if the issue is still present? |
Because we are remuxing on the fly to mp4 or ts respectively. If we weren't dolby vision would not be triggered. You can try it for yourself if you want with an mkv and a USB but there was a relevant pull request that had all the details regarding this. |
This inspired me to test it out and I found a workaround. When remuxing, I wait until the orange gauge on the dashboard is full before I change the playback location. This worked for me. If anyone else is like me, it would be a huge help right now if this orange bar could be displayed in the client as well. |
@gnattu I'd like to know if the LG TV is the most picky device. |
mp4 has much better compatibility in general as mkv is a very complex container.
There are a lot of picky devices for direct play, but for most of them Jellyfin could do on-the-fly remuxing to make it work without a transcoding, and the HLS player quirks is what makes it work badly on LG TVs. |
thnak you |
I am not quite sure I understand you. Why is LG's HLS player being brought up? I am using Jellyfin's app on my TV to connect to my Jellyfin server to play the mkv files. Is the Jellyfin app actually using the HLS player to play the on-the-fly remux files? |
@gnattu Changing one line in the web client to make webOS use hls.js seems to work well! Under direct play conditions dolby vision is triggered as usual, and when forcing a transcode or a remux, seeking works well even with fmp4. If you have any thoughts on what should be changed/tested I would be happy to help! It seems like a good solution for now. |
We were not using HLS.js for a reason as some models works exceptionally bad with that. |
Because LG TVs cannot play Dolby Vision as Dolby Vision in mkv, so the server has to remux it, and the remux is delivered with HLS, which uses native HLS player of the LG TV. |
That's a shame, could still be a solution for newer models. |
AI-generated script. #!/bin/bash
mkv2mp4() {
if [ -z "$1" ]; then
echo "Usage: mkv2mp4 <directory_path> [default audio track number (starts from 0)]"
echo "Use only for HEVC videos that support Dolby Vision."
return 1
fi
# Modify and use the path correctly.
FFMPEG="/usr/lib/jellyfin-ffmpeg/ffmpeg"
if [ ! -f "$FFMPEG" ]; then
echo "Error: Cannot find ffmpeg: $FFMPEG"
return 1
fi
directory="$1"
audio_track="$2"
log_dir="${directory}/conversion_logs"
mkdir -p "$log_dir"
log_file="${log_dir}/conversion_$(date +%Y%m%d_%H%M%S).log"
echo "Conversion start time: $(date)" | tee -a "$log_file"
echo "----------------------------------------" | tee -a "$log_file"
find "$directory" -type f -name "*.mkv" -print0 | while IFS= read -r -d $'\0' input_file; do
filename="${input_file%.*}"
mp4_file="${filename}.mp4"
if [ -f "$mp4_file" ] && [ -s "$mp4_file" ]; then
echo "Skip: $mp4_file (already exists)" | tee -a "$log_file"
continue
fi
echo "Processing: $input_file" | tee -a "$log_file"
# Improved subtitle extraction
echo "Extracting subtitles..." | tee -a "$log_file"
# Extract subtitle stream information
$FFMPEG -i "$input_file" 2>&1 | while IFS= read -r line; do
if [[ $line =~ Stream.*Subtitle ]]; then
stream_index=$(echo "$line" | grep -o "#0:[0-9]*" | cut -d':' -f2)
language=$(echo "$line" | grep -oP "^.*?\((\w{2,3})\)" | grep -oP "\((\w{2,3})\)" | tr -d '()')
# Check subtitle codec type
codec_type=$(echo "$line" | grep -oP "Subtitle: \K[^,]*")
# Check subtitle type
subtitle_type=""
if [[ $line =~ \(forced\) ]]; then
subtitle_type="forced"
elif [[ $line =~ \(hearing[[:space:]]impaired\) ]] || [[ $line =~ \(SDH\) ]]; then
subtitle_type="sdh"
elif [[ $line =~ \(dub\) ]]; then
subtitle_type="dub"
fi
# Set output file extension
case $codec_type in
"subrip") ext="srt" ;;
"ass" | "ssa") ext="ass" ;;
"hdmv_pgs_subtitle") ext="sup" ;;
"dvd_subtitle") ext="sub" ;;
*) ext="srt" ;; # Default is srt
esac
# Generate output filename
if [ ! -z "$subtitle_type" ]; then
output_subtitle="${filename}.${language}.${subtitle_type}.${ext}"
else
output_subtitle="${filename}.${language}.${ext}"
fi
if [ -f "$output_subtitle" ] && [ -s "$output_subtitle" ]; then
echo "Skip: $output_subtitle (already exists)" | tee -a "$log_file"
continue
fi
echo "Extracting subtitle: $output_subtitle (codec: $codec_type)" | tee -a "$log_file"
# Use copy codec for ASS/SSA, PGS(SUP) subtitles
if [ "$codec_type" = "hdmv_pgs_subtitle" ] || [ "$codec_type" = "ass" ] || [ "$codec_type" = "ssa" ]; then
$FFMPEG -nostdin -i "$input_file" -map 0:${stream_index} -c:s copy \
-y "$output_subtitle" 2>> "$log_file" || {
echo "Error: Failed to extract subtitle - $output_subtitle" | tee -a "$log_file"
rm -f "$output_subtitle"
}
# Convert to srt for other cases
else
$FFMPEG -nostdin -i "$input_file" -map 0:${stream_index} -c:s srt \
-y "$output_subtitle" 2>> "$log_file" || {
echo "Error: Failed to extract subtitle - $output_subtitle" | tee -a "$log_file"
rm -f "$output_subtitle"
}
fi
fi
done
# MP4 Conversion
echo "Converting to MP4..." | tee -a "$log_file"
# Audio track settings
audio_options=""
if [ ! -z "$audio_track" ]; then
audio_count=$($FFMPEG -i "$input_file" 2>&1 | grep -c "Stream.*Audio")
if [ "$audio_track" -lt "$audio_count" ]; then
for ((i=0; i<audio_count; i++)); do
if [ "$i" -ne "$audio_track" ]; then
audio_options="$audio_options -disposition:a:$i 0"
fi
done
audio_options="$audio_options -disposition:a:$audio_track default"
else
echo "Error: Invalid audio track number. (Available tracks: 0-$((audio_count-1)))" | tee -a "$log_file"
return 1
fi
fi
# Execute MP4 conversion
$FFMPEG -nostdin -i "$input_file" -map 0:v -map 0:a -c copy \
-tag:v hvc1 \
-movflags +faststart+use_metadata_tags+write_colr \
-write_tmcd 0 \
-strict -2 \
$audio_options \
-y "$mp4_file" 2>> "$log_file" || {
echo "Error: MP4 conversion failed - $mp4_file" | tee -a "$log_file"
rm -f "$mp4_file"
}
echo "----------------------------------------" | tee -a "$log_file"
done
echo "Conversion end time: $(date)" | tee -a "$log_file"
}
mkv2mp4 "$1" "$2" |
I am currently using this script and accoring to few testing on my LG C2 (which is having the issue) after conversion to mp4 it works. I was wondering if there would be any way to automate this conversion using tdarr tool ? (as a kind of automated workaround) |
What did you change? I’d like to try in my LG as this issue is quite annoying. |
This line: |
How can I test it? I'm using docker. Also, I tested a DV movie through DLNA and it fallback to HDR. To be honest, between this issue with DV and regular HDR, I would be happy to use only HDR if possible. Is there a settings to disable DV until it's fixed? |
Hello, I have the same issue. I’d like to add that what you’re discussing was already possible in version 10.8.13. This movie is in DV profile 8.1, but it starts with HDR, displaying decent image quality and, most importantly, without unnecessarily consuming resources. However, in more recent versions, something seems to have changed because this no longer works for me, and I can’t use Jellyfin with these movies in its updated version. If you look at the image, when HDR works, it shows "Jellyfin for WebOS," and when it doesn’t, it uses the browser. Could you consider allowing multiple servers without needing to log in to switch between them, or re-enable the functionality the old server had with DV 8.1? Thank you for your work and assistance. |
10.8 does not play your files in dolby and it simply discards all dolby metadata and plays the HDR10 fallback. |
I see, so why doesn’t it load HDR10 instead of remuxing the MKV directly? Thank you for your great work. |
Because 10.8 did not implement such function to allow dolby vision playback. |
What about @GeorgeH005 fix? Wouldn't it be a quick fix to implement and help us all? 😍 |
Right, but then what do you recommend to use this? I’m using two Jellyfin servers to access the content. What solutions do you think we have? I have three LG screens, and the issue happens on all of them. Maybe a new version for LG? Version 1.2.2 hasn’t been updated in a while, while the server releases new versions frequently. Thank you for your prompt response. |
@gnattu According to LG, webOS 5.0 and up support the same spec of MSE, EME (which shouldn't concern us), and HLS. That does sound promising considering LG themselves in their example app use Shaka-player, which does also utilise MSE for HLS, not their native player as far as I can tell. The problems reported on their repo were for versions < 5 so maybe this is worth at least some consideration. |
Should note that the issue discussed here is more relevant to jellyfin/jellyfin-web, rather than the wrapper developed here. |
It is beyond my knowledge, but from what you said, it seems a solution is possible and could be done by just editing one line ? Would you still recommend to close this thread and open the same on jellyfin-web (I didn't find how to move it) ? Or do you reckon your fix is the solution ? |
It’s possible that the change coming from Jellyfin-web is the "problem," but perhaps it can be resolved from here at LG. I believe a small update could address these issues:
Thank you very much! |
(bug is still present with 10.9.11)
Hello all,
this specific issue doesn't seem to be addressed in other topics, some are similar but not really, and most of them are more or less inactives.
I have been hoping for a fix since I started with Jellyfin in march, but it hasn't come yet, so I'm trying my luck by opening this issue.
The issue:
When I try to resume a Dolby Vision movie, or if I start over and then skip ahead (more than a few minutes), then the movie will start normally in direct play, but after 10 seconds (sometimes a bit more, I have managed to watch more than 10min once!), it starts to freeze for a few seconds, then can eventually continue for a few more seconds but will start to hang very quickly.
If I don't touch anything for 1 or 2 minutes, I can see the movie "poster" flashing as if the movie stopped and started again, then it resumes the movie but this time it tries to transcode it, which gives bad colors and bad performance.
If I play the movie from the beginning, then it plays perfectly (in direct play).
If I start from the beginning and skip ahead without exceeding ~3min each steps, I can eventually reach the part I need to, but it takes a long time to reach the correct position, and very often, the subtitles become out of sync.
If I skip ahead more than ~3min in one go, then the "freezing/hanging/switching to transcoding" issue happens again when I stop skipping.
After reading the forum, I have disabled the "prefer mp4" option without more success.
The TV (LG G3) is new and my Jellyfin installation too, so I can't tell when the issue started, but it has been doing it since I started to use Jellyfin in march.
Currently, I have given up with Dolby Vision movies, they are unwatchable, unless I know for sure I can watch it in one go without the need to stop and resume next time, which I can very seldom do :(
I can't even disable Dolby Vision (on the TV or in Jellyfin) to avoid this issue and force HDR layer, so I'm pretty stuck whenever there is a DoVi movie.
Please find below a few examples of Video profiles that presents this issue (DV Profile 5 and 8.1 from what I can see):
I'm ready to help as much as I can, please let me know whatever you need and I'll try to get it asap :)
The text was updated successfully, but these errors were encountered: