Hallo auch, ich habe vor mir von zu Hause mein analoges Kabelfernsehen über Internet auf mein Android-Handy zu streamen. Ich hatte das früher unter DVB-S auch sehr schön am laufen mit VDR und externremux. Aber seit meinem Umzug habe ich nur noch Kabel, und unter DVB-C fehlt u.a. Pro7. Hier in unserem Kuhdorf bekommst zwar FTTH aber an DVB-C haperts ganz gewaltig. Jedenfalls war mein Gedanke das ich das mit avconv und avserver mache. Leider stehe ich jetzt vor dem Problem das ich mit aconv nicht wirklich ein Bild vom analog-Tuner bekomme. Ich hab ein kleines Script mit dem ich den Kanal einstelle, das klappt auch wunderbar:
/opt/tv/bin/setchannel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #!/bin/bash case $1 in nick|NICK) FREQ="487.250";; vox|VOX) FREQ="196.250";; n24|N24) FREQ="217.250";; rtl|RTL) FREQ="147.250";; sat1|SAT1|sat.1|SAT.1) FREQ="154.250";; pro7|PRO7|prosieben|ProSieben) FREQ="231.250";; ntv|NTV) FREQ="266.250";; viva|VIVA) FREQ="287.250";; rtl2|RTL2) FREQ="238.250";; kabel1|KABEL1) FREQ="245.250";; esac v4l2-ctl -f $FREQ |
Mit mplayer (welcher den Kanal auch selber einstellen könnte, ich weiss...) funzt das ganze dann auch:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | christian@christian-Point-of-View:~$ tv setchannel pro7 Frequency for tuner 0 set to 3700 (231.250000 MHz) christian@christian-Point-of-View:~$ mplayer -fs tv:// -tv driver=v4l2:alsa:input=0 MPlayer 1.1-4.8 (C) 2000-2012 MPlayer Team mplayer: could not connect to socket mplayer: Connection refused Failed to open LIRC support. You will not be able to use your remote control. Playing tv://. TV file format detected. Selected driver: v4l2 name: Video 4 Linux 2 input author: Martin Olschewski <olschewski@zpr.uni-koeln.de> comment: first try, more to come ;-) Selected device: Sundtek MediaTV Pro 2k12 Tuner cap: STEREO Tuner rxs: Capabilities: video capture tuner audio streaming supported norms: 0 = PAL-BG; 1 = PAL-DK; 2 = PAL-I; 3 = PAL-M; 4 = NTSC-M; 5 = Secam-L; 6 = Secam-LC; 7 = Secam-K; 8 = Secam-B; 9 = Secam-G; 10 = Secam-H; inputs: 0 = Television; 1 = Composite; 2 = S-Video; Current input: 0 Current format: UYVY v4l2: current audio mode is : MONO tv.c: norm_from_string(pal): Bogus norm parameter, setting default. v4l2: ioctl query control failed: Invalid argument ========================================================================== Opening video decoder: [raw] RAW Uncompressed Video Movie-Aspect is undefined - no prescaling applied. VO: [vdpau] 640x480 => 640x480 Packed UYVY [fs] Selected video codec: [rawuyvy] vfm: raw (RAW UYVY) ========================================================================== Audio: no sound Starting playback... V: 0.0 61/ 61 ??% ??% ??,?% 0 0 MPlayer interrupted by signal 2 in module: video_read_frame V: 0.0 62/ 62 ??% ??% ??,?% 0 0 v4l2: 64 frames successfully processed, 10 frames dropped. Exiting... (Quit) |
Mit avplay/avconv passiert das:
1 2 3 4 5 6 7 8 9 10 | christian@christian-Point-of-View:~$ avplay -f video4linux2 -channel 0 -i /dev/video0 avplay version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2003-2014 the Libav developers built on Aug 10 2014 18:19:26 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1) [video4linux2 @ 0xaf2026a0] ioctl(VIDIOC_G_PARM): Invalid argument Speicherzugriffsfehler christian@christian-Point-of-View:~$ avconv -f video4linux2 -channel 0 -i /dev/video0 test.avi avconv version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers built on Aug 10 2014 18:19:26 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1) [video4linux2 @ 0x8eacc80] ioctl(VIDIOC_G_PARM): Invalid argument Speicherzugriffsfehler |
ffmpeg scheitert so ziemlich am selben, wenns auch nicht gleich ein Segmention fault ist:
1 2 3 4 5 6 7 8 9 10 11 12 13 | christian@christian-Point-of-View:~$ ffmpeg -f video4linux2 -channel 0 -i /dev/video0 test.avi ffmpeg version N-62531-g60c8c71 Copyright (c) 2000-2014 the FFmpeg developers built on Apr 19 2014 09:35:20 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu8) configuration: libavutil 52. 77.100 / 52. 77.100 libavcodec 55. 58.103 / 55. 58.103 libavformat 55. 37.100 / 55. 37.100 libavdevice 55. 13.100 / 55. 13.100 libavfilter 4. 4.100 / 4. 4.100 libswscale 2. 6.100 / 2. 6.100 libswresample 0. 18.100 / 0. 18.100 [video4linux2,v4l2 @ 0xa31d940] ioctl(VIDIOC_G_PARM): Invalid argument /dev/video0: Invalid argument |
Ich habe auch schon versucht mit mplayer via der option dumpstream das Videomaterial an ffmpeg zu pipen, auch ohne großen erfolg:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | christian@christian-Point-of-View:~$ mplayer -fs tv:// -tv driver=v4l2:alsa:input=0 -dumpstream -dumpfile -|ffmpeg -i - test.avi ffmpeg version N-62531-g60c8c71 Copyright (c) 2000-2014 the FFmpeg developers built on Apr 19 2014 09:35:20 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu8) configuration: libavutil 52. 77.100 / 52. 77.100 libavcodec 55. 58.103 / 55. 58.103 libavformat 55. 37.100 / 55. 37.100 libavdevice 55. 13.100 / 55. 13.100 libavfilter 4. 4.100 / 4. 4.100 libswscale 2. 6.100 / 2. 6.100 libswresample 0. 18.100 / 0. 18.100 mplayer: could not connect to socket mplayer: Connection refused Failed to open LIRC support. You will not be able to use your remote control. pipe:: Invalid data found when processing input christian@christian-Point-of-View:~$ mplayer -fs tv:// -tv driver=v4l2:alsa:input=0 -dumpstream -dumpfile - | ffmpeg -f video4linux2 -i - test.avi ffmpeg version N-62531-g60c8c71 Copyright (c) 2000-2014 the FFmpeg developers built on Apr 19 2014 09:35:20 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu8) configuration: libavutil 52. 77.100 / 52. 77.100 libavcodec 55. 58.103 / 55. 58.103 libavformat 55. 37.100 / 55. 37.100 libavdevice 55. 13.100 / 55. 13.100 libavfilter 4. 4.100 / 4. 4.100 libswscale 2. 6.100 / 2. 6.100 libswresample 0. 18.100 / 0. 18.100 [video4linux2,v4l2 @ 0x9ead8a0] Cannot open video device pipe:: No such file or directory pipe:: No such file or directory |
So langsam gehen mir die Ideen aus. Habe das TV-Programm schon per mencoder konvertiert, die ausgabe an avconv weitergegeben und von da wiederum an den avserver. Das ganze auch jeweils schon mit ffmpeg/ffserver. Aber dafür ist der Atom 330 wohl zu schwach, am Client läuft ständig der Cache leer und das ganze hackt auch extrem. Wird dann ja 2 - 3 mal konvertiert wie ich die Sache sehe..
Der DVB-C/Analog-Stick ist ein Sundtek MediaTV Pro2, unter mplayer ist input=0 der analog Tuner, 1 und 2 S-Video/Composite. Denke mal an der nummerierung wird sich unter avconv nix ändern, ist ja alles v4l2... Hoffe das ich hier ausreichend Infos geliefert habe und das jemand eine Lösung hat, sitze jetzt seit 4 Tagen da dran 😛