Jump to content

Transcode


Angelblue05

Recommended Posts

Angelblue05

I can't get Kodi to play transcode file with subtitles enabled.

{server}/emby/Videos/{itemid}/master.m3u8?MediaSourceId={itemid}&VideoCodec=h264&AudioCodec=ac3&MaxAudioChannels=6&deviceId={deviceid}&VideoBitrate=664000&AudioStreamIndex=1&SubtitleStreamIndex=5&AudioBitrate=384000

Is there anything wrong or missing from the url?

It works fine when there's no subs selected - the only difference is "&SubtitleStreamIndex=#"

 

Link to comment
Share on other sites

Redshirt

When you supply the subtitlestreamindex you also nead to supply the mediasourceId.   nevermind. I see it's the first argument in your url :)

Edited by Redshirt
  • Thanks 1
Link to comment
Share on other sites

Angelblue05

Let me know if I should provide logs or whatever else. I've been bashing my head for 2 days trying to figure out why Kodi refuses to load the stream. It may not be something wrong with Emby, I just want to confirm that the url requested is actually valid for when subs are burnt to video.

Link to comment
Share on other sites

Angelblue05

Well nevermind, it seems to work now? errrr..... I can't explain it. lol

 

It seems the result is very unstable. Sometimes it works, sometimes it doesn't. Yet nothing changes.

Edited by Angelblue05
Link to comment
Share on other sites

I can't get Kodi to play transcode file with subtitles enabled.

{server}/emby/Videos/{itemid}/master.m3u8?MediaSourceId={itemid}&VideoCodec=h264&AudioCodec=ac3&MaxAudioChannels=6&deviceId={deviceid}&VideoBitrate=664000&AudioStreamIndex=1&SubtitleStreamIndex=5&AudioBitrate=384000

Is there anything wrong or missing from the url?

It works fine when there's no subs selected - the only difference is "&SubtitleStreamIndex=#"

 

Why are media source ID and ItemId the same thing...?

Link to comment
Share on other sites

Angelblue05
{
  "Name": "2 Guns",
  "ServerId": "7e3d7e2ac0e54624829ac4e63ca067ff",
  "Id": "c49c866cb486bd2a632b6f58efb07f8b", <-------------------------- itemid
  "Etag": "deee3c1d5e7b8b158b661b7f64b9852b",
  "DateCreated": "2013-11-12T01:16:21.0000000Z",
  "CanDelete": true,
  "CanDownload": true,
  "HasSubtitles": true,
  "PreferredMetadataLanguage": "",
  "PreferredMetadataCountryCode": "",
  "AwardSummary": "2 wins.",
  "Metascore": 55,
  "SupportsSync": true,
  "HasSyncJob": false,
  "IsSynced": false,
  "SortName": "2 guns",
  "ForcedSortName": "",
  "PremiereDate": "2013-08-02T05:00:00.0000000Z",
  "ExternalUrls": [
    {
      "Name": "IMDb",
      "Url": "http://www.imdb.com/title/tt1272878"
    },
    {
      "Name": "TheMovieDb",
      "Url": "http://www.themoviedb.org/movie/136400"
    }
  ],
  "MediaSources": [
    {
      "Protocol": "File",
      "Id": "c49c866cb486bd2a632b6f58efb07f8b", <------------------------------------------ mediasourceid
      "Path": "\\\\CORRUPTION-PC\\Movies$\\2 Guns (2013)\\2 Guns (2013).bluray.mkv",
      "Type": "Default",
      "Container": "mkv",
      "Name": "720P/H264/AC3",
      "RunTimeTicks": 65469760000,
      "ReadAtNativeFramerate": false,
      "SupportsTranscoding": true,
      "SupportsDirectStream": true,
      "SupportsDirectPlay": true,
      "RequiresOpening": false,
      "RequiresClosing": false,
      "VideoType": "VideoFile",
      "MediaStreams": [
        {
          "Codec": "h264",
          "Language": "eng",
          "IsInterlaced": false,
          "BitRate": 4477525,
          "BitDepth": 8,
          "RefFrames": 2,
          "IsDefault": true,
          "IsForced": false,
          "Height": 532,
          "Width": 1280,
          "AverageFrameRate": 23.976,
          "RealFrameRate": 23.976,
          "Profile": "Main",
          "Type": "Video",
          "AspectRatio": "2.40:1",
          "Index": 0,
          "IsExternal": false,
          "IsTextSubtitleStream": false,
          "SupportsExternalStream": false,
          "PixelFormat": "yuv420p",
          "Level": 31,
          "IsAnamorphic": false,
          "IsCabac": false
        },
        {
          "Codec": "ac3",
          "Language": "eng",
          "IsInterlaced": false,
          "ChannelLayout": "5.1",
          "BitRate": 384000,
          "Channels": 6,
          "SampleRate": 48000,
          "IsDefault": true,
          "IsForced": false,
          "Type": "Audio",
          "Index": 1,
          "IsExternal": false,
          "IsTextSubtitleStream": false,
          "SupportsExternalStream": false,
          "Level": 0
        },
        {
          "Codec": "srt",
          "Language": "eng",
          "IsInterlaced": false,
          "IsDefault": false,
          "IsForced": false,
          "Type": "Subtitle",
          "Index": 2,
          "IsExternal": false,
          "IsTextSubtitleStream": true,
          "SupportsExternalStream": true,
          "Level": 0
        },
        {
          "Codec": "srt",
          "Language": "eng",
          "IsInterlaced": false,
          "IsDefault": false,
          "IsForced": false,
          "Type": "Subtitle",
          "Index": 3,
          "IsExternal": false,
          "IsTextSubtitleStream": true,
          "SupportsExternalStream": true,
          "Level": 0
        },
        {
          "Codec": "srt",
          "Language": "fre",
          "IsInterlaced": false,
          "IsDefault": false,
          "IsForced": false,
          "Type": "Subtitle",
          "Index": 4,
          "IsExternal": false,
          "IsTextSubtitleStream": true,
          "SupportsExternalStream": true,
          "Level": 0
        },
        {
          "Codec": "srt",
          "Language": "spa",
          "IsInterlaced": false,
          "IsDefault": false,
          "IsForced": false,
          "Type": "Subtitle",
          "Index": 5,
          "IsExternal": false,
          "IsTextSubtitleStream": true,
          "SupportsExternalStream": true,
          "Level": 0
        },
        {
          "Codec": "srt",
          "Language": "eng",
          "IsInterlaced": false,
          "IsDefault": false,
          "IsForced": false,
          "Type": "Subtitle",
          "Index": 6,
          "IsExternal": true,
          "IsTextSubtitleStream": true,
          "SupportsExternalStream": true,
          "Path": "\\\\CORRUPTION-PC\\Movies$\\2 Guns (2013)\\2 Guns (2013).bluray.en.srt"
        },
        {
          "Codec": "srt",
          "Language": "fre",
          "IsInterlaced": false,
          "IsDefault": false,
          "IsForced": false,
          "Type": "Subtitle",
          "Index": 7,
          "IsExternal": true,
          "IsTextSubtitleStream": true,
          "SupportsExternalStream": true,
          "Path": "\\\\CORRUPTION-PC\\Movies$\\2 Guns (2013)\\2 Guns (2013).bluray.fr.srt"
        }
      ],
      "PlayableStreamFileNames": [],
      "Formats": [],
      "Bitrate": 4477525,
      "RequiredHttpHeaders": {},
      "DefaultAudioStreamIndex": 1
    }
  ],

They seem to be the same @@ebr

Link to comment
Share on other sites

The default media source of an item uses the item Id.

 

Note that this is not the most efficient way to support subtitles. It would be more efficient to download the subtitles separately and feed them into the video player. But I don't think I've fully documented this process for those who aren't using our api libraries

  • Like 1
Link to comment
Share on other sites

Be forewarned that internal subs have to be extracted from the video before delivery and, in some cases, this can cause a large delay in starting playback.  If you take this approach, please be sure to display a message while the video stream is starting stating that subs are extracting or something.

 

Once this happens once for any given video/sub track I'm pretty sure we keep the extracted one so it will be quick the next time.

Link to comment
Share on other sites

{
  "Name": "2 Guns",
  "ServerId": "7e3d7e2ac0e54624829ac4e63ca067ff",
  "Id": "c49c866cb486bd2a632b6f58efb07f8b", <-------------------------- itemid
  "Etag": "deee3c1d5e7b8b158b661b7f64b9852b",
  "DateCreated": "2013-11-12T01:16:21.0000000Z",
  "CanDelete": true,
  "CanDownload": true,
  "HasSubtitles": true,
  "PreferredMetadataLanguage": "",
  "PreferredMetadataCountryCode": "",
  "AwardSummary": "2 wins.",
  "Metascore": 55,
  "SupportsSync": true,
  "HasSyncJob": false,
  "IsSynced": false,
  "SortName": "2 guns",
  "ForcedSortName": "",
  "PremiereDate": "2013-08-02T05:00:00.0000000Z",
  "ExternalUrls": [
    {
      "Name": "IMDb",
      "Url": "http://www.imdb.com/title/tt1272878"
    },
    {
      "Name": "TheMovieDb",
      "Url": "http://www.themoviedb.org/movie/136400"
    }
  ],
  "MediaSources": [
    {
      "Protocol": "File",
      "Id": "c49c866cb486bd2a632b6f58efb07f8b", <------------------------------------------ mediasourceid
      "Path": "\\\\CORRUPTION-PC\\Movies$\\2 Guns (2013)\\2 Guns (2013).bluray.mkv",
      "Type": "Default",
      "Container": "mkv",
      "Name": "720P/H264/AC3",
      "RunTimeTicks": 65469760000,
      "ReadAtNativeFramerate": false,
      "SupportsTranscoding": true,
      "SupportsDirectStream": true,
      "SupportsDirectPlay": true,
      "RequiresOpening": false,
      "RequiresClosing": false,
      "VideoType": "VideoFile",
      "MediaStreams": [
        {
          "Codec": "h264",
          "Language": "eng",
          "IsInterlaced": false,
          "BitRate": 4477525,
          "BitDepth": 8,
          "RefFrames": 2,
          "IsDefault": true,
          "IsForced": false,
          "Height": 532,
          "Width": 1280,
          "AverageFrameRate": 23.976,
          "RealFrameRate": 23.976,
          "Profile": "Main",
          "Type": "Video",
          "AspectRatio": "2.40:1",
          "Index": 0,
          "IsExternal": false,
          "IsTextSubtitleStream": false,
          "SupportsExternalStream": false,
          "PixelFormat": "yuv420p",
          "Level": 31,
          "IsAnamorphic": false,
          "IsCabac": false
        },
        {
          "Codec": "ac3",
          "Language": "eng",
          "IsInterlaced": false,
          "ChannelLayout": "5.1",
          "BitRate": 384000,
          "Channels": 6,
          "SampleRate": 48000,
          "IsDefault": true,
          "IsForced": false,
          "Type": "Audio",
          "Index": 1,
          "IsExternal": false,
          "IsTextSubtitleStream": false,
          "SupportsExternalStream": false,
          "Level": 0
        },
        {
          "Codec": "srt",
          "Language": "eng",
          "IsInterlaced": false,
          "IsDefault": false,
          "IsForced": false,
          "Type": "Subtitle",
          "Index": 2,
          "IsExternal": false,
          "IsTextSubtitleStream": true,
          "SupportsExternalStream": true,
          "Level": 0
        },
        {
          "Codec": "srt",
          "Language": "eng",
          "IsInterlaced": false,
          "IsDefault": false,
          "IsForced": false,
          "Type": "Subtitle",
          "Index": 3,
          "IsExternal": false,
          "IsTextSubtitleStream": true,
          "SupportsExternalStream": true,
          "Level": 0
        },
        {
          "Codec": "srt",
          "Language": "fre",
          "IsInterlaced": false,
          "IsDefault": false,
          "IsForced": false,
          "Type": "Subtitle",
          "Index": 4,
          "IsExternal": false,
          "IsTextSubtitleStream": true,
          "SupportsExternalStream": true,
          "Level": 0
        },
        {
          "Codec": "srt",
          "Language": "spa",
          "IsInterlaced": false,
          "IsDefault": false,
          "IsForced": false,
          "Type": "Subtitle",
          "Index": 5,
          "IsExternal": false,
          "IsTextSubtitleStream": true,
          "SupportsExternalStream": true,
          "Level": 0
        },
        {
          "Codec": "srt",
          "Language": "eng",
          "IsInterlaced": false,
          "IsDefault": false,
          "IsForced": false,
          "Type": "Subtitle",
          "Index": 6,
          "IsExternal": true,
          "IsTextSubtitleStream": true,
          "SupportsExternalStream": true,
          "Path": "\\\\CORRUPTION-PC\\Movies$\\2 Guns (2013)\\2 Guns (2013).bluray.en.srt"
        },
        {
          "Codec": "srt",
          "Language": "fre",
          "IsInterlaced": false,
          "IsDefault": false,
          "IsForced": false,
          "Type": "Subtitle",
          "Index": 7,
          "IsExternal": true,
          "IsTextSubtitleStream": true,
          "SupportsExternalStream": true,
          "Path": "\\\\CORRUPTION-PC\\Movies$\\2 Guns (2013)\\2 Guns (2013).bluray.fr.srt"
        }
      ],
      "PlayableStreamFileNames": [],
      "Formats": [],
      "Bitrate": 4477525,
      "RequiredHttpHeaders": {},
      "DefaultAudioStreamIndex": 1
    }
  ],

They seem to be the same @@ebr

 

 

I wouldn't make that assumption though.  Especially, since you have the proper one right there.

Link to comment
Share on other sites

Angelblue05

Thanks for the tip. I just want to provide transcode that will not randomly fail when selecting a subtitle to play. I'll test the sub extraction to see if at least it allows playback to work everytime. Burning the sub into the video seems to fail a lot, so fingers crossed this will be a better approach :)

 

 

Sent from my iPhone using Tapatalk

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