turleym 2 Posted November 7 Posted November 7 (edited) And, 12 minutes to skip forward an additional 1:20 minutes. I was watching Guardians of the Galaxy 2 on Roku, and at about the 1:30 mark, stopped watching. When I came back later and resumed, it appeared that Emby was locked up as the video was not restarting I played with it a bit on Roku, but then moved over to PC. On PC I discovered that I could start the video from the beginning, it plays fine. If I then move forward to the 30 min mark in the video, it will sit and spin for 4 minutes before it starts playing again. If I move to 1:30 in the video, it will sit and spin for 12 minutes before it starts to play again. Other videos will restart very quickly, but I suspect if I looked around I could find others that do not (likely the larger Bluray rips). I upgraded to server ver 4.10.2.0, and the issue is the same. Server is running on a Synology DS218, and the issue exists on both PC and Roku. Attached are 2 log files. The first is a log of moving forward 30 min, then to 1:30 and waiting the 4 min, then the 12 minutes until the video resumed playing (embyserver.txt). For the second file, I turned on Debug Logging and just did the 20 min advance (embyserver Debug Logging 20 min advance.txt). embyserver Debug Logging 20 min advance.txt embyserver.txt Edited November 7 by turleym Screenshot of dashboard when playing.
Abobader 3547 Posted November 7 Posted November 7 Hello turleym, ** This is an auto reply ** Please wait for someone from staff support or our members to reply to you. It's recommended to provide more info, as it explain in this thread: Thank you. Emby Team
Luke 43757 Posted November 8 Posted November 8 Hi, the short answer is the mp4 is probably not encoded properly and needs to be reencoded.
Luke 43757 Posted November 8 Posted November 8 As a result of this, the Roku has to download and decode the entire file in order to locate the file position to seek to, and this is why it takes so long.
turleym 2 Posted November 8 Author Posted November 8 (edited) 11 hours ago, Luke said: As a result of this, the Roku has to download and decode the entire file in order to locate the file position to seek to, and this is why it takes so long. 11 hours ago, Luke said: Hi, the short answer is the mp4 is probably not encoded properly and needs to be reencoded. Yet, VLC and PotPlayer play this perfectly, and forward and rewind the video instantly using the same file. Emby on PC and Roku do not. Edited November 8 by turleym
ebr 17109 Posted November 8 Posted November 8 6 minutes ago, turleym said: Yet, VLC and PotPlayer play this perfectly, and forward and rewind the video instantly using the same file Hi. That's because those players implement work-arounds for poorly formatted content. This isn't the case with something like the Roku player which is very strict about following the spec.
Solution turleym 2 Posted November 8 Author Solution Posted November 8 (edited) I guess Windows PC is strict as well. Maybe Emby can ease up on its strictness much like VLC. Or, have an on-the-fly fix to enable Fast-Start for all videos (see below). Anyway, I ran some ffmpeg and ffprobe commands and no errors were found in the file. Then I found this (should say AI presented this): By default, standard video encoders write the moov atom (the metadata index layout) at the very end of an MP4 file because it cannot calculate the final frame sizes until the entire encoding process completes. [1, 2] For web streaming or progressive downloads, having the moov atom at the end forces the browser or player to download the entire video (or issue erratic range requests) before it can even begin playing. Placing it at the beginning right after the ftyp box is known as "Fast-Start." So I ran this command: ffprobe -v trace -i "input.mp4" 2>&1 | findstr "parent:'root'". For "Fast-Start", the moov token should come before the mdat token. My result from this command is shown in the attached screenshot, and the moov is indeed after the mdat. So, I ran this command on the mp4: ffmpeg -i input.mp4 -c copy -movflags +faststart output.mp4. This is supposed to recreate the mp4, without any new encoding, and move the moov to the head of the file. Took 8 minutes to regen the mp4. I tested the resulting file in Emby, and it does indeed allow instant forward/rewind of the video. Edited November 8 by turleym 1
turleym 2 Posted November 8 Author Posted November 8 (edited) Epilogue: I looked at another Bluray rip, and checked where the moov is. Turns out it is after the mdat as well. I suspect all my rips are exactly the same for the moov location. But, this mp4, and all others I have testing in the last day, have no issues with forward/rewind, even though the moov is in the "wrong" place. So, it looks like there is something else at play here that is causing this issue. Edited November 8 by turleym
softworkz 5755 Posted November 8 Posted November 8 @turleym This is not a matter of whether the index is at the start or at the end. Your log files are showing Chrome successfuly retrieving 3.5MB from the end of the video via range request.. Then it starts its forward-seek-through-everything, loading Gigabytes of data. This rather looks like that what it found at the end of the file wasn't usable and so it resorted to reading through the whole file from the beginning up untril the seek position. As you are seeing this with both, Roku and Chrome, there's not much room for it being a player issue - most likey instead, it's about an invalid mp4 file. Like it's been said already, VLC cannot be taken as a reference. When it plays something successfully, that's not an indication for the file being valid. VLC is known for its "plays everything" behavior. But standards are there for reasons and playing invalid files doen't do a favor to anybody - just the opposite: it causes confusion - like here.If an encoder has a bug, the bug should be fixed in the encoder - not in a player (like VLC does). Otherwise, you would have known immediately that the file is broken/invalid. 1
Luke 43757 Posted November 8 Posted November 8 Right the video player that Roku provides is not as Robust as Vlc. You cannot use Vlc as a basis of comparison or to set expectations of what you would see on Roku. Has this helped?
turleym 2 Posted November 13 Author Posted November 13 Indeed, it looks like the file had an issue that was not the moov token location. The rebuild with ffmpeg rebuilt the file and cleaned it up. It would be nice if there was a better tool that would indicate what the problem was with the original rip. I do like this - "Otherwise, you would have known immediately that the file is broken/invalid." It would be nice if Emby did this rather than reading the file for 12 minutes. Just pop up almost "immediately" and say error in source file or some such. 1
ebr 17109 Posted November 13 Posted November 13 10 hours ago, turleym said: It would be nice if Emby did this rather than reading the file for 12 minutes. Just pop up almost "immediately" and say error in source file or some such. In this case it wasn't our app reading the file. It was Roku's built-in player. However, we could potentially implement some sort of analysis on the server end to flag files that may have issues like this at the time of import... 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now