add udp protocol support
moran-x opened this issue · 50 comments
For a long time I could not understand why my playlist is not loaded into the program, as it turned out, the reason is that all the links in the list are in this format udp://@239.1.17.16:1234 and, as I understand it, the udp protocol is not supported. could you add it?
There is also one more wish, there is a ffprobe program that allows you to get information about the stream, including the name of the channel, this would allow you to automatically rename channels in the lists, or generate a custom name.
Never had links with udp so far.
Can you give me some as an example for testing?
ffprobe: So you have a list with unnamed links and with ffprobe you get the name?
here is an example file
239.1.1.x.zip
when you import it, the error "Wrong data structure!" occurs, but if you replace udp with http in the links, the file will open. and when it opens in the table, there are only two columns of name and url, how to add the rest, such as a logo, a group?
ffprobe: yes, as you will see in my playlist, all channels are without names, the file is obtained by scanning the provider's local network.
I made a quick fix, please try it. Do the links play in vlc? I have a black screen in vlc when I try.
thanks, everything works fine and opens in vlc, your link is unlikely to open because it works within my provider
Do you have a working ffprobe parameter string to get the name?
in python i was getting data like this
ffprobe -v quiet -print_format json -show_programs udp://@239.1.1.1:1234
program output in json format, and then parsing
data.zip
Would be service_name tag as the channel name?
Im thinking of context menu of name cell to get the channel name via ffprobe
yes, this is the name of the channel, again it depends on the service provider, whether he has registered this tag.
I also ran into the problem that ffprobe does not extract data immediately, I had to first connect to the stream in the background for 5-10 seconds, and then extract the json data
ok, I will make a test version an give it to you for testing. Timeouts are always a pain for automatic scripts
I don't have a working stream url with a title from ffprobe to check the code. Do you have some for me?
Unfortunately, I did not find any public address where such information would be.
Please try it. Right click on name cell -> Get Name
PlaylistEditorIPTV_v1.6.7d.zip
like the numbering function, click on the cell where you would like the Name copy to. Column 1 and 5 "Name" and "Name2"
and ffprobe must be in PATH or in the same dir as the program
should work on any cell now. If not, try to copy ffprobe.exe to the program dir
You should get a message window with the ffprobe result it it is working
does not work, there is no menu item. Where does the program store the settings?
there is no restriction in the menu anymore, the version is 1.6.7.2 in header, thee ffprobe path is not stored in settings
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidOperationException: Cannot start process because a file name has not been provided.
at System.Diagnostics.Process.Start()
at PlaylistEditor.ClassHelp.GetStreamName(String linkUrl, String ffprobepath)
at PlaylistEditor.Form1.cms1GetName_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
ffprobe in the folder with the program
PlaylistEditorIPTV_v1.6.7.3d.zip
next try
does not work, does not receive data, even after I connect to the stream and watch it.
response ffprobe: {}
not surprised, please try
ffprobe -v quiet -print_format json -show_programs "link"
in cmd shell. If you don't get anything, what is the working parameter set and the respond in cmd?
here is an example of a public thread
ffprobe -v quiet -print_format json -show_programs https://okkotv-live.cdnvideo.ru/channel/Sony_Turbo.m3u8
but there is no tag with the name of the channel
and this command returns data, but only within my provider
ffprobe -v quiet -print_format json -show_programs udp://@239.1.1.9:1234
thanks, the ffprobe process is closing too fast I think.
ok..... will look into it
PlaylistEditorIPTV_v1.6.7.4d.zip
next version. Do you see some other UI elements with encoding problems (unicode chars)?
I use UFT8
Can you write the ffprobe output to a file and give it to me?
after changing the codepage to utf8 (chcp 65001)
output in archive with default codepage value
data.zip
PlaylistEditorIPTV_v1.6.7.5d.zip
I have set the encoding of the cmd shell to UTF8, lets fingers X
The ffprobe response is really slow, I could not get a crash so far.
works, but only with those channels to which the connection was made, the socket is open
PlaylistEditorIPTV_v1.6.7.zip
Please try
nothing has changed, it also hangs if it cannot receive data. and without prior connection does not receive data.
2022-02-04.10-44-26.mp4
there is no failure. This is not the first time I've written about the fact that getting data from an HTTP link and from UDP is slightly different. for http there is no need to pre-connect to the stream. but for udp, you must first connect to the stream, and then request data using ffprobe.
here is an example
https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.udpclient.receive?ranMID=46131&ranEAID=a1LgFw09t88&ranSiteID=a1LgFw09t88-v8Q2uuBWdnGmaDoNff4_QA&epi=a1LgFw09t88-v8Q2uuBWdnGmaDoNff4_QA&irgwc=1&OCID=AID2200057_aff_7806_1243925&tduid=(ir__rzsxsshia0kfqxukkk0sohz3zu2xtx0wb9u920av00)(7806)(1243925)(a1LgFw09t88-v8Q2uuBWdnGmaDoNff4_QA)()&irclickid=_rzsxsshia0kfqxukkk0sohz3zu2xtx0wb9u920av00&view=net-6.0
I used about the same code in python to get data about the stream, everything is simple with http links, but there were problems with udp.
I saved the last code in the dev_ffprobe branch, the method is in classhelp GetFFrobeStreamName
at least I could reproduce your "crash" now. Its not a crash, just waits for response indefinitely. I send some data to UPD in advance, no change.
I did not much with python, but can you give me the code to look at the structure?
the UDP has a 5s timeout, give it a try
does not receive data, even if it first connects to the stream
do you have a idea how I can test this?
no, unless your ISP broadcasts IPTV in a UDP stream.
I made a logfile writer. Pease send me the PlaylistEditorlog.txt file - Thanks
Before connecting to a stream in the IPTV viewer
Log Entry : 12:34:33 PM Monday, February 21, 2022
:
:PlaylistEditor.ClassHelp.UDPSentRec
Exception! 239.1.1.8:1234
-------------------------------
Log Entry : 12:34:33 PM Monday, February 21, 2022
:
:PlaylistEditor.ClassHelp.GetFFrobeStreamName
UDP Answer False
-------------------------------
After connecting to a stream in the IPTV viewer
Log Entry : 12:36:20 PM Monday, February 21, 2022
:
:PlaylistEditor.ClassHelp.UDPSentRec
Exception! 239.1.1.8:1234
-------------------------------
Log Entry : 12:36:20 PM Monday, February 21, 2022
:
:PlaylistEditor.ClassHelp.GetFFrobeStreamName
UDP Answer False
-------------------------------
Thanks, if I understand your program correctly, it is listening to the IP:port for up to 10 s and does not send something, right?
will probably crash. If the udp receive something, it returns true, if its not working the ffprobe process does not response and timeout is not working.
And, copy paste has issues
PlaylistEditorIPTV_v1.7.01d.zip
Thanks, if I understand your program correctly, it is listening to the IP:port for up to 10 s and does not send something, right?
Yes
here is an example of working with multicast on c#
https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.multicastoption?ranMID=46131&ranEAID=a1LgFw09t88&ranSiteID=a1LgFw09t88-gznHSov7JkK7ScjfW7bitw&epi=a1LgFw09t88-gznHSov7JkK7ScjfW7bitw&irgwc=1&OCID=AID2200057_aff_7806_1243925&tduid=(ir__rzsxsshia0kfqxukkk0sohz3zu2xt3d9s0u920av00)(7806)(1243925)(a1LgFw09t88-gznHSov7JkK7ScjfW7bitw)()&irclickid=_rzsxsshia0kfqxukkk0sohz3zu2xt3d9s0u920av00&view=net-6.0
will probably crash. If the udp receive something, it returns true, if its not working the ffprobe process does not response and timeout is not working.
And, copy paste has issues PlaylistEditorIPTV_v1.7.01d.zip
does not work
Log Entry : 10:43:20 AM Wednesday, February 23, 2022
:
:PlaylistEditor.ClassHelp.GetFFrobeStreamName
UDP Answer 2 False
-------------------------------
PlaylistEditorIPTV_v1.7.03d.zip
next try
BTW: does it work with your special columns?
cannot fix without working links - closed