kaltura / nginx-vod-module

NGINX-based MP4 Repackager
GNU Affero General Public License v3.0
2k stars 439 forks source link

Is mss hevc stream support? #1150

Open Bragaman opened 4 years ago

Bragaman commented 4 years ago

Hello,

I has created mss stream with h264 and it works, but I have a probleme to run mss with h265. I have valid manifest:

curl http://localhost:3030/mss/file_1v_1a.json/manifest                                                                                                                                                 
<?xml version="1.0" encoding="utf-8"?>
<SmoothStreamingMedia MajorVersion="2" MinorVersion="0" Duration="150190000">
  <StreamIndex Type="audio" QualityLevels="1" Chunks="8" Url="QualityLevels({bitrate})/Fragments(audio={start time})">
    <QualityLevel Index="0" Bitrate="463872" FourCC="AACL" SamplingRate="48000" Channels="6" BitsPerSample="16" PacketSize="0" AudioTag="255" CodecPrivateData="11B0"></QualityLevel>
    <c n="0" d="20053333"></c>
    <c n="1" d="20053334"></c>
    <c n="2" d="20053333"></c>
    <c n="3" d="19840000"></c>
    <c n="4" d="20053333"></c>
    <c n="5" d="20053334"></c>
    <c n="6" d="20053333"></c>
    <c n="7" d="10026667"></c>
  </StreamIndex>
</SmoothStreamingMedia>

But it does not play

ffplay http://localhost:3030/mss/file_1v_1a.json/manifest                                                                                                                                                
http://localhost:3030/mss/file_1v_1a.json/manifest: Invalid data found when processing input

I watched README.md and saw this line: Video codecs: H264, H265 (DASH/HLS), VP9 (DASH). No word about mss and H265 support.

My version of nginx vod module: 1.26 Thank you.

erankor commented 4 years ago

I don't think it's defined by the spec, if you have some working sample stream of MSS/HEVC, let me know...

Bragaman commented 4 years ago

It`s unreal for me to solve this on my own

What I have done:

  1. readed this
  2. added HEVC to supported codec in mss_manifest_request
  3. updated the minor version of the Manifest Response message

Of course, this does not help:

<?xml version="1.0" encoding="utf-8"?>
<SmoothStreamingMedia MajorVersion="2" MinorVersion="2" Duration="150190000">
  <StreamIndex Type="video" QualityLevels="1" Chunks="8" Url="QualityLevels({bitrate})/Fragments(video={start time})">
    <QualityLevel Index="0" Bitrate="14643200" FourCC="H264" MaxWidth="3840" MaxHeight="2160" CodecPrivateData="0000000140010C01FFFF22200000030090000003000003009695940900000001420101222000000300900000030000030096A001E020021C4D96565924CAF0101000003E800005DC0080000000014401C17AB46240"></QualityLevel>
    <c n="0" d="20000000"></c>
    <c n="1" d="20000000"></c>
    <c n="2" d="20000000"></c>
    <c n="3" d="20000000"></c>
    <c n="4" d="20000000"></c>
    <c n="5" d="20000000"></c>
    <c n="6" d="20000000"></c>
    <c n="7" d="10000000"></c>
  </StreamIndex>
  <StreamIndex Type="audio" QualityLevels="1" Chunks="8" Url="QualityLevels({bitrate})/Fragments(audio={start time})">
    <QualityLevel Index="0" Bitrate="463872" FourCC="AACL" SamplingRate="48000" Channels="6" BitsPerSample="16" PacketSize="0" AudioTag="255" CodecPrivateData="11B0"></QualityLevel>
    <c n="0" d="20053333"></c>
    <c n="1" d="20053334"></c>
    <c n="2" d="20053333"></c>
    <c n="3" d="19840000"></c>
    <c n="4" d="20053333"></c>
    <c n="5" d="20053334"></c>
    <c n="6" d="20053333"></c>
    <c n="7" d="10026667"></c>
  </StreamIndex>
</SmoothStreamingMedia>

I have valid manifest with audio&video, but it does not play:

ffprobe http://localhost:3030/mss/file1_1v_1a.json/QualityLevels\(14643200\)/Fragments\(video\=40000000\)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5563b0165ac0] could not find corresponding trex (id 1)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5563b0165ac0] trun track id unknown, no tfhd was found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5563b0165ac0] error reading header
http://localhost:3030/mss/file1_1v_1a.json/QualityLevels(14643200)/Fragments(video=40000000): Invalid data found when processing input

So I can’t fix it myself, maybe you can help me with some tips?

erankor commented 4 years ago

I didn't ask you to fix it, I asked for a sample stream... If there is some sample HEVC/MSS stream that you can find on the Internet + verify that it works on some device, then I can have a look

Bragaman commented 4 years ago

I tried to find some stream, but found anything, so I played with the source code for a while. If I found some stream, I will send it to you