Jump to content

Blue Neon Light - Ending File Playback


moviefan

Recommended Posts

moviefan

Recently it started happening that when a video I am watching on my Roku3 with Blue Neon Light ends, it jumps back to a randomly selected place in the video that was just playing and keeps going.  

 

When I click play/pause to look at the progress bar it shows it is at the very end with 0 mins left, yet it continues playing until I manually stop it.

 

Anyone else notice this behavior?

Link to comment
Share on other sites

Happy2Play

Sounds like that old Transcoding bug, believe it had something to do with hls.  Is your media transcoding, then at the end loops back to a random point, and if you let it do it long enough it finally stops.  But who actually waits that long.

Edited by Happy2Play
Link to comment
Share on other sites

moviefan

Yah this sounds about right.  Not sure if it ever stops.  I always stop it because I dont want to rewatch that random scene again.

Link to comment
Share on other sites

That is the effect of direct stream copying video streams that arent keyframe(i-frame aka fullframe) aligned perfectly on 3 second intervals. Emby handles hls by slicing video into 3 second chunks with an hls manifest (m3u8). This is when the video stream is copied, rather than transcoded to add these keyframes(i-frames). Without them aligned exactly at 3 seconds the video length may be longer than the manifest actually states. Instead of 3 seconds it might be 3.02 or 3.1 or 3.0025. It has to align on keyframes so the next keyframe on or after 3 seconds is taken as the start of the next and so forth. These mis-aligned chunks actually expand the runtime past the actual end. This is the repeat you see. It will replay some of the buffer it has of the video randomly at the end over again. This is unavoidable unless you want to trigger a full transcode. Most people want to save cpu cycles so want to direct-stream copy as often as possible. This acheives that at the cost of that weird repeat at the end. Mostly AVI container will have this effect since that container cant be direct-streamed, but the video and audio streams inside usually can both be copied.

 

tl;dr  Blame hls for the issue as @@Happy2Play stated.

Edited by speechles
Link to comment
Share on other sites

moviefan

Thanks for the explanation.

 

For me the AVI container isn't the case.  It's all been on MKV container.

 

Anyway, sounds like I just have to deal with it.  

Link to comment
Share on other sites

  • 4 weeks later...
moviefan

Is this also the reason that moving back in the file doesn't seem to work?

 

If I try to just go back a little bit, even after the file has just started playing, it seems to pick some other random point in the episode.  If I stop playing, and then resume, it picks up at the right spot.  But navigating back and forth with the arrows no longer appears to work.

Link to comment
Share on other sites

I see this issue in both the blue neon and official emby app. All files are MKV. I don't know if it happens with X264 files but most X265 files it seems to occur.

Link to comment
Share on other sites

  • 3 months later...
dcook

@@speechles

 

You mentioned in your post that you can avoid the repeating of the video by trigger a full transcode, can you tell me how I can set the Emby server or the Roku to do a full transcode?

Is there a way I can turn off direct stream so transcoding MUST be used therefore not having this video repeat issue anymore?

 

 

 

That is the effect of direct stream copying video streams that arent keyframe(i-frame aka fullframe) aligned perfectly on 3 second intervals. Emby handles hls by slicing video into 3 second chunks with an hls manifest (m3u8). This is when the video stream is copied, rather than transcoded to add these keyframes(i-frames). Without them aligned exactly at 3 seconds the video length may be longer than the manifest actually states. Instead of 3 seconds it might be 3.02 or 3.1 or 3.0025. It has to align on keyframes so the next keyframe on or after 3 seconds is taken as the start of the next and so forth. These mis-aligned chunks actually expand the runtime past the actual end. This is the repeat you see. It will replay some of the buffer it has of the video randomly at the end over again. This is unavoidable unless you want to trigger a full transcode. Most people want to save cpu cycles so want to direct-stream copy as often as possible. This acheives that at the cost of that weird repeat at the end. Mostly AVI container will have this effect since that container cant be direct-streamed, but the video and audio streams inside usually can both be copied.

 

tl;dr  Blame hls for the issue as @@Happy2Play stated.

Link to comment
Share on other sites

@@speechles

 

You mentioned in your post that you can avoid the repeating of the video by trigger a full transcode, can you tell me how I can set the Emby server or the Roku to do a full transcode?

Is there a way I can turn off direct stream so transcoding MUST be used therefore not having this video repeat issue anymore?

The server controls this part. To force a full transcode you need to drop the maximum video bitrate for the app below the bitrate of the video stream for that item. The server will attempt to copy the video stream if the bitrate allows it to speed up the transcoding. That is why you have to drop the bitrate to force the server to reencode the videostream entirely with new keyframe indices. This may cause quality issues if you drop things too far.
Link to comment
Share on other sites

dcook

@@Luke or @@ebr is there a way you can add a setting in the server or perhaps per library that would force transcode on or off?

 

I don't see any other way to fix the repeating of random seconds at the end of every video, if transcoding will fix the issue then we should be transcoding

 

 

 

The server controls this part. To force a full transcode you need to drop the maximum video bitrate for the app below the bitrate of the video stream for that item. The server will attempt to copy the video stream if the bitrate allows it to speed up the transcoding. That is why you have to drop the bitrate to force the server to reencode the videostream entirely with new keyframe indices. This may cause quality issues if you drop things too far.

Link to comment
Share on other sites

@@Luke or @@ebr is there a way you can add a setting in the server or perhaps per library that would force transcode on or off?

 

I don't see any other way to fix the repeating of random seconds at the end of every video, if transcoding will fix the issue then we should be transcoding

I can make this happen in the blue neon app with a little creativity. Since the app controls the direct play profile which includes bitrate there is some magic we can do.

 

How about a setting, called "h264 workaround" and by default it is NO. When turned to YES it uses the below method:

 

If the item video stream is h264 then take that items video stream bitrate, subtract 1 from it, and send this as the device profile max bitrate. This will cause full transcoding and make the bitrate loss as minimal as possible.

 

This will accomplish what you want and avoid the "repeat loop at the end" scenario. The new app will have to do something along these lines too, more than likely.

 

Edit:

 

@@dcook

 

it works!!!!11!!eleven!!shift

 

I will have a new blue neon app shortly that includes this. Yay!!

Edited by speechles
Link to comment
Share on other sites

74008fbb8b6a4992f95f66479c7571d4.jpg

 

Okay, not going to use a preference. It is too many clicks of the remote to change back and forth as a preference..

 

Instead..Ive redesigned the play method forcing via the more menu. Since "force directplay" never could work, this has been removed. In its place, a single "force direct" method. Now transcode has two settings. One, will transcode, but allow directstream and respect your max bitrate. The other will transcode too, but if the videostream is h264 the app will do a full transcode at the video bitrate minus one. This makes it easy to change on-the-fly quickly.

 

@@dcook I will have a new release shortly for you to test. ^__^

Edited by speechles
Link to comment
Share on other sites

@@speechles

 

You mentioned in your post that you can avoid the repeating of the video by trigger a full transcode, can you tell me how I can set the Emby server or the Roku to do a full transcode?

Is there a way I can turn off direct stream so transcoding MUST be used therefore not having this video repeat issue anymore?

https://emby.media/community/index.php?/topic/24151-Theme:-blue-neon-night&do=findComment&comment=430703

 

Can confirm using the "Force Transcode w/o DirectStream" option will work as you have asked for. It is included in the latest update. Feel free to try it out and let me know what you think.

Edited by speechles
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...