-
Notifications
You must be signed in to change notification settings - Fork 17
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
x9k3 not create .m3u #1
Comments
do a
output should look like
Let me know if that works. |
I found what I believe to be the issue. Please upgrade threefive to 2.3.33 , I fixed a weird bug in the threefive.Stream class. python3 -mpip install --upgrade threefive
pypy3 -mpip install --upgrade threefive Let me know if this fixes it. |
Talk to me Goose..... |
Sorry for late reply. )) |
Also when i have UDP TS on x9k3 input, created segments not spliced correctly - it have mssing/dropped frames on the start/end of segments. |
Thanks for getting back to me man.
Don't worry man, we'll figure it out. Adrian |
Thank you for your time. |
We have two problems
#2, probably tomorrow. #1 will take a few days. |
2. UDP and X9K3I was able to reproduce the screwed-up video that you described, as well as the bad continuity counters. I just push threefive v.2.3.35 with the fix. python3 -mpip install --upgrade threefive
python3 -mpip install --upgrade threefive let me know what happens. Adrian |
Much to my surprise, x9k3 does handle mpeg2 video
Let me know what happens. |
You are the best! Unicast and multicast H264 are splitting now without issues. Also - is possible to add two features?
|
Do a test2_mp2.ts works perfectly for me.
|
Also - is possible to add two features?
|
git pull
x9k3$ pypy3
>>>> import x9k3
>>>> x9k3.version()
'0.0.93'
>>>>
|
That is super cool that the threads work on Windows. Sorry about the "hey" everywhere, I was checking when a method was getting called, |
Output dir option also workin fine )) |
Cool. I tried something new to handle Windows file paths and I was hoping it would work. |
As variant - delete segments (if exist) with number < MEDIA_SLOTS, when create each new segment. |
I think deleting would be best done externally. especially when the source is UDP, it's just too easy to drop packets. Deleting will have to interrupt x9k3 from reading from the socket, parsing the data does the same thing and it was dropping packets, and that's why I have it parse in a separate thread now. |
x9k3 not dropping packets when i try to use some my junk code before "seg_file = f"seg{self.seg_num}.ts"": |
Don't call your code junk, I like how you did that actually. I was thinking about how to clear up segments left by previous runs, import os
def del_segs():
with open('index.m3u8') as m3u8:
active = [line.strip() for line in m3u8.readlines() if line[0] not in ('#','\n')]
avail = [f for f in os.listdir() if f.endswith('.ts')]
[os.unlink(f) for f in avail if f not in active] |
I think I need to make a segment class, make a new instance when I start a new segment, and put instances in X9K3.queue. that would make it easier and help me clean up the code a bit. I'll get the delete in there for you, just give me a minute. Have you tried the 0.0.97? I put it up yesterday.I replaced threading with multiprocess, |
No big deal, I saw something about pickling and multiprocessing on Windows, it calls functools.partial, which I believe uses pickling to cache function args def readr(): # 340425 ~64MB
if not self._find_start():
return
for chunk in iter(
# functools.partial call here
partial(self._tsdata.read, self._PACKET_SIZE * self._NUM_PKTS), b""
):
work_queue.put(chunk)
return Give me a minute and I'll put up another version without pickling. |
git pull and tell me how it goes man. |
FYI, ( I really need to rename self.queue because I import the queue module. )
|
Hello.. Tested b.98, its working ok with TS file, but not work with UDP. C:\PyPy>pypy3.exe x9k3.py --live -delete -i udp://192.168.0.20:1234 MSDN about that error: Message too long. |
Change _NUM_PKTS to 57425 and see if that works https://github.com/futzu/x9k3/blob/main/x9k3.py#L57
|
Do me a favor and run this while x9k3 is running
replace <port_num> with the port of the udp stream What you're looking for is the length
|
After changing _NUM_PKTS = 57425 its working. But what that value mean? TCPDump show length 1316 bytes of each packet. |
NUM_PKTS is the number of mpegts packets x9k3 reads at a time. That's what I changed to get rid of your original problem. If that is your stream is on port 1234, it looks like multicast, you may want to try it with udp://@ instead of udp:// in the uri. |
Man the bitrate on that stream is almost twice what it should be, you should really consider running it through ffmpeg first to reduce the bitrate and then piping it to x9k3. Cut it down from 6000 to about 3500, and your hls playback with improve dramatically without a loss in quality. |
I use high bitrate only for test, currently it ~3Mbps. No difference in x9k3 behavior. But sometime have error and thread stops: C:\PyPy>pypy3.exe x9k3.py --live --delete -i udp://192.168.0.20:1234 C:\PyPy>pypy3.exe x9k3.py --live --delete -i udp://192.168.0.20:1234 |
This will make it easier. get v.0.0.99 and use ffmpeg to get the stream
# replace input.ts with your input stream
ffmpeg -re -copyts -i input.ts -map 0 -c copy -f mpegts - | python3 x9k3.py --delete
|
You can use anything, curl, multicat, ffmpeg, tsduck, whatever you like and pipe it into x9k3. This issue is resolved. |
Hello. Sorry for delay with answers. I'm not use file for test, always use UDP live stream with --live option. No difference unicast or multicast in x9k3 behavior. #EXTM3U Splice InsertSplice ImmediateSplice Point @ 223.853333#EXT-X-SCTE35:CUE="/DAgAAAAAAAAAP/wDwUAAAAAf/9+AAAAAAAAAAAAAD4xJP8=",CUE-OUT=YES Splice InsertSplice ImmediateSplice Point @ 231.757333#EXT-X-SCTE35:CUE="/DAgAAAAAAAAAP/wDwUAAAAAf39+AAAAAAAAAAAAAMgDgSY=",CUE-IN=YES Splice InsertSplice Immediate#EXT-X-SCTE35:CUE="/DAgAAAAAAAAAP/wDwUAAAAAf/9+AAAAAAAAAAAAAD4xJP8=" Splice InsertSplice ImmediateSplice Point @ 255.213333#EXT-X-SCTE35:CUE="/DAgAAAAAAAAAP/wDwUAAAAAf39+AAAAAAAAAAAAAMgDgSY=",CUE-IN=YES |
Hello. I try to use x9k3 segmenter but have no success.
First problem - its not create .m3u manifest file.
OS enviroment - Win7. I try to use Pypy3 or Python3, with admin rights - no success. Any suggestion?
Also its possible to select target directory for m3u and ts segments?
Second - it crash after some time with the same error.
Thank you.
The text was updated successfully, but these errors were encountered: