Giter VIP home page Giter VIP logo

stream-observer's Introduction

Stream-Observer

Stream-Observer (strobs) is a script to observe running voc video streams.
The script opens mpv with all active (currently streaming) streams from Chaos Computer Club made by VOC (video operation center) in a playlist as found at https://streaming.media.ccc.de. Optionally it can also try to open all streams given in a valid playlist.

Execute ./strobs.
If you face error 'Permission denied' and test -x strobs && echo true || echo false returns 'false' make strobs executable with chmod +x strobs.

Requirements

Install mpv if not existing. Install jq if not existing.

Table of contents

Options

Usage: strobs [ -d | -D | -f | -h | -j | -k | -m | -p file | -s | -t | -v | -V | -x]

  • -d debug mode: print commands and arguments while executed
  • -D debug mode: print script lines while read
  • -f forces (with -p / -j) open playlist / download full json
  • -h help shown
  • -j json export to disk
  • -k keys/shortcuts shown (input.conf needed)
  • -m man page shown (strobs.1 needed)
  • -p playlist file with servers in format m3u8
  • -s sort room names alphanumerical
  • -t timetable of running and coming events shown
  • -v verbosity increasing with v
  • -V version print
  • -x exit before mpv, keeps current-playlist.m3u8

Details

The script downloads https://streaming.media.ccc.de/streams/v2.json and searches for active (current streaming) streams. It reads their display names too. With this informations it builds a playlist in m3u8 format and starts mpv with this playlist.

Examples

strobs

opens current streams in mpv.

strobs -p 36c3.m3u8

uses the playlist 36c3.m3u8 for mpv.

strobs -j -f

will download and save current.json, current-playlist.m3u8, status_liveber.xsl (deprecated), status_ingest.xsl (deprecated) and exit before opening mpv. In addition json includes past events.

Files

  • current-playlist.m3u8 - generated playlist while running
  • input.conf - user-defined key bindings for mpv
  • keys.lua - script with key bindings for audio, video and rooms
  • strobs - the shell script to execute
  • strobs.1 - man page
  • voctocat.gif - temporary image used as last playlist item

Only strobs is absolutely necessary to observe running voc video streams.

Keys and shortcuts

defined by lua scripts

  • 1 – 0 room number 1 to 10
  • q select native audio
  • w select translation 1
  • e select translation 2
  • y select video mixer output
  • x select slides

defined defaults by input.conf

  • RIGHT seek 5
  • LEFT seek -5
  • UP seek 60
  • DOWN seek -60
  • Shift+PGUP seek 600
  • Shift+PGDWN seek -600
  • SPACE cycle pause
  • > playlist-next; skip to next room
  • < playlist-previous; skip to previous room
  • i toggle transport osd
  • I (upper i) toggle display stats
  • ctrl++ add audio-delay 100ms; this changes audio/video sync
  • ctrl+- add audio-delay -100ms
  • m cycle mute
  • d cycle deinterlace
  • # cycle audio
  • _ cycle video
  • f cycle fullscreen
  • s screenshot
  • F8 show rooms
  • F9 show list of audio/sub streams

Fixed mpv options

It is starting a playlist in mpv with following options:

  • --fs
    • full screen
  • --no-ytdl
    • disable the youtube-dl hook-script (404 should try next stream immediately)
  • --msg-level=all=error,ffmpeg=fatal
    • all modules just error messages, but ffmpeg/video fatal (because of permanent irrelevant PoC errors)
  • --no-input-default-bindings
    • deactivate all default key bindings
  • --input-conf=${progpath}input.conf
    • look for configuration file in the same directory where strobs is starting
  • --load-scripts=no
    • don't load any scripts from personal config
  • --scripts=keys.lua
    • load these script:${progpath}keys.lua
  • --force-window=immediate
    • create the gui immediately on program start
  • --keep-open=always
    • don't terminate if the current file is ending and playback will never automatically advance to the next file
  • --idle=yes
    • wait idly instead of quitting when there is no file to play
  • --vd-lavc-show-all=yes
    • don't wail until an initial keyframe was decoded for a quicker startup
  • --no-initial-audio-sync
    • audio is started immediately even if start timestamp differs from video, if necessary video timing is gradually adjusted
  • --audio-stream-silence=yes
    • when pausing playback or stop and restart audio on seeks, audio is not stopped and silence is played
  • --demuxer-cache-wait=no
    • don't read data until the demuxer cache has reached maximum capacity
  • --force-seekable=no
    • don't try to seek stream earlier than cache
  • --image-display-duration=inf
    • the image is kept open forever, the player will not pause
  • --screenshot-format=png
    • set the screenshot image file type to png (default: jpg)
  • --script-opts=osc-visibility=always,osc-seekbarstyle=knob
    • visibility mode of on screen controller
    • style of the playback position marker as round knob
  • --osd-duration=5000
    • set the duration of the OSD messages in ms (default: 1000)
  • --osd-msg1="room: 1 – 0       audio: q, w, e - Native, Translated 1, Translated 2       video: y, x - HD, Slides"
    • show this string as message on OSD with OSD level 1 (visible by default)
    • used as minimal manual
  • --no-osd-bar
    • disable display of the OSD bar while seeking
  • --osd-font-size=30
    • specify the OSD font size (default: 55)
  • --osd-spacing=1
    • horizontal OSD font spacing in scaled pixels (default: 0)
  • --osd-border-size=1
    • size of the OSD font border in scaled pixels (default: 3)
  • --osd-margin-x=10
    • left and right screen margin for the OSD in scaled pixels
  • --osd-margin-y=4
    • top and bottom screen margin for the OSD in scaled pixels

stream-observer's People

Contributors

simpelme avatar

Watchers

 avatar

stream-observer's Issues

Untrack complete-playlist.m3u8

Keep it local only. Maybe use it later as a name list for s1-199.

git rm --cached complete-playlist.m3u8

Remove it from .gitignore exception too.

Rebuild option -f

It is not useful to try streams found in streaming.json any more.
But is could be useful while option -p if check for existing remote playlist returns no result. With this you can open streams directly not catched by curl.

Think about description in README.md and strobs.1 carefully.

Remove option -s

Think about it. Seems to be sorted at icecast anyway so could be unnecessary.

Add option -ingest

For sync tests it's better to see the ingest input instead of streaming endpoint. Did that option but removed it. Don't know why.

Remove option -a

No streams are to show if icecast isn't sending. So the -a (all) option is w/o sense.

Sort algorithm is strange

Servers from icecast in following order:

q1
stewone2
stewone

Filled with zeros:

q00001
stewone00002
stewone00000

Sort -n:

q00001
stewone00000
stewone00002

Zeros deleted:

q1
stewone
stewone2

Seemed to be less characters before digits result to upper position.

Extend option -j

Add icecast-status.xsl of both live.ber and ingest server.
Think about to not delete current-playlist.m3u8 if option is set.

Define keys for room 1-6 and audio 1-3

Skipping audio with #(hash) is always toggling over 0/3 meaning mute. That’s not fine.
So define keys for

  • 1 native
  • 2 translated 1
  • 3 translated 2
    Currently not sure which keys are good.

Rooms could be switched with keys 1-9 or 0.

Disable ANSI colored output if NO_COLOR is set

Regardless of it's value.

But in addition enable color if STROBS_COLOR is set.
If NO_COLOR is set globally setting STROBS_COLOR=true (or anything else) will make color usable in strobs but not other programs.

Clean up examples

Add new example for option -x
It seems to be needed only for debugging. So introduce an example for it in README.md and strobs.1.

Prove all other examples or find new ones.

Enhance description of option -n

As technical name is default from icecast it will happen that there is a technical name only if streaming.json shows no current (or future) streams.

Embed remote voctocat.png

If local voctocat is missing write remote one into playlist.
Path could be http://simpel.cc/voctocat.png

Exit while option -j

Option -j is used to catch all the json (and current playlist). Mostly there is no mpv action needed. So skip this and exit w/o opening mpv.

Repair F9

input.conf:
F9 show_text ${track-list} # show list of audio/sub streams
not working.
But F9 is working this way if same stream is called with mpv directly.

online playlist via http/https not played

It's checking only for file on computer:

if [ ! -f "${PLAYLIST}" ]; then
    printf "%b\n" "${YELLOW}Warning: playlist '${PLAYLIST}' does not exist${NC}" 1>&2
    exit 1
fi

Should be checked if available and played

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.