futzu / SCTE-35_HLS_x9k3

HLS and SCTE-35 x9k3 is a HLS Segmenter with SCTE 35, and Live Streaming from Non-Live Soures and Looping.
67 stars 17 forks source link

Problematically its not working #11

Closed ashiskumarsahu closed 1 year ago

ashiskumarsahu commented 1 year ago

I have tried below command

import x9k3 x9 = x9k3.X9K3('media-1/segment-0.ts') x9.run()

Its stuck and I could not find any reason behind this.

Could you please suggest if I am doing this in correct way or not?

Thank You

futzu commented 1 year ago

Sorry about that, I left apply_args() out of the directions.

>>>> import x9k3
>>>> x9 = x9k3.X9K3("/home/a/mpegts/pcrvid.ts")
>>>> x9.apply_args()
>>>> x9.run()
./seg0.ts:   start: 14647.869389   end: 14649.910744   duration: 2.041355
./seg1.ts:   start: 14649.910744   end: 14651.912744   duration: 2.002000
./seg2.ts:   start: 14651.912744   end: 14652.879367   duration: 0.966623
futzu commented 1 year ago

That is kind of awkward having to call apply_args(), I am going put apply_args() inside of run() so that you don't have to call it.

futzu commented 1 year ago

I changed it so apply_args() is called by run() so with v.0.1.85 you don't need to call apply_args()

>>>> import x9k3
>>>> x9 = x9k3.X9K3("/home/a/mpegts/pcrvid.ts")
>>>> x9.run()
./seg0.ts:   start: 14647.869389   end: 14649.910744   duration: 2.041355
./seg1.ts:   start: 14649.910744   end: 14651.912744   duration: 2.002000
./seg2.ts:   start: 14651.912744   end: 14652.879367   duration: 0.966623
ashiskumarsahu commented 1 year ago

Hi @futzu, Thanks for this. I got another issue with x9.args.output_dir="/home/test/output/". You are already creating url in _args_output_dir function def _args_output_dir(self): if not os.path.isdir(self.args.output_dir): os.mkdir(self.args.output_dir) self.m3u8 = self.mk_uri(self.args.output_dir, "index.m3u8")

But in _write_m3u8 method again you are calling this, m3u8uri = self.mk_uri(self.args.output_dir, self.m3u8)

which results in failing output with below error, FileNotFoundError: [Errno 2] No such file or directory: '/home/test/output//home/test/output/index.m3u8'

Could you please check this correct?

Thank you

ashiskumarsahu commented 1 year ago

Hey @futzu ,

I found another issue in programmatic mode. The sidecar is not reading dynamically added string using printf from command line. Check below, x9 = x9k3.X9K3(test.ts) x9.args.sidecar_file="sidecar.txt" x9.args.time = 4 x9.args.hls_tag = "x_splicepoint" x9.args.live = True x9.run() Appending to sidecar $ printf '40.360000, /DAxAAAAAAAAAP/wFAUAAABdf+/+zHRtOn4Ae6DOAAAAAAAMAQpDVUVJsZ8xMjEqLYemJQ==\n' > sidecar.txt $ printf '63.880000, /DAxAAAAAAAAAP/wFAUAAABdf+/+zHRtOn4Ae6DOAAAAAAAMAQpDVUVJsZ8xMjEqLYemJQ==\n' > sidecar.txt

Below is the output is for pts near to 40. You can check no SCTE marker is inserted : seg7.ts: start: 35.560000 end: 40.360000 duration: 4.800000 seg8.ts: start: 40.360000 end: 45.160000 duration: 4.800000 seg9.ts: start: 45.160000 end: 50.120000 duration: 4.960000

Below is the output is for pts near to 63. You can check no SCTE marker is inserted : seg11.ts: start: 54.280000 end: 59.080000 duration: 4.800000 seg12.ts: start: 59.080000 end: 63.880000 duration: 4.800000 seg13.ts: start: 63.880000 end: 68.680000 duration: 4.800000 seg14.ts: start: 68.680000 end: 72.720000 duration: 4.040000 Could you please check if I missed something? Note that sidecar getting clear automatically but not sure why its not adding markers.

Thank you

futzu commented 1 year ago

It would be great if you would format your code here, it's really hard to follow with what you're showing me.

For your first issue, Does it work on the command line? show me your actual code and the whole error message. cut and paste it.

For your second issue. the problem is you don't understand how things work, you need to read up on SCTE35. x9k3 is behaving correctly. The error is on your end.

futzu commented 1 year ago

I didn't mean to close this. v.0.1.87 fixes the output_dir issue I just uploaded it.

The spice time on your second issue is 38113.135578, it shouldn't show up at 40 or 63.

ashiskumarsahu commented 1 year ago

Thanks for this. If you can share your email here, I want to hire you for a project.

futzu commented 1 year ago

Here's the thing about video and especially SCTE-35, it won't make sense. A lot of it will never make sense. All you can do is read the spec so you know the rules. I know that sounds ridiculous.

a@iodisco.com is me.

ashiskumarsahu commented 1 year ago

Sorry for that! I already told you I am new to SCTE-35.

Thanks for sharing your email. I have shard a scope of work doc. Please check and reply back.