-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do You Like The Current Output of X9K3? Do You Have A Better Idea? #10
Comments
Hey @futzu, For sidecar file inputs are in pts format. I was assuming like if it could support duration format as well. Ex, if duration is 0:01:58 - marker will get inserted here or near by segment break. Here is another scenario, suppose we have a scte35 marker in a live stream of football match and an ad is replaced and playing with that point considering a commercial break. Now think if the match started but break is still not over but I want to trigger something that would help to back to main stream without waiting for ads break to close. i am not sure if this is possible currently or not? Thank You |
In terms of producing a machine-readable structured data log to generate an as-run / as-ran report, JSON output would be cool. So that a logfile could be parsed / filtered with the super awesome But for general command-line usage at the terminal, the current stderr format is clear and concise. System time ISO 8601 would be helpful for post log analysis of a live stream. Obviously, this going to be approximate, taking account of segment time, but it could be the program_date_time value. At present, this can be achieved from looking at file system timestamp, but since you asked for features to keep you busy, system time of when the event occurred (file creation, cue) would be helpful. Program date time in the HLS output goes some way to achieve this, but of course with a sliding window, that requires that the m3u8 is continuously logged by another mechanism. Freestylin' here but something along the lines of: {
"event": {
"id": "an_ordinal_number",
"eventtype": "[ segment_write_out | cue ]",
"segmentfile": "./seg146.ts",
"cue": "/DAvAAAAAAAAAP/wFAUAAAKWf/somekindofsctenonsense==",
"start": "1147.466667",
"duration": "6.000000",
"program_timestamp": "2022-12-27T19:06:15Z",
"pts": "89981.281522"
},
etc... presence of cue and segmentfile would depend on eventtype.
} Edit: In hindsight, extension of the Also, write-out of filenames in Full disclosure: I'm not actively using x9k3 in production, I use AWS MediaLive, but this is a super interesting project that I keep an eye on - and an open source tool is much needed tool for the industry. I think the only other open-source one of note is Shaka Packager, which is very limited when it comes to live. I like your work. |
I have been thinking about what you were wanting to do with ABR, and how to do it. I am working on it. I was wondering if duration might be something people wanted, I usually call that "hls time", I dont what the official name is, So you would prefer duration over pts? Interrupting commercial is definitely possible, In live mode with a sidecar file you can add pts, cue lines while its running and, once x9k3 reads them it erases from the file. I do it like this printf '114.633333,/DAhAAAAAAAAAP/wEAUAAAAJf78A/gASZvAACQAAAACokv3z\n' >> sidecar.txt It should interrupt , but if it doesn't it would not be hard to make it do so. |
@bbgdzxng1 I was wondering when someone was going to bring up segment naming :) I expected it much sooner to be honest. I am trying to figure out how to do ABR effectively. I am not offended you not using x9k3, if it doesnt give you what you need, but I dont trust amazon at all myself :) |
One of the challenges of dealing with ABR is keeping the segments in sync for fussy players or where scene change i-frames may not always have been inserted by x264 in lower-res profiles. I try to keep a consistent IDR keyframe heartbeat in the encode, irrelevant on any I-frames that a codec may or may not throw in there. And when generating the ABR with FFmpeg, the tee muxer does help create discreet files that have some commonality, or FFmpeg's One option may be to feed your packager with a multiplexed A/V stream, containing all the video and audio Obviously, there is already bento, GPAC/mp4box and Apple Segmenter which can operate as pure packagers, and Shaka My requirements for packaging are now a lot more complex these days - I've been in a simple HLS shop, but now deal with DASH, multi-flavor DRM, even some CMAF... all with ad insertion. But I'm so pleased that someone is leading the charge on real-time HLS segmentation with all the various flavors of cue messages, SCTE data tracks, HLS manifest decoration, so many flavors of CUE-OUT etc in plain old HLS. You are filling a huge gap in the market for the open-source HLS w/ad marker. With FFmpeg & x9k3 the barrier to creating a linear TV channel with ad insertion no longer relies on trying to do the manifest manipulation on origin with Nginx and a dirty script. As for the file naming, please don't develop on my account, but I do know from experience that a clean file naming convention really makes debugging so much easier, so I am confident that it will be valued by your users. strftime() named files make Catchup VoD of a live channel just a matter of manifest index creation between timestamped files. Some countries' regulatory bodies require by law that a N-week window is kept on record in case of complaint, even if not doing Catchup VoD. strftime() makes that whole process easy to achieve and housekeep. But it sounds like you already had already spotted that one. I still rely on good ole |
Hey @futzu , For ABR how you are planing? As x9k3 takes mpegts input, is it possible to input multiple mpegts? input http stream having a master manifest with 4 media manifest, so each version of segments should be simultaneously read and insert markers on each version sententiously.
Is the pts_time same with duration in seconds? Suppose I want to add a splice point at 2 minutes of content. Can I pass 120.000000 in above command? Thank you |
@bbgdzxng1 |
@ashiskumarsahu that is what Im thinking the multiple mpegts inputs, because with m3u8 files, x9k3 would have to assemble the segments and slice them back up. I wont have that any time soon though. 114.633333 is a pts time, x9k3 doesnt currently duration times, PTS is stamped on the mpegts stream, Everything is pts because SCTE-35 is always in terms of pts. |
@bbgdzxng1 have you tried gumd? That is my favorite. |
@futzu my days of UDP multicast are over, but I see what you are doing with gumd. I'm either using pipes between apps or srt.
As for getting the CODECS, I work in higher-level scripts and commands, rather than the elegance of python, so I use FFprobe, which would be far too heavy for your world... and not particularly robust.
If you have not played with it yet, take a look at the quite brilliant https://github.com/wader/fq, which is a whole header parser written in go (json & hexdump outputs). The gentleman who has put But I suspect that you'll prefer to pull it out of the SPS yourself, but no harm in stubbing something out in Here's the genius of 'fq' of how easy it is to navigate the SPS...
or
Dirty workaround: The CODECS statement is only really a constraint so that a HLS player can check whether it should skip that rendition or not in case of mixed 264/265 in the same master, so lazy folks have been known to hardcode something like avc1/high/4.1 and HE-AACv1, just to get going. Since avc high, by definition, is a superset of main & baseline and HE-AACv1 is a superset of AAC-LC. It is obviously not good to hardcode, but you could stub it out for the time being (don't shoot me for what is a knowingly nasty workaround). The CODECS is basically just a capabilities check that the player uses at master-parse-time to avoid subsequently decoding a stream it would be incapable of playing. |
Hey @futzu , Is there any easiest way to get pts time in live mode for SCTE insertion? Thank You |
@ashiskumarsahu in v.0.1.75 the start in the output is PTS. ./seg0.ts start: 102.506478 duration: 2.126855
./seg1.ts start: 104.633333 duration: 2.000000
./seg2.ts start: 106.633333 duration: 2.000000
./seg3.ts start: 108.633333 duration: 2.000000 I just pushed version 0.1.77 a@debian:~/build/clean/x9k3$ pypy3 x9k3.py -i ../la-slim.ts -s sidecar.txt
./seg0.ts: start:102.506478 end:104.633333 duration:2.126855
./seg1.ts: start:104.633333 end:106.633333 duration:2.0
./seg2.ts: start:106.633333 end:108.633333 duration:2.0
./seg3.ts: start:108.633333 end:110.633333 duration:2.0
./seg4.ts: start:110.633333 end:112.633333 duration:2.0
./seg5.ts: start:112.633333 end:114.633333 duration:2.0
./seg6.ts: start:114.633333 end:114.7 duration:0.066667 |
@bbgdzxng1, |
@bbgdzxng1 I am looking for a SRT lib I can use with new_reader. |
I've found the Haivison reference tools & examples to be pretty good, even if they are tagged as "not for production"... but I believe they are in C++. https://github.com/Haivision/srt/blob/master/apps/srt-live-transmit.cpp, but again, I've only used them as compiled binaries. I've used FFmpeg and TSDuck, but Haivision live-transmit tended to be more reliable. I've not played with any SRT libraries in the pythonic domain.
|
@ashiskumarsahu what you want I can do for you in about 2 weeks, if you want to hire me. As far as me adding that to x9k3, I may eventually do it, but it would be months before I even start on it. I Work on x9k3 when I have some spare time. Its not my focus. |
@futzu Please share your your email. So that I can share my requirement. Thank You |
I want to hire you for that project. Could you please share your email? I will send my requirement and in reply I need a quote. Accordingly we can make the deal. |
Say something.
I am open to suggestions.
The text was updated successfully, but these errors were encountered: