Jump to content

"HLS" problem - new data


VicMoore

Recommended Posts

VicMoore

I am using HLS to play Emby videos via an HTML5 video tag. I noticed that some videos failed after playing for a short time (5 minutes or so). The failure involved the emby server returning a 404 error for a valid video segment request from the client. This failure would stall the clients video buffer if the streaming did not recover before the client reached the end of the buffer and had to stop playing for lack of video data.

I played many videos and recorded the their video and audio codecs. Low to medium resolution videos encoded with an h264 codec and an AAC audio codec always played properly.  Others always failed after 5 to 10 minutes.  The most common problem was audio is a format other than AAC. I also noticed that all ".ts" videos failed to play to completion.

I am just a novice with limited knowledge, so my guess about the cause for these videos failing may be wrong. I believe they failed because of a transcoding problem in the HLS server when it prepares the emby videos for HLS streaming. Some how it's losing a few segments. These gaps in the segments cause the 404 error when the client tries to fetch them.

I have repeated this test several times with consistent results. My URL employed the options below:

VideoCodec  = h264

AudioCodec  = aac

AudioStreamIndex  = 1

SubtitleMethod  = Encode

TranscodingMaxAudioChannels = 2

SegmentContainer  = ts

MinSegments  = 1

BreakOnNonKeyFrames  =True

ManifestSubtitles  = vtt

h264-profile=high,main,baseline,constrainedbaseline,high10

h264-level=52

 

 

I hope someone can examine the HLS server and resolve this problem or provide me with a work around.

Vic

Link to comment
Share on other sites

VicMoore

This project was to serve two purposes. The first was to teach myself the emby API's. I like to learn. The second was to develop an app where I could surf the Emby Library and easily set and remove tags on movies, tv series and tv episodes. I wanted to do this so I could easily tag things to populate channels in the fantastic Virtual TV plugin.  That all works great and I can easily set up and manage the content in each channel that I have defined in the Virtual TV Plugin. After doing this I set about trying to learn how to also play movies, TV shows and music. I just wanted to learn how to do it.  The app uses HTML, CSS, Javascript and Jquery. It's not perfect. But it has been lots of fun.  I have read many of your Posts and have learned a great deal from them.

 

Vic

Link to comment
Share on other sites

VicMoore

Problem SOLVED

I programmed a simple HLS client to fetch the m3u8 from Emby, followed by parsing the file to separate out all of the fragment URLs, and finally with the URLs it fetched each of the files one after the other until I had the entire movie. To my surprise Emby provided every file and thereby debunked my theory that the HLS server was failing. Knowing that the problem was not in Emby, I started to look much closer into HLS.js. I now had an idea about what to look for. Removing the mp4 typing on the HTML5 source element tag in the DOM solved the problem. Problems are always simple once you discover what they are.  I am not sure why this works, but it did.

Vic

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