Jump to content

Documentation on Emby structures, specificaly MediaSourceInfo / MediaStreams


sjpotter

Recommended Posts

sjpotter

as discussed in the feature requests section, I'm trying to write a channel to enable bluray playback from ISOs without needing to remux (i.e. remux on the fly).

What I don't understand is what to fill in MediaSourceInfo / MediaStreams

 

i.e. there seems to be a lot of "magic" string values that I'd need to know what they are to fill them in correctly (otherwise they'd be doing it incorrectly, bah dum, tss).  i.e. if I'm streaming m2ts files that can have mpeg2, vc1, avc (h264?), hevc and a bunch of audio codecs as well..  Is there any place that documents what values emby understand for all these magic strings?

 

 

Link to comment
Share on other sites

sjpotter

i.e. first MediaSourceInfo
 

  public class MediaSourceInfo
  {
    public MediaProtocol Protocol { get; set; }

    public string Id { get; set; }

    public string Path { get; set; }

    public string EncoderPath { get; set; }

    public MediaProtocol? EncoderProtocol { get; set; }

    public MediaSourceType Type { get; set; }

    public string Container { get; set; }

    public long? Size { get; set; }

    public string Name { get; set; }

    /// <summary>Differentiate internet url vs local network</summary>
    public bool IsRemote { get; set; }

    public long? RunTimeTicks { get; set; }

    public long? ContainerStartTimeTicks { get; set; }

    public bool SupportsTranscoding { get; set; }

    public bool SupportsDirectStream { get; set; }

    public bool SupportsDirectPlay { get; set; }

    public bool IsInfiniteStream { get; set; }

    public bool RequiresOpening { get; set; }

    public string OpenToken { get; set; }

    public bool RequiresClosing { get; set; }

    public string LiveStreamId { get; set; }

    [Obsolete]
    public int? BufferMs { get; set; }

    public bool RequiresLooping { get; set; }

    [Obsolete]
    public bool SupportsProbing { get; set; }

    public MediaBrowser.Model.Entities.Video3DFormat? Video3DFormat { get; set; }

    public List<MediaStream> MediaStreams { get; set; }

    public string[] Formats { get; set; }

    public int? Bitrate { get; set; }

    public TransportStreamTimestamp? Timestamp { get; set; }

    public Dictionary<string, string> RequiredHttpHeaders { get; set; }

    public string DirectStreamUrl { get; set; }

    public string TranscodingUrl { get; set; }

    public string TranscodingSubProtocol { get; set; }

    public string TranscodingContainer { get; set; }

    [Obsolete]
    public int? AnalyzeDurationMs { get; set; }

    [Obsolete]
    public bool ReadAtNativeFramerate { get; set; }
}

there's not much documentation for many of the fields, one can guess, but documentation would be better from a plugin / channel writer pov.

i.e. "container".  I can guess mkv, avi, mp3 et al.  But what about mpeg2 transport streams (mts or m2ts?).  Formats?

Type/MediaSourceType isn't a magic string, but I have no idea what the 3 enums mean

 

then we have the List of MediaStream objects, which results in this structure, which is basically all magic strings.  how am I supposed to know how to fill it out?
 

  public class MediaStream
  {
    private static ReadOnlyMemory<char>[] GraphicSubCodecNames = new ReadOnlyMemory<char>[3]
    {
      "DVB_TELETEXT".AsMemory(),
      "sub".AsMemory(),
      "dvb_subtitle".AsMemory()
    };
    private static ReadOnlyMemory<char>[] GraphicSubCodecPartialNames = new ReadOnlyMemory<char>[3]
    {
      "pgs".AsMemory(),
      "dvd".AsMemory(),
      "dvbsub".AsMemory()
    };
    private static ReadOnlyMemory<char> AssCodecName = "ass".AsMemory();
    private static ReadOnlyMemory<char> SsaCodecName = "ssa".AsMemory();

    /// <summary>
    ///   <para>Gets or sets the codec.</para>
    ///   <para>Probe Field: <c>codec_name</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />
    ///   <br />Related Enums: <see cref="T:T:Emby.Media.Model.Enums.VideoMediaTypes" />, <see cref="T:Emby.Media.Model.Enums.AudioMediaTypes" />, <see cref="T:Emby.Media.Model.Enums.SubtitleMediaTypes" />.</para>
    /// </summary>
    /// <value>The codec tag.</value>
    public string Codec { get; set; }

    /// <summary>
    ///   <para>Gets or sets the codec tag.</para>
    ///   <para>Probe Field: <c>codec_tag</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />.</para>
    /// </summary>
    /// <value>The codec tag.</value>
    public string CodecTag { get; set; }

    /// <summary>
    ///   <para>Gets or sets the language.</para>
    ///   <para>Probe Field: <c>tags["language"]</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />.</para>
    /// </summary>
    /// <value>The language.</value>
    public string Language { get; set; }

    /// <summary>
    ///   <para>Gets or sets the color transfer characteristics.</para>
    ///   <para>Probe Field: <c>color_transfer</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />
    ///   <br />Related Enum: <see cref="T:Emby.Media.Model.Enums.ColorTransfers" />.</para>
    /// </summary>
    /// <value>The color transfer characteristics value as string.</value>
    public string ColorTransfer { get; set; }

    /// <summary>
    ///   <para>Gets or sets the chromaticity coordinates of the source primaries.</para>
    ///   <para>Probe Field: <c>color_primaries</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />
    ///   <br />Related Enum: <see cref="T:Emby.Media.Model.Enums.ColorPrimaries" />.</para>
    /// </summary>
    /// <value>The chromaticity coordinates of the source primaries as string.</value>
    public string ColorPrimaries { get; set; }

    /// <summary>
    ///   <para>Gets or sets the YUV colorspace type.</para>
    ///   <para>Probe Field: <c>color_space</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />
    ///   <br />Related Enum: <see cref="T:Emby.Media.Model.Enums.ColorSpaces" />.</para>
    /// </summary>
    /// <value>The YUV colorspace type as string.</value>
    public string ColorSpace { get; set; }

    /// <summary>
    ///   <para>Gets or sets the comment.</para>
    ///   <para>Probe Field: <c>tags["comment"]</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />.</para>
    /// </summary>
    /// <value>The comment.</value>
    public string Comment { get; set; }

    /// <summary>
    ///   <para>Gets or sets the start time of the stream.</para>
    ///   <para>Probe Field: <c>start_time</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />.
    ///   <br />Actual type: <see cref="T:System.TimeSpan" />.</para>
    /// </summary>
    /// <value>The start time of the stream as ticks.</value>
    public long? StreamStartTimeTicks { get; set; }

    /// <summary>
    ///   <para>Gets or sets the time-base.</para>
    ///   <para>Probe Field: <c>time_base</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />.
    ///   <br />Actual type: <see cref="T:Emby.Media.Model.Types.Rational" />.</para>
    /// </summary>
    /// <value>The time-base as string.</value>
    public string TimeBase { get; set; }

    /// <summary>
    ///   <para>Gets or sets the codec time-base.</para>
    ///   <para>Probe Field: <c>codec_time_base</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />.
    ///   <br />Actual type: <see cref="T:Emby.Media.Model.Types.Rational" />.</para>
    /// </summary>
    /// <value>The codec time-base as string.</value>
    public string CodecTimeBase { get; set; }

    /// <summary>
    ///   <para>Gets or sets the title.</para>
    ///   <para>Probe Field: <c>tags["title"]</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />.</para>
    /// </summary>
    /// <value>The title.</value>
    public string Title { get; set; }

    /// <summary>
    ///   <para>Gets or sets the extradata.</para>
    ///   <para>Probe Field: <c>extradata</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />.</para>
    /// </summary>
    /// <remarks>Currently, this value is only parsed for subtitle streams with codec <see cref="T:Emby.Media.Model.Enums.SubtitleMediaTypes.dvb_teletext" />.</remarks>
    /// <value>The codec extradata as string.</value>
    public string Extradata { get; set; }

    public string VideoRange
    {
      get
      {
        if (this.Type != MediaStreamType.Video)
          return (string) null;
        string colorTransfer = this.ColorTransfer;
        return !string.IsNullOrEmpty(colorTransfer) && (string.Equals(colorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase) || string.Equals(colorTransfer, "arib-std-b67", StringComparison.OrdinalIgnoreCase)) ? "HDR" : "SDR";
      }
    }

    /// <summary>Gets or sets the display title.</summary>
    /// <value>The display title.</value>
    /// <remarks>Custom property set by the application.</remarks>
    public string DisplayTitle { get; set; }

    /// <summary>Gets or sets the display language.</summary>
    /// <value>The display language.</value>
    /// <remarks>Custom property set by the application.</remarks>
    public string DisplayLanguage { get; set; }

    /// <summary>
    ///   <para>Gets or sets the nal length size.</para>
    ///   <para>Probe Field: <c>nal_length_size</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" /> of type <see cref="T:Emby.Media.Model.Enums.VideoMediaTypes.h264" />.
    ///   <br />Actual type: <see cref="T:System.Int32" />.</para>
    /// </summary>
    /// <value>The nal length size as string.</value>
    public string NalLengthSize { get; set; }

    /// <summary>
    ///   <para>Gets or sets a value indicating whether this instance is interlaced.</para>
    ///   <para>Probe Field: <c>field_order</c> != <c>progressive</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />.</para>
    /// </summary>
    /// <value><c>true</c> if this instance is interlaced; otherwise, <c>false</c>.</value>
    public bool IsInterlaced { get; set; }

    /// <summary>Gets or sets the IsAVC property.</summary>
    /// <value>The IsAVC property.</value>
    /// <remarks>This is redundant. AVC means H264 codec.</remarks>
    public bool? IsAVC { get; set; }

    /// <summary>
    ///   <para>Gets or sets the channel layout.</para>
    ///   <para>Probe Field: <c>channel_layout</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />
    ///   <br />Related Enum: <see cref="P:MediaBrowser.Model.Entities.MediaStream.ChannelLayout" />.</para>
    /// </summary>
    /// <value>The channel layout string.</value>
    public string ChannelLayout { get; set; }

    /// <summary>
    ///   <para>Gets or sets the bit rate.</para>
    ///   <para>Probe Field: <c>bit_rate</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />.</para>
    /// </summary>
    /// <value>The bit rate.</value>
    /// <remarks>THIS VALUE IS PROCESSED BY CUSTOM LOGIC AND DOES NOT NECESSARILY MATCH FFPROBE RESULTS!</remarks>
    public int? BitRate { get; set; }

    /// <summary>
    ///   <para>Gets or sets the bit depth.</para>
    ///   <para>Probe Field: <c>bits_per_sample</c> or <c>bits_per_raw_sample</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />.</para>
    /// </summary>
    /// <value>The bit depth.</value>
    public int? BitDepth { get; set; }

    /// <summary>
    ///   <para>Gets or sets the reference frames.</para>
    ///   <para>Probe Field: <c>refs</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />.</para>
    /// </summary>
    /// <value>The reference frames.</value>
    public int? RefFrames { get; set; }

    /// <summary>Gets or sets the length of the packet.</summary>
    /// <value>The length of the packet.</value>
    [Obsolete("Currently this property doesn't have any write usage.'")]
    public int? PacketLength { get; set; }

    /// <summary>
    ///   <para>Gets or sets the audio channel count.</para>
    ///   <para>Probe Field: <c>channels</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />.</para>
    /// </summary>
    /// <value>The audio channel count.</value>
    public int? Channels { get; set; }

    /// <summary>
    ///   <para>Gets or sets the sample rate.</para>
    ///   <para>Probe Field: <c>sample_rate</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />
    ///   <br />Related Enum: <see cref="T:Emby.Media.Model.Enums.SampleRates" />.</para>
    /// </summary>
    /// <value>The sample rate as string.</value>
    public int? SampleRate { get; set; }

    /// <summary>
    ///   <para>Gets or sets a value indicating whether this instance is default.</para>
    ///   <para>Probe Field: <c>disposition["default"]</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />.</para>
    /// </summary>
    /// <value><c>true</c> if this instance is default; otherwise, <c>false</c>.</value>
    public bool IsDefault { get; set; }

    /// <summary>
    ///   <para>Gets or sets a value indicating whether this instance is forced.</para>
    ///   <para>Probe Field: <c>disposition["forced"]</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />.</para>
    /// </summary>
    /// <value><c>true</c> if this instance is forced; otherwise, <c>false</c>.</value>
    public bool IsForced { get; set; }

    /// <summary>
    ///   <para>Gets or sets the height.</para>
    ///   <para>Probe Field: <c>height</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />.</para>
    /// </summary>
    /// <value>The height.</value>
    public int? Height { get; set; }

    /// <summary>
    ///   <para>Gets or sets the width.</para>
    ///   <para>Probe Field: <c>width</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />.</para>
    /// </summary>
    /// <value>The width.</value>
    public int? Width { get; set; }

    /// <summary>
    ///   <para>Gets or sets the average frame rate..</para>
    ///   <para>Probe Field: <c>avg_frame_rate</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />.
    ///   <br />Actual type: <see cref="T:Emby.Media.Model.Types.Rational" />.</para>
    /// </summary>
    /// <value>The average frame rate as float.</value>
    public float? AverageFrameRate { get; set; }

    /// <summary>
    ///   <para>Gets or sets the real frame rate..</para>
    ///   <para>Probe Field: <c>r_frame_rate</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />.
    ///   <br />Actual type: <see cref="T:Emby.Media.Model.Types.Rational" />.</para>
    /// </summary>
    /// <value>The real frame rate as float.</value>
    public float? RealFrameRate { get; set; }

    /// <summary>
    ///   <para>Gets or sets the profile.</para>
    ///   <para>Probe Field: <c>profile</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />
    ///   <br />Related Enums: <see cref="T:Emby.Media.Model.Enums.AacProfiles" />, <see cref="T:Emby.Media.Model.Enums.AvcProfiles" />, <see cref="T:Emby.Media.Model.Enums.H263Profiles" />, <see cref="T:Emby.Media.Model.Enums.HevcProfiles" />, <see cref="T:Emby.Media.Model.Enums.Mpeg2Profiles" />,
    ///   <see cref="T:Emby.Media.Model.Enums.Vc1Profiles" />, <see cref="T:Emby.Media.Model.Enums.Mpeg4Profiles" />, <see cref="T:Emby.Media.Model.Enums.Vp8Profiles" />, <see cref="T:Emby.Media.Model.Enums.Vp9Profiles" />.</para>
    /// </summary>
    /// <value>The profile as string.</value>
    public string Profile { get; set; }

    /// <summary>
    ///   <para>Gets or sets the stream type.</para>
    ///   <para>Probe Field: <c>codec_type</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />
    ///   <br />Related Enums: <see cref="T:MediaBrowser.Model.Entities.MediaStreamType" />.</para>
    /// </summary>
    /// <value>The stream type as string.</value>
    public MediaStreamType Type { get; set; }

    /// <summary>
    ///   <para>Gets or sets the aspect ratio.</para>
    ///   <para>Probe Field: <c>display_aspect_ratio</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />.
    ///   <br />Actual type: <see cref="T:Emby.Media.Model.Types.Rational" />.</para>
    /// </summary>
    /// <value>The aspect ratio as string.</value>
    public string AspectRatio { get; set; }

    /// <summary>
    ///   <para>Gets or sets the index of the stream inside its container.</para>
    ///   <para>Probe Field: <c>index</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />.</para>
    /// </summary>
    /// <value>The index of the stream.</value>
    public int Index { get; set; }

    /// <summary>
    ///   <para>Gets or sets the probe score.</para>
    ///   <para>Probe Field: <c>probe_score</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Audio" />, <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Subtitle" />.</para>
    /// </summary>
    /// <value>The probe score.</value>
    public int? Score { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether this instance is external.
    /// </summary>
    /// <value><c>true</c> if this instance is external; otherwise, <c>false</c>.</value>
    /// <remarks>Custom property set by the application.</remarks>
    public bool IsExternal { get; set; }

    /// <summary>Gets or sets the method.</summary>
    /// <value>The method.</value>
    /// <remarks>Custom property set by the application.</remarks>
    public SubtitleDeliveryMethod? DeliveryMethod { get; set; }

    /// <summary>Gets or sets the delivery URL.</summary>
    /// <value>The delivery URL.</value>
    /// <remarks>Custom property set by the application.</remarks>
    public string DeliveryUrl { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether this instance is external URL.
    /// </summary>
    /// <value><c>null</c> if [is external URL] contains no value, <c>true</c> if [is external URL]; otherwise, <c>false</c>.</value>
    /// <remarks>Custom property set by the application.</remarks>
    public bool? IsExternalUrl { get; set; }

    public bool IsTextSubtitleStream
    {
      get
      {
        if (this.Type != MediaStreamType.Subtitle)
          return false;
        string codec = this.Codec;
        return (!string.IsNullOrEmpty(codec) || this.IsExternal) && MediaStream.IsTextFormat(codec.AsSpan());
      }
    }

    public static bool IsTextFormat(ReadOnlySpan<char> codec)
    {
      if (codec.IsEmpty)
        return true;
      foreach (ReadOnlyMemory<char> graphicSubCodecName in MediaStream.GraphicSubCodecNames)
      {
        if (MemoryExtensions.Equals(graphicSubCodecName.Span, codec, StringComparison.OrdinalIgnoreCase))
          return false;
      }
      foreach (ReadOnlyMemory<char> codecPartialName in MediaStream.GraphicSubCodecPartialNames)
      {
        if (MemoryExtensions.Contains(codec, codecPartialName.Span, StringComparison.OrdinalIgnoreCase))
          return false;
      }
      return true;
    }

    public bool SupportsSubtitleConversionTo(ReadOnlySpan<char> toCodec)
    {
      if (!this.IsTextSubtitleStream)
        return false;
      ReadOnlySpan<char> span1 = MediaStream.AssCodecName.Span;
      ReadOnlySpan<char> span2 = MediaStream.SsaCodecName.Span;
      if (MemoryExtensions.Equals(span1, toCodec, StringComparison.OrdinalIgnoreCase) || MemoryExtensions.Equals(span2, toCodec, StringComparison.OrdinalIgnoreCase))
        return false;
      ReadOnlySpan<char> readOnlySpan = this.Codec.AsSpan();
      return !MemoryExtensions.Equals(span1, readOnlySpan, StringComparison.OrdinalIgnoreCase) && !MemoryExtensions.Equals(span2, readOnlySpan, StringComparison.OrdinalIgnoreCase);
    }

    /// <summary>
    /// Gets or sets a value indicating whether [supports external stream].
    /// </summary>
    /// <value><c>true</c> if [supports external stream]; otherwise, <c>false</c>.</value>
    public bool SupportsExternalStream { get; set; }

    /// <summary>Gets or sets the filename.</summary>
    /// <value>The filename.</value>
    public string Path { get; set; }

    public MediaProtocol Protocol { get; set; }

    /// <summary>
    ///   <para>Gets or sets the pixel format.</para>
    ///   <para>Probe Field: <c>pix_fmt</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />.
    ///   <br />Actual type: <see cref="P:MediaBrowser.Model.Entities.MediaStream.PixelFormat" />.</para>
    /// </summary>
    /// <value>The pixel format as string.</value>
    public string PixelFormat { get; set; }

    /// <summary>
    ///   <para>Gets or sets the codec level.</para>
    ///   <para>Probe Field: <c>level</c>
    ///   <br />Applies to: <see cref="F:MediaBrowser.Model.Entities.MediaStreamType.Video" />
    ///   <br />Related Enums: <see cref="T:Emby.Media.Model.Enums.AvcLevels" />, <see cref="T:Emby.Media.Model.Enums.H263Levels" />, <see cref="T:Emby.Media.Model.Enums.HevcLevels" />, <see cref="T:Emby.Media.Model.Enums.Mpeg2Levels" />,
    ///   <see cref="T:Emby.Media.Model.Enums.Vc1Levels" />, <see cref="T:Emby.Media.Model.Enums.Mpeg4Levels" />, <see cref="T:Emby.Media.Model.Enums.Vp8Levels" />, <see cref="T:Emby.Media.Model.Enums.Vp9Levels" />.</para>
    /// </summary>
    /// <value>The codec level as string.</value>
    public double? Level { get; set; }

    /// <summary>
    /// Gets a value indicating whether this instance is anamorphic.
    /// </summary>
    /// <value><c>true</c> if this instance is anamorphic; otherwise, <c>false</c>.</value>
    public bool? IsAnamorphic { get; set; }

    /// <summary>Returns a string that represents the current object.</summary>
    /// <returns>A string that represents the current object.</returns>
    public override string ToString()
    {
      return string.Format("{0}: {1} {2}", (object) this.Type, (object) this.Codec, (object) this.DisplayTitle);
    }
  }
Edited by sjpotter
Link to comment
Share on other sites

PenkethBoy

Mediastreams info is read from the file via ffprobe when its discovered by emby during a library scan - you dont need to fill that in as Emby already does that

 

or are you trying to create a "new" record for a file that emby does not know about?

Link to comment
Share on other sites

sjpotter

I'm creating a channel that will provide m2ts files to emby via http, they won't be part of Emby's library.  At least at first.  I need to figure out how to populate this metadata (at least if I have to?  perhaps al I have to populate is language per track and container and emby would figure out the rest as it can demux m2ts itself?)

Link to comment
Share on other sites

PenkethBoy

IIRC Emby depends on having the media info to be able to play the file

 

i would look at Chefs latest plugin as thats creating a channel for new releases

Link to comment
Share on other sites

sjpotter

IIRC Emby depends on having the media info to be able to play the file

 

i would look at Chefs latest plugin as thats creating a channel for new releases

 

reference?  I'm new to all this

 

Have you looked at strm files - might be easier

 

https://support.emby.media/support/solutions/articles/44001159147-strm-files

 

interesting, I wonder if that would work with an m2ts file over http, would obliviate the need for a a channel

 

@@sjpotter just place some m2ts files in Emby's library. Then goto Emby swagger and look for MediaInfo.

 

good idea.  not that many permutations, can figure it out

 

Link to comment
Share on other sites

PenkethBoy

no direct reference - but its been talked about loads of times in the forums

 

If you expect things to follow/documentation - there is none to very little

 

only other people's plugins that are on github - and working through stuff yourself

 

Luke very occasional chips in but usually a one liner or two at best

Link to comment
Share on other sites

sjpotter

no direct reference - but its been talked about loads of times in the forums

 

If you expect things to follow/documentation - there is none to very little

 

only other people's plugins that are on github - and working through stuff yourself

 

Luke very occasional chips in but usually a one liner or two at best

I meant reference to the plugin you were talking about. 

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