futzu/SCTE-35_HLS_x9k3

How to pipe multi bitarte livestream content generated from ffmpeg?

Closed this issue · 9 comments

I am not sure if the below command is correct or not. My requirement is to insert SCTE35 marker to multi-bitrate livestream content generated from ffmpeg.

ffmpeg -i source.mp4 -map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0 -c:v libx264 -crf 22 -c:a aac -ar 48000 -filter:v:0 scale=w=480:h=360 -maxrate:v:0 600k -b:a:0 64k -filter:v:1 scale=w=640:h=480 -maxrate:v:1 900k -b:a:1 128k -filter:v:2 scale=w=1280:h=720 -maxrate:v:2 900k -b:a:2 128k -var_stream_map "v:0,a:0,name:360p v:1,a:1,name:480p v:2,a:2,name:720p" -preset slow -hls_list_size 0 -threads 0 -f hls -hls_playlist_type event -hls_time 3 -hls_flags independent_segments -master_pl_name "master.m3u8" "stream-%v.m3u8" -f mpegts - | x9k3 -s sidecar.txt -l

When I tried with this x9k3 always generating a index.m3u8 file with single bitrate. I want a master file and that should linked to resolution specific child manifest. Example,

master.m3u8
media-1
segment-1.ts
segment-2.ts
segment-n.ts
stream.m3u8
media-2
segment-1.ts
segment-2.ts
segment-n.ts
stream.m3u8
media-3
segment-1.ts
segment-2.ts
segment-n.ts
stream.m3u8

Appreciate your quick response.

Thank you

futzu commented

That's because it doesn't do that. :)
Sorry man.

Adrian

futzu commented

Most of what you need is in x9k3.I did a project about six months back that works like that, it was mostly x9k3 code,
so it's definitely possible.

Hi Futzu,
Is there any possibilities that it can behave in such way or it can program in any alternate way to do my job?
My requirement is like when segments for different version are generated by ffmpeg, x9k3 should read segments from each version and insert markers like below,

Pass 1
360/seg-1.ts
480/seg-1.ts
720/seg-1.ts

Pass 2
360/seg-2.ts
480/seg-2.ts
720/seg-2.ts

Pass 3
360/seg-3.ts
480/seg-3.ts
720/seg-3.ts

If SCTE message is set to insert after seg-3.ts, it should insert in all 3 version of media manifest.

Another issue what I observe is, when I tried ad detection and replacement with AWS media tailor it returning error like master manifest is required and seems to be you have pass a media manifest.

Can you do some quick modification on this so that it can support multi bitrate livestream content piping with ffmpeg? Suggesting any alternative solution is also highly appreciated.

Thank You

futzu commented

There is no alternative man.
Yeah I can do it.
Write me a complete spec of what you want, I'll give you quote .

Hi @futzu ,
Thanks for the response.
I would love to share that with you.
But before that I have to consult with my team. For that I need to clear on below queries:

Few query on the package,

  1. Is this package output only #EXT-X-SCTE35:CUE in manifest?

  2. Does this support injecting CUE OUT and CUE IN tag in following manner,
    #EXT-X-CUE-OUT:30.000
    ...
    #EXT-X-CUE-IN

  3. Does this support EXT-X-DATERANGE tag with SCTE35-OUT and DURATION specifications like below,
    #EXT-X-DATERANGE:ID="splice-6FFFFFF0",START-DATE="2019-01T00:15:00Z",SCTE35-OUT=0xF
    ...
    #EXT-X-DATERANGE:ID="splice-6FFFFFF0",START-DATE="2019-01T00:15:00Z",SCTE35-IN=0xF

  4. Does this support EXT-X-SPLICEPOINT-SCTE35 tag? Example,
    #EXT-X-SPLICEPOINT-SCTE35:/DA9AAAAAAAAAP/wBQb+uYbZqwAnAiVDVUVJAAAKqX//AAEjW4AMEU1EU05CMDAxMTMyMjE5M19ONAAAmXz5JA==
    ...
    #EXT-X-SPLICEPOINT-SCTE35:/DA4AAAAAAAAAP/wBQb+tTeaawAiAiBDVUVJAAAKqH+/DBFNRFNOQjAwMTEzMjIxOTJfTjUAAIiGK1s=

If yes please share any guide.

Thank You

futzu commented

Read the the README man, all of that is covered.

X-SCTE35, X-CUE, X-DATERANGE, or X-SPLICEPOINT HLS tags can be generated. set with the --hls_tag switch.

futzu commented

pip3 install --upgrade iframes
should fix the error.

Hi,
Thanks. Already fixed so removed the comment.

futzu commented

I am going to close this it's not an x9k3 issue.