GithubHelp home page GithubHelp logo

ponwork / multicast-checker Goto Github PK

View Code? Open in Web Editor NEW
44.0 44.0 19.0 126 KB

IPTV channels streams checker/scanner (UDP based)

License: MIT License

Python 100.00%
ffmpeg ffprobe m3u multicast scanner udp

multicast-checker's People

Contributors

ponwork avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

multicast-checker's Issues

Scheduler with history and smart repky

To add the following:

  • saving the current list of non-working channels to a memory (temp list);
  • schedule the checks (period as a parameter, default: 1h);
  • send an email if the connection was restored.

[Suggestion] Output playlist sorted by IP address

Hello.
Can you please add option to make output m3u playlist sorted by ip address?
For example:

#EXTM3U
#EXTINF:2,Channel: 234.0.10.02:1234
udp://@234.0.10.02:1234
#EXTINF:2,Channel: 234.0.10.03:1234
udp://@234.0.10.03:1234
#EXTINF:2,Channel: 234.0.10.04:1234
udp://@234.0.10.04:1234
#EXTINF:2,Channel: 234.0.10.05:1234
udp://@234.0.10.05:1234
...

Using on Raspbian

Hi,
I'm trying to use this on a Raspberry, with Raspbian.
the multicast-checker indicates there's no multicasts.

There's multicasts on the ethernet interface. Actually, this very Raspberry is multicasting one of them.
I indicate the correct interface IP
I use a playlist that works perfectly in VLC.
I did change the regular expression code for the m3u parser, in order to get any order number.
I added a some debug prints, I was in doubt if the socket was being created.

python3 ./multicast-checker.py --playlist ../PBT.canais_sample.m3u --nic 10.22.224.100
[*] Email parameters are not defined.
[*] Run the script with -h parameter for the details.

socket  <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=17, laddr=('10.22.224.100', 1234)>
socket  <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=17, laddr=('10.22.224.100', 5501)>
socket  <socket.socket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=17, laddr=('10.22.224.100', 5501)>
address:  239.251.0.60  port:  5501 Resultado:  1
[*] Channel  24 Kitchen HD is not working
address:  239.192.1.203  port:  1234 Resultado:  1
address:  239.251.0.97  port:  5501 Resultado:  1
[*] Channel  Bay is not working
[*] Channel  AMC HD is not working

[*] The following channel(s) are not working:

239.251.0.60:5501 -  24 Kitchen HD
239.192.1.203:1234 -  Bay
239.251.0.97:5501 -  AMC HD


[*] Finished in 5.0 second(s)

Where one reads
address: xxx.xxx.xxx.xxx port: xxxx Resultado: X
Is in mass_checker(channel), the result of channel_checker(sock)

def mass_checker(channel):
    # Function to mass check the channels in the dictionary

    # Define global variables
    global os_name
    global channels_not_working

    # Check channel
    channel_address, channel_port = channels_dictionary[channel].split(':')
    sock = socket_creator(args.nic, channel_address, channel_port, os_name)
    result = channel_checker(sock)
-> print('address: ', channel_address, ' port: ', channel_port, 'Resultado: ', result, sep=" ")

Raspbian is Debian based. So is Ubuntu.
How can I further debug this?
Might there be a difference in how sockets are created? Or a difference in how ffprobe is called in Raspbian?

To check the stream

To get the data:

ffprobe -v quiet -print_format json -show_programs udp://233.99.64.1:1234

To save as a file:

ffmpeg -y -i udp://239.255.242.218:1234 -vcodec copy -acodec copy -t 7 test.mp4

Error in ffmpeg command line

# python3 multicast-checker.py --playlist output.m3u
  File "multicast-checker.py", line 47
    result = subprocess.run(['ffprobe', '-v', 'quiet', '-print_format', 'json', '-show_programs', f'udp://@{address}:{port}'], capture_output=True, text=True, timeout=args.info_timeout)
                                                                                                                           ^
SyntaxError: invalid syntax

OS Ubuntu 16.04 x64
Python 3.5.2

ffmpeg -version
ffmpeg version git-2019-04-04-8e3b01e Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 20160609
configuration: --pkg-config-flags=--static --prefix=/root/ffmpeg-build-static-binaries --bindir=/root/ffmpeg-build-static-binaries/bin --extra-cflags='-I /root/ffmpeg-build-static-binaries/include -I /usr/local/cuda/include/' --extra-ldflags='-L /root/ffmpeg-build-static-binaries/lib -L /usr/local/cuda/lib64/' --extra-libs=-lpthread --enable-cuda --enable-cuda-sdk --enable-cuvid --enable-libnpp --enable-gpl --enable-libass --enable-libfdk-aac --enable-vaapi --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-libaom --enable-nvenc
libavutil      56. 26.100 / 56. 26.100
libavcodec     58. 48.101 / 58. 48.101
libavformat    58. 26.101 / 58. 26.101
libavdevice    58.  7.100 / 58.  7.100
libavfilter     7. 48.100 /  7. 48.100
libswscale      5.  4.100 /  5.  4.100
libswresample   3.  4.100 /  3.  4.100
libpostproc    55.  4.100 / 55.  4.100

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.