Jump to content

Streaming video: StartTimeTicks issue.


chef

Recommended Posts

Hi,

I am using this url in order to get an mp4 stream from my server:

http://192.168.1.104:8096/Videos/48258/stream.mp4?StartTimeTicks=280000000000&Container=mp4&static=true

I figured that by setting the "StartTimeTicks" to a value, My stream would start there, however my stream starts from the beginning.

My stream will only play in the browser if I set "static" to true.

Is it the Static param that is causing this behavior with StartTimeTicks?

Am I missing a necessary value to get StartTimeTicks to work?

 

Thank you for your time :)

Ben 

 

Edited by chef
Link to comment
Share on other sites

Upon further testing it looks like this url will work:

http://localhost:8096/emby/videos/48258/stream.mp4?StartTimeTicks=2754166090&VideoCodec=h264&AudioCodec=mp3,aac&VideoBitrate=139616000&AudioBitrate=384000&AudioStreamIndex=1&SubtitleStreamIndex=12&SubtitleMethod=Hls&TranscodingMaxAudioChannels=2&SegmentContainer=m4s,ts&MinSegments=1&BreakOnNonKeyFrames=True&ManifestSubtitles=vtt&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&TranscodeReasons=AudioCodecNotSupported,DirectPlayError&allowVideoStreamCopy=false

 

Link to comment
Share on other sites

pünktchen
12 minutes ago, chef said:

Is it the Static param that is causing this behavior with StartTimeTicks?

Yes.

12 minutes ago, chef said:

Am I missing a necessary value to get StartTimeTicks to work?

The stream needs to be stream copied. So instead of "Static", use something like this:

EnableAutoStreamCopy=true&VideoCodec=h264,h265,hevc&AudioCodec=aac,mp3

or just

VideoCodec=copy&AudioCodec=copy

Real media players are seeking to the start/resume position by requesting a http range value.

 

Edit: just a second too late.

  • Like 1
Link to comment
Share on other sites

22 minutes ago, pünktchen said:

Yes.

The stream needs to be stream copied. So instead of "Static", use something like this:

EnableAutoStreamCopy=true&VideoCodec=h264,h265,hevc&AudioCodec=aac,mp3

or just

VideoCodec=copy&AudioCodec=copy

Real media players are seeking to the start/resume position by requesting a http range value.

 

Edit: just a second too late.

Thank you for the reply. Yes. That got everything working wonderfully.

I really appreciate the time. Thank you :)

Link to comment
Share on other sites

rbjtech

Hi @chef i'm away from my pc xfor a few days but I did this via the api directly .. ie jump directly to a time on a new play.   I think i had to use playnext instead of play .. i'll ping when i'm back infront of a pc lol ... 

 

Link to comment
Share on other sites

@pünktchen do you have any idea why a request to start a stream would be throwing a 401 error from the browser?

this is the url I am using:

var url = ApiClient.getUrl("Videos/" + item.InternalId + "/stream.mp4?StartTimeTicks=" + startTime +
"&VideoCodec=h264&AudioCodec=mp3,aac&VideoBitrate=139616000&AudioBitrate=384000&AudioStreamIndex=1" + 
"&SubtitleStreamIndex=12&SubtitleMethod=Hls&TranscodingMaxAudioChannels=2&SegmentContainer=m4s,ts" + 
"&MinSegments=1&BreakOnNonKeyFrames=True&ManifestSubtitles=vtt" + 
"&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&TranscodeReasons=AudioCodecNotSupported,DirectPlayError&allowVideoStreamCopy=false" + 
"&api_key=" + ApiClient._serverInfo.AccessToken + "&n=" + Date.now());

 

  • I'm using the Date.now to invalidate the browser url,
  •  I have also forced the AccessToken into the url as the api_key because of the 401 error (unsure if this is correct)

and yet there is at least one person who is experiencing the 401.

Any suggestions?

 

For example the url resolves to this:

"http://localhost:8096/emby/Videos/48489/stream.mp4?StartTimeTicks=621355970040000000&VideoCodec=h264&AudioCodec=mp3,aac&VideoBitrate=139616000&AudioBitrate=384000&AudioStreamIndex=1&SubtitleStreamIndex=12&SubtitleMethod=Hls&TranscodingMaxAudioChannels=2&SegmentContainer=m4s,ts&MinSegments=1&BreakOnNonKeyFrames=True&ManifestSubtitles=vtt&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&TranscodeReasons=AudioCodecNotSupported,DirectPlayError&allowVideoStreamCopy=false&api_key=####################&n=1640270279665"

 

Link to comment
Share on other sites

In most cases you're going to seek client-side using the video player, rather than via server-side transcoding.

  • Thanks 1
Link to comment
Share on other sites

26 minutes ago, Luke said:

In most cases you're going to seek client-side using the video player, rather than via server-side transcoding.

Yes. It is definitely unorthodox.

In this case I just wanted to start a stream at a specific point in a dialogue. It allowed the user to see where a plugin had set a timestamp.

Incase they wanted to edit a few seconds forward or back.

It was an extra feature which may or may not be nesessary.

 

 

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