easy cam live streaming on your smartphone

What I use

install cam driver

make & make install(firmware included):
https://github.com/stevelacy/EasyCap/blob/master/documentation/installation.md

test the cam with mplayer:

somagic-capture --pal --sync=1 -c --iso-transfers=20 | mplayer -nocache -vf yadif -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -

install ffmpeg for HLS streaming

https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

use apache as webserver

add needed mime types to apache:

AddType application/x-mpegURL .m3u8
AddType video/MP2T .ts

create www/index.html in your document root

<head>
 <link href="https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.5/alt/video-js-cdn.min.css" rel="stylesheet">
 <script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.5/video.min.js"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/3.1.0/videojs-contrib-hls.js"></script>
</head>
<body>
<video id="maplayer" width=600 height=300 class="video-js vjs-default-skin" controls>
 <source src="/data/playlist.m3u8" type="application/x-mpegURL">
</video>
<script>
 var player = videojs('maplayer');
 player.play();
</script>
</body>
</html>

autogenerate streaming files in www/data/

somagic-capture --pal --sync=1 -c --iso-transfers=20 | ffmpeg -f rawvideo -pix_fmt uyvy422 -vtag 2vuy -s 720x576 -y -an -r pal -i - -vf yadif -map 0 -codec:v libx264 -an -crf 18 -profile:v baseline -maxrate 500k -bufsize 1835k -pix_fmt yuv420p -flags -global_header -f ssegment -hls_wrap 10 -segment_wrap 10 -segment_list_size 10 -segment_list playlist.m3u8 -segment_list_flags +live -segment_time 5 out%01d.ts

done – you have the live stream with 20s lag time on your phone

livestream

 

Sources:
https://github.com/stevelacy/EasyCap/blob/master/documentation/installation.md
http://www.bogotobogo.com/VideoStreaming/ffmpeg_http_live_streaming_hls.php
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

Edit/Nachtrag:

SDR mit OSX 10.10+ und RTL2832U

Nachdem ich mich vor einiger Zeit mit dem ccc-rad1o-badge beschäftigt hatte, habe ich ein kleines USB SDR zum Rumspielen gesucht und bin bei eBay mit dem USB-2.0 DVB-T SDR DAB Receiver (RTL2832U/R820T2) für 11€ fündig geworden. (Lieferzeit war 4 Tage)

Hier möchte ich die Installation der Software unter OSX, welche ich verwende, dokumentieren.
Installiertes hombrew  setze ich voraus.

Wer SDR nicht kennt, kann hier oder hier einen Eindruck bekommen. (z.B. 531KHz AM)

Treiber

Zu erst die nötigen Treiber für den RTL Chip installieren:

$> brew install cmake
$> brew install libusb
$> brew install pkgconfig
$> brew install sox
$> cd dev/ ; mkdir osx ; cd osx/ ; mkdir git ; cd git/
$> git clone git://git.osmocom.org/rtl-sdr.git
$> cd rtl-sdr/
$> mkdir build
$> cd build/
$> cmake ../
$> make
$> sudo make install
$> rtl_test -t
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
[R82XX] PLL not locked!
Sampling at 2048000 S/s.
No E4000 tuner found, aborting.

Quelle: https://gist.github.com/0xabad1dea/5777726

94,3 MHz FM Test:

$ >rtl_fm  -M wbfm -f 94.3M - | play -r 32k -t raw -e signed-integer -b 16 -c 1 -V1 -

-: (raw)

 File Size: 0
  Encoding: Signed PCM
  Channels: 1 @ 16-bit
Samplerate: 32000Hz
Replaygain: off
  Duration: unknown

In:0.00% 00:00:00.00 [00:00:00.00] Out:0     [      |      ]        Clip:0    Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuned to 94571000 Hz.
Oversampling input by: 6x.
Oversampling output by: 1x.
Buffer size: 8.03ms
Exact sample rate is: 1020000.026345 Hz
Sampling at 1020000 S/s.
Output at 170000 Hz.
In:0.00% 00:00:15.87 [00:00:00.00] Out:681k  [ -====|====- ]        Clip:0

GNURadio (analog)

$ >brew install gnuradio
$ >gnuradio-companion
<<< Welcome to GNU Radio Companion 3.7.9.1 >>>

GNURadio ist frei programmierbar: hier und hier und google!

Gqrx SDR (analog)

Hier habe ich das fertige binary von gqrx.dk genommen – z.B. FM Radio Empfang – funktioniert.

Description – Mode Frequency
12m Amateur Radio (AM/FM/CW/USB/LSB) 24.890 – 24.990MHz
CB Radio (AM/FM/USB/LSB) 26 – 28MHZ
10m Amateur Radio (AM/FM/CW/USB/LSB) 28.400 – 29.700MHz
6m Amateur Radio (AM/FM/CW/USB/LSB) 50 – 52MHZ
Civil Airband (AM) 117.975 – 136.000 MHz
2m Amateur Radio (AM/FM/CW/USB/LSB) 144 – 146MHZ
Marine Band (FM) 156 – 163MHz
PMR (Private Mobile Radio) (NFM) 163 – 185MHZ
Military Airband (AM) 200 – 399MHZ
70 cm Amateur Radio (AM/FM/CW/USB/LSB) 430 – 440MHZ
PMR and Security (NFM) 440 – 470MHZ

Wenn man es genau wissen will: Wikipedia, Frequenzplan der Bundesnetzagentur, Frequenzliste

welle.io – DAB and DAB+ (digital radio)

2019 gefunden und für sehr gut befunden: https://www.welle.io/

Fluginformationen

Dump1090 is a Mode S decoder specifically designed for RTLSDR devices.

$ > git clone git://github.com/antirez/dump1090.git
$ > cd dump1090/
$ > make
$ > ./dump1090 --interactive
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001 (currently selected)
Found Rafael Micro R820T tuner
Max available gain is: 49.60
Setting gain to: 49.60
Exact sample rate is: 2000000.052982 Hz
Gain reported by device: 49.60

Hex    Flight   Altitude  Speed   Lat       Lon       Track  Messages Seen   .
--------------------------------------------------------------------------------
4a815f          30000     458     52.361    13.168    4     47        0 sec
4ca97b RYR37KW  36000     425     53.023    14.196    176   279       0 sec
3c6670 DLH8HR   30000     377     52.604    14.163    221   435       0 sec

Mit „./dump1090 –interactive –net“ bekommt man über „http://localhost:8080“ eine schöne Google Map.

Im Browser noch schöner aufbereitet ist ModeSDeco, was man z.B. mit „./modesdeco2 –device-index 0 –metric –web 8080 –location 52.4:13.4“ auf ruft und eben so im Browser über http://localhost:8080 sehen kann.

weitere interessante Links

Weiter wird es dann wohl mit Antennenbau gehen…

Suche