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

Replay mode , not looping the video #21

Closed alfonsosiloniz closed 10 months ago

alfonsosiloniz commented 10 months ago

Hello

I'm testing x9k3 to obtain a live signal with multiple scte35 cues. I've installed using the instructions, and tried to run the replay mode with a ts file to generate a live content.

I run as follows and added a LOOP trace to validate:

python3 x9k3.py -i ../sample.ts -r -o ../out
phosy@DESKTOP-FHL6Q1U:~/DEVEL/x9k3/x9k3-main$ python3 x9k3.py -i ../sample.ts -r -o ../out
LOOP
../out/seg0.ts:   start: 1.480000   end: 4.520000   duration: 3.040000
../out/seg1.ts:   start: 4.520000   end: 7.560000   duration: 3.040000
../out/seg2.ts:   start: 7.560000   end: 10.600000   duration: 3.040000
../out/seg3.ts:   start: 10.600000   end: 13.640000   duration: 3.040000
../out/seg4.ts:   start: 13.640000   end: 16.680000   duration: 3.040000
deleting ../out/seg0.ts
...
...
../out/seg14.ts:   start: 44.040000   end: 47.080000   duration: 3.040000
deleting ../out/seg10.ts
../out/seg15.ts:   start: 47.080000   end: 50.120000   duration: 3.040000
deleting ../out/seg11.ts
../out/seg16.ts:   start: 50.120000   end: 53.160000   duration: 3.040000
deleting ../out/seg12.ts
LOOP
LOOP
LOOP
LOOP

The problem is that the segments end when the sample video ends and I don´t see that it starts again. I've observed in the code that the while true loop is working but it seems the threefive decode stops

The sample I used is the following: https://www.dwsamplefiles.com/?dl_id=396

Any ideas? Thank you

futzu commented 10 months ago

I see what you're say, I won't be able look into it until later tonight, but I'll figure it out.

Adrian

futzu commented 10 months ago

Here's what's crazy, I have two laptops, it works perfectly on one and not on the other. Same version of x9k3 and threefive on both machines.

alfonsosiloniz commented 10 months ago

I've debugged this some time in my computer, and the problem is in this line:

https://github.com/futzu/x9k3/blob/4217f99b64f3b67bce7a3e236b7e91335158f5ec/x9k3.py#L297

It seems 'now' is reset when starting to read the file again, so it is never greater than self.started . I guess that this could happen here

https://github.com/futzu/x9k3/blob/4217f99b64f3b67bce7a3e236b7e91335158f5ec/x9k3.py#L337

what would be a mistery is why it happens to you only in one laptop and not in the other

futzu commented 10 months ago

I got a fix, hold on.

futzu commented 10 months ago

pip up to v0.1.91 and you should be good.

alfonsosiloniz commented 10 months ago

Yeap. This improves and now tries to loop. I close this issue, but, the playout does not work. I will do a PR as I've found how to make this works in the playout