Closed Avencheng closed 5 months ago
See where it says PMT Section Length 555?
It should much less
Output File: 2.ts
PMT Section Length: 90 <---- Section Length
Program Number: 1
PCR PID: 49
Program Info Length: 26
Added Registration Descriptor:
b'\x05\x04CUEI'
Found Streams:
Stream Type: 27 PID: 49 EI Len: 9
Stream Type: 4 PID: 50 EI Len: 3
Stream Type: 4 PID: 51 EI Len: 3
Stream Type: 4 PID: 52 EI Len: 3
Stream Type: 4 PID: 53 EI Len: 3
Stream Type: 134 PID: 54 EI Len: 0
Added Stream:
Stream Type: 134 PID: 134 EI Len: 0
How many streams dd you have in that video?
run
threefive show your_video.ts
and show me the output.
Also send me your whole command ffmpeg and superkabuki, you may just be starving superkabuki, it may be getting too far ahead. We can fix that easy in ffmpeg if needed.
PMTs are program specific, so even if you have multiple programs, that is still a big ass PMT.
Look at this, this is your problem
Program Number 18137 <------- This is odd
PCR PID 7857
Registration Descriptor added b'\x05\x04CUEI'
type: 73 len: 121 bytes: b'Iy\x10\xb6~\xccj\xd5\xc3v\x17\x93\x0cn\xe977\xe7\xe6\x89$@\x8d\x9b%\xbc\xb4d\xec2\xe7-\xf1\x07\x88\x8b\x1cG\x01\x00\x184\xa1^\xdc\x08))\xe6\xc19\x92|\xcb\xc8_dQ)s1\xd41\xf6g\xe0h\xd5~\x9c\xd3\xf1\x89M!\xda\x10\xd2\xb8O\xe6\x9a\xd1\xf2\xdd\xe7\xe3k\xff\xc7V\xf0Xm\x97\xe3ZI\xeb8\xa5' <---- this is super weird. I don't think I know a type 73,
It's blowing up parsing streams in the PMT.
Do a threefive show
on the video
and show me your whole command.
Apply some logic here, it has been working, and something changed, what changed?
I think the message of 'PMT Section Length 555' is from the udp://224.0.0.1:3536 which used for SCTE-35 insertion.
I use below ffmpeg command to stream the ts file as my program input:
ffmpeg -re -i image_cuetone_test.mp4 -vcodec libx264 -f mpegts udp://224.0.0.1:3535
there are two ffmpeg command in my program, one of them will output frames and PTS from udp://224.0.0.1:3535 for my program to detect and make the sidecar file.
Another ffmpeg command will make a delay stream :
ffmpeg -re -i "udp://@224.0.0.1:3535?overrun_nonfatal=1&fifo_size=50000000" -filter_complex "[0:v]tpad=start_duration=2[v];[0:a]adelay=2s:all=true[a]" -map "[v]" -map "[a]" -vcodec libx264 -f mpegts udp://224.0.0.1:3536
At last, the superkabuki command will insert the cues in the delay stream and output it to 230.0.0.14:3539 :
superkabuki -i udp://@224.0.0.1:3536 -s sidecar.txt -p 0x86 | gums -a 230.0.0.14:3539
The threefive show
output of input mp4 file:
(ffmpeg611_kabuki59) imagecuetone@imagecuetone-Virtual-Machine:~/Desktop$ threefive show image_cuetone_test.mp4
Program: 0
Service:
Provider:
Pid: 5120
Pcr Pid: 1
Streams:
Pid: 0[0x0] Type: 0x1 H.264 Video
Pid: 1[0x1] Type: 0x0 MPEG-2 Video
Pid: 20[0x14] Type: 0x0 MPEG-2 Video
Pid: 526[0x20e] Type: 0x0 MPEG-2 Video
Pid: 568[0x238] Type: 0x0 MPEG-2 Video
Pid: 631[0x277] Type: 0x0 MPEG-2 Video
Pid: 694[0x2b6] Type: 0x0 MPEG-2 Video
Pid: 964[0x3c4] Type: 0x0 MPEG-2 Video
Pid: 1024[0x400] Type: 5 Unknown
Pid: 1286[0x506] Type: 0x0 MPEG-2 Video
Pid: 3072[0xc00] Type: 0x2 MP2 Video
Pid: 3840[0xf00] Type: 0x0 MPEG-2 Video
Pid: 4096[0x1000] Type: 0x0 MPEG-2 Video
Pid: 5086[0x13de] Type: 0x0 MPEG-2 Video
Pid: 5120[0x1400] Type: 0x2 MP2 Video
Pid: 5632[0x1600] Type: 0x2 MP2 Video
Pid: 5888[0x1700] Type: 0x2 MP2 Video
Pid: 7168[0x1c00] Type: 19 Unknown
Pid: 8149[0x1fd5] Type: 0x0 MPEG-2 Video
Program: 2
Service:
Provider:
Pid: 3584
Pcr Pid: 847
Streams:
Pid: 0[0x0] Type: 0x3 MP2 Audio
Pid: 256[0x100] Type: 0x3 MP2 Audio
Pid: 512[0x200] Type: 0x3 MP2 Audio
Pid: 768[0x300] Type: 0x3 MP2 Audio
Pid: 815[0x32f] Type: 0x0 MPEG-2 Video
Pid: 845[0x34d] Type: 0x0 MPEG-2 Video
Pid: 847[0x34f] Type: 0x0 MPEG-2 Video
Pid: 1280[0x500] Type: 0x3 MP2 Audio
Pid: 1536[0x600] Type: 0x3 MP2 Audio
Pid: 1792[0x700] Type: 0x3 MP2 Audio
Pid: 2048[0x800] Type: 0x3 MP2 Audio
Pid: 2304[0x900] Type: 0x3 MP2 Audio
Pid: 2560[0xa00] Type: 0x3 MP2 Audio
Pid: 2816[0xb00] Type: 0x3 MP2 Audio
Pid: 3328[0xd00] Type: 0x3 MP2 Audio
Pid: 3584[0xe00] Type: 0x3 MP2 Audio
Pid: 3840[0xf00] Type: 0x3 MP2 Audio
Pid: 4096[0x1000] Type: 0x3 MP2 Audio
Pid: 4352[0x1100] Type: 0x3 MP2 Audio
Pid: 5120[0x1400] Type: 0x3 MP2 Audio
Pid: 5376[0x1500] Type: 0x3 MP2 Audio
Pid: 5632[0x1600] Type: 0x3 MP2 Audio
Pid: 5888[0x1700] Type: 0x3 MP2 Audio
Pid: 6144[0x1800] Type: 0x3 MP2 Audio
Pid: 6400[0x1900] Type: 0x2 MP2 Video
Pid: 6912[0x1b00] Type: 0x3 MP2 Audio
Pid: 7168[0x1c00] Type: 0x3 MP2 Audio
Pid: 7424[0x1d00] Type: 0x3 MP2 Audio
Pid: 7680[0x1e00] Type: 0x2 MP2 Video
Pid: 7936[0x1f00] Type: 0x3 MP2 Audio
Program: 3
Service:
Provider:
Pid: 3584
Pcr Pid: 846
Streams:
Pid: 0[0x0] Type: 0x3 MP2 Audio
Pid: 3[0x3] Type: 0x0 MPEG-2 Video
Pid: 256[0x100] Type: 0x3 MP2 Audio
Pid: 512[0x200] Type: 0x2 MP2 Video
Pid: 705[0x2c1] Type: 0x0 MPEG-2 Video
Pid: 714[0x2ca] Type: 0x0 MPEG-2 Video
Pid: 736[0x2e0] Type: 0x0 MPEG-2 Video
Pid: 740[0x2e4] Type: 0x0 MPEG-2 Video
Pid: 752[0x2f0] Type: 0x0 MPEG-2 Video
Pid: 755[0x2f3] Type: 0x0 MPEG-2 Video
Pid: 768[0x300] Type: 0x3 MP2 Audio
Pid: 788[0x314] Type: 0x0 MPEG-2 Video
Pid: 793[0x319] Type: 0x0 MPEG-2 Video
Pid: 801[0x321] Type: 0x0 MPEG-2 Video
Pid: 802[0x322] Type: 0x0 MPEG-2 Video
Pid: 804[0x324] Type: 0x0 MPEG-2 Video
Pid: 805[0x325] Type: 0x0 MPEG-2 Video
Pid: 807[0x327] Type: 0x0 MPEG-2 Video
Pid: 811[0x32b] Type: 0x0 MPEG-2 Video
Pid: 814[0x32e] Type: 0x0 MPEG-2 Video
Pid: 818[0x332] Type: 0x0 MPEG-2 Video
Pid: 820[0x334] Type: 0x0 MPEG-2 Video
Pid: 821[0x335] Type: 0x0 MPEG-2 Video
Pid: 823[0x337] Type: 0x0 MPEG-2 Video
Pid: 825[0x339] Type: 0x0 MPEG-2 Video
Pid: 830[0x33e] Type: 0x0 MPEG-2 Video
Pid: 832[0x340] Type: 0x0 MPEG-2 Video
Pid: 833[0x341] Type: 0x0 MPEG-2 Video
Pid: 836[0x344] Type: 0x0 MPEG-2 Video
Pid: 837[0x345] Type: 0x0 MPEG-2 Video
Pid: 840[0x348] Type: 0x0 MPEG-2 Video
Pid: 841[0x349] Type: 0x0 MPEG-2 Video
Pid: 843[0x34b] Type: 0x0 MPEG-2 Video
Pid: 845[0x34d] Type: 0x0 MPEG-2 Video
Pid: 846[0x34e] Type: 0x0 MPEG-2 Video
Pid: 847[0x34f] Type: 0x0 MPEG-2 Video
Pid: 1024[0x400] Type: 0x3 MP2 Audio
Pid: 1280[0x500] Type: 0x3 MP2 Audio
Pid: 1536[0x600] Type: 0x3 MP2 Audio
Pid: 1792[0x700] Type: 0x3 MP2 Audio
Pid: 2048[0x800] Type: 0x3 MP2 Audio
Pid: 2304[0x900] Type: 0x3 MP2 Audio
Pid: 2560[0xa00] Type: 0x3 MP2 Audio
Pid: 2816[0xb00] Type: 0x3 MP2 Audio
Pid: 3072[0xc00] Type: 0x2 MP2 Video
Pid: 3328[0xd00] Type: 0x3 MP2 Audio
Pid: 3584[0xe00] Type: 0x3 MP2 Audio
Pid: 3840[0xf00] Type: 0x3 MP2 Audio
Pid: 4096[0x1000] Type: 0x2 MP2 Video
Pid: 4352[0x1100] Type: 0x3 MP2 Audio
Pid: 4608[0x1200] Type: 0x3 MP2 Audio
Pid: 4864[0x1300] Type: 0x2 MP2 Video
Pid: 5120[0x1400] Type: 0x3 MP2 Audio
Pid: 5376[0x1500] Type: 0x2 MP2 Video
Pid: 5632[0x1600] Type: 0x2 MP2 Video
Pid: 5888[0x1700] Type: 0x3 MP2 Audio
Pid: 6144[0x1800] Type: 0x3 MP2 Audio
Pid: 6400[0x1900] Type: 0x3 MP2 Audio
Pid: 6656[0x1a00] Type: 0x3 MP2 Audio
Pid: 6912[0x1b00] Type: 0x3 MP2 Audio
Pid: 7168[0x1c00] Type: 0x2 MP2 Video
Pid: 7424[0x1d00] Type: 0x3 MP2 Audio
Pid: 7680[0x1e00] Type: 0x3 MP2 Audio
Pid: 7936[0x1f00] Type: 0x3 MP2 Audio
The threefive show
output of input stream:
(ffmpeg611_kabuki59) imagecuetone@imagecuetone-Virtual-Machine:~$ threefive show udp://224.0.0.1:3535
Reading rcvbuf_size of 212992
Setting rcvbuf_size to 3489660928
Program: 1
Service: Service01
Provider: FFmpeg
Pid: 4096
Pcr Pid: 256
Streams:
Pid: 256[0x100] Type: 0x1b AVC Video
Pid: 257[0x101] Type: 0x3 MP2 Audio
The threefive show
output of delay stream:
(ffmpeg611_kabuki59) imagecuetone@imagecuetone-Virtual-Machine:~$ threefive show udp://224.0.0.1:3536
Reading rcvbuf_size of 212992
Setting rcvbuf_size to 3489660928
Program: 1
Service: Service01
Provider: FFmpeg
Pid: 4096
Pcr Pid: 256
Streams:
Pid: 256[0x100] Type: 0x1b AVC Video
Pid: 257[0x101] Type: 0x3 MP2 Audio
There is nothing changed on my code and commands (I hope so), another difference is that I recreated my virtual environment, but i do keeping everything the same as before.
What baffled me was that it ran fine at the beginning, but crashed after several tens of minutes??
Dude, it's an MP4, threefive on works on mpegts. Everything with SCTE-35 has to be mpegts.
I showed you iframes didn't I? https://github.com/futzu/iframes
What is a delay stream? Do this man, try it with just files and no multicast see if everything works. I wouldn't use 224.0.0.1, that's the all hosts group, it just seems like 224.0.0.0/24 might be problematic.
make sure your datagram size is 1316 coming from ffmpeg,
Judging by rcvbuf_size of 212992, you using a UNIX based OS, so that's good.
Grab a program called btop, and run in another terminal, just so we see what's happening with the processes.
Why are you using multicast? for the parts that one sender and one receiver use UDP, if it's on the same server, write files.
WAIT!
SuperKabuki, which runs on threefive, is seeing Program Number 18137 PCR PID 7857
but threefive show is seeing
Program 1 PCR PID 256
Program: 1
Service: Service01
Provider: FFmpeg
Pid: 4096
Pcr Pid: 256
Streams:
Pid: 256[0x100] Type: 0x1b AVC Video
Pid: 257[0x101] Type: 0x3 MP2 Audio
I think you have superkabuki working on an the mp4 stream not mpegts.
I used to work on that MP4 file before, it worked. the ffmpeg command that I showed you above would convert it into mpegts :
ffmpeg -re -i image_cuetone_test.mp4 -vcodec libx264 -f mpegts udp://224.0.0.1:3535
yeah, I agree it is better not to use 224.0.0.1. I tried the 239.0.0.1, but the problem is still there.
now I have used a real TV signal as my input, the problem no longer occurs so far, but I still need more time to test it.
Thank you so much, Adrian!
A few things to keep in mind.
-b 127.0.0.1
to your gums command it is much faster.Thanks for your helpful suggestions!
After few days of testing, I guess the error of index out of range
is caused by ffmpeg. My test method is using TV stream as my superkabuki input, that means the TV stream doesn't need to go through my ffmpeg delay command before it goes in the superkabuki command. in this case, the error of index out of range
never occurs.
But there is another issue, the cues in my sidecar never be inserted. I'm sure that PTS of my insert_pts and cues are bigger than stream's PTS. below is the outputs of my superkabuki command :
Reading rcvbuf_size of 212992
Setting rcvbuf_size to 3489660928
Reading rcvbuf_size of 212992
Setting rcvbuf_size to 3489660928
Output File: output.ts
PMT Section Length: 55
Program Number: 671
PCR PID: 6119
Program Info Length: 12
Added Registration Descriptor:
b'\x05\x04CUEI'
Found Streams:
Stream Type: 27 PID: 6116 EI Len: 20
Stream Type: 3 PID: 6117 EI Len: 0
Added Stream:
Stream Type: 134 PID: 134 EI Len: 0
The threefive show
output of the TV stream:
(ffmpeg7_kabuki59) imagecuetone@imagecuetone-Virtual-Machine:~/detect_stream_insert_35$ threefive show udp://@229.0.0.7:9000
Reading rcvbuf_size of 212992
Setting rcvbuf_size to 3489660928
Program: 671
Service: CTINews-HD
Provider: DiviCom Customer
Pid: 6115
Pcr Pid: 6119
Streams:
Pid: 6116[0x17e4] Type: 0x1b AVC Video
Pid: 6117[0x17e5] Type: 0x3 MP2 Audio
Let me know if you need more informations. Thanks
More informations!
I saved the TV signal as a ts file and use this ts file as my input streaming source, then the cues can be successfully inserted.
The command I used for saving the TV signal as a ts file :
ffmpeg -i udp://229.0.0.7:9000 -c copy middlesky_IRD.ts
The threefive show
output of the ts file:
imagecuetone@imagecuetone-Virtual-Machine:~/detect_stream_insert_35$ threefive show middlesky_IRD.ts
Read 100 packets
Program: 1
Service: Service01
Provider: FFmpeg
Pid: 4096
Pcr Pid: 256
Streams:
Pid Type
256 [0x100] 0x1b AVC Video
257 [0x101] 0x3 MP2 Audio
I think the problem of index out of range
has been resolved.
Just like you said, I should make sure that the datagram size is 1316 coming from ffmpeg . So I added ?pkt_size=1316
for the output destination on my delay stream ffmpeg command. so now it looks like ffmpeg -re -i 'udp://@229.0.0.7:9000?overrun_nonfatal=1&fifo_size=50000000' -filter_complex "[0:v]tpad=start_duration=2[v];[0:a]adelay=2s:all=true[a]" -map "[v]" -map "[a]" -vcodec libx264 -f mpegts 'udp://229.0.0.7:9001?pkt_size=1316'
.
I have been running the program on a Ubuntu VM on Windows. I didn't encounter any issues when running program without adding ?pkt_size=1316
before, the problem of index out of range
only occurred after I rebuilt the Ubuntu VM.
I am not Ubuntu on Windows support man, and that ffmpeg command seems a bit convoluted to me. You can hire me to do this, it would probably take me two maybe three days tops.
Hi! It's me again :)
I kept getting the same error after running my program for a while, and it never happened before. I used the following packages for superkabuki 0.0.59 :
The error i got when i using 0.0.59.
I also tried the older version (superkabuki 0.0.49), which I think was perfect as well, but now I got similar error as above, i used the following for superkabuki 0.0.49 :
Interestingly, It suddenly insert all the cues which has already been inserted at the corresponding time. The error i got when i using 0.0.49.
Do you have any idea about what's going on? And let me know if you need more information. Thanks!