ffmpeg bricht den Stream ab - wo liegt mein Fehler?

  • Hallo liebes Forum,
    Ich brauche wieder einmal eure Hilfe.
    Ich möchte gerne mit dem Paket ffmpeg ein Webcam-Video aufzeichnen und ins Netzwerk streamen, damit ich z.B. per VLC Media Player das Live-Bild sehe.
    Nun habe ich das ffmpeg Paket heruntergeladen, compilliert und installiert. Meine Konfiguration von ffmpeg (/etc/ffmpegserver.conf) sieht so aus:

    Port 80
    BindAddress 0.0.0.0
    MaxClients 3
    MaxBandwidth 50000
    NoDaemon
    <Feed picam.ffm>
    file /tmp/picam.ffm
    FileMaxSize 10M
    </Feed>
    <Stream picam.mjpeg>
    Feed picam.ffm
    Format mjpeg
    VideoSize 640x480
    VideoFrameRate 20
    VideoBitRate 2000
    VideoQMin 1
    VideoQMax 9
    </Stream>

    Nun habe ich noch ein Startskript erzeugt, damit die Webcam auch nach einem Neustart aktiv bleibt (/usr/sbin/picam.sh):

    ffserver -f /etc/ffmpegserver.conf & ffmpeg -v verbose -r 5 -s 640x480 -f video4linux2 -i /dev/video0 http://192.168.2.104:80/picam.ffm

    Wenn ich nun das Skript mit dem Befehl /usr/sbin/picam.sh starte, erhalte ich folgendes:

    pi@raspberrypi ~ $ /usr/sbin/picam.sh
    ffserver version 1.2.2 Copyright (c) 2000-2013 the FFmpeg developers
    built on Aug 19 2013 18:10:53 with gcc 4.6 (Debian 4.6.3-14+rpi1)
    configuration:
    ffmpeg version 1.2.2 Copyright (c) 2000-2013 the FFmpeg developers
    built on Aug 19 2013 18:10:53 with gcc 4.6 (Debian 4.6.3-14+rpi1)
    configuration:
    libavutil 52. 18.100 / 52. 18.100
    libavutil 52. 18.100 / 52. 18.100
    libavcodec 54. 92.100 / 54. 92.100
    libavformat 54. 63.104 / 54. 63.104
    libavdevice 54. 3.103 / 54. 3.103
    libavfilter 3. 42.103 / 3. 42.103
    libswscale 2. 2.100 / 2. 2.100
    libswresample 0. 17.102 / 0. 17.102
    libavcodec 54. 92.100 / 54. 92.100
    libavformat 54. 63.104 / 54. 63.104
    libavdevice 54. 3.103 / 54. 3.103
    libavfilter 3. 42.103 / 3. 42.103
    libswscale 2. 2.100 / 2. 2.100
    libswresample 0. 17.102 / 0. 17.102
    [video4linux2,v4l2 @ 0x2d694b0] fd:3 capabilities:4000001
    [video4linux2,v4l2 @ 0x2d694b0] The driver changed the time per frame from 1/5 to 1/30
    [video4linux2,v4l2 @ 0x2d694b0] The v4l2 frame is 453 bytes, but 614400 bytes are expected
    [video4linux2,v4l2 @ 0x2d694b0] Estimating duration from bitrate, this may be inaccurate
    Input #0, video4linux2,v4l2, from '/dev/video0':
    Duration: N/A, bitrate: 147456 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    [graph 0 input from stream 0:0 @ 0x2d6e730] w:640 h:480 pixfmt:yuyv422 tb:1/5 fr:5/1 sar:0/1 sws_param:flags=2
    [scaler for output stream 0:0 @ 0x2d6ee00] w:640 h:480 flags:'0x4' interl:0
    [graph 0 input from stream 0:0 @ 0x2d6e730] TB:0.200000 FRAME_RATE:5.000000 SAMPLE_RATE:nan
    [scaler for output stream 0:0 @ 0x2d6ee00] w:640 h:480 fmt:yuyv422 sar:0/1 -> w:640 h:480 fmt:yuvj422p sar:0/1 flags:0x4
    Output #0, ffm, to 'http://192.168.2.104:80/picam.ffm':
    Metadata:
    creation_time : now
    encoder : Lavf54.63.104
    Stream #0:0: Video: mjpeg, yuvj422p, 640x480, q=1-9, 2000 kb/s, 1000k tbn, 5 tbc
    Stream mapping:
    Stream #0:0 -> #0:0 (rawvideo -> mjpeg)
    Press [q] to stop, [?] for help
    The v4l2 frame is 2449 bytes, but 614400 bytes are expectedbitrate=1228.8kbits/s
    /dev/video0: Invalid data found when processing input
    No more output streams to write to, finishing. (Was ist damit gemeint? Liegt hier der Fehler?)
    frame= 12 fps=3.5 q=1.6 Lsize= 364kB time=00:00:02.40 bitrate=1242.5kbits/s
    video:358kB audio:0kB subtitle:0 global headers:0kB muxing overhead 1.544958%
    pi@raspberrypi ~ $

    Der Text erscheint, es wird nichts gestreamt.

    Wo liegt mein Fehler?
    Vielen Dank für eure Hilfe.

    Gruß
    RaspberryPi-Bastler

    Phantasie ist wichtiger als Wissen, denn Wissen ist begrenzt.
    Albert Einstein

    Einmal editiert, zuletzt von RaspberryPi-Bastler (20. August 2013 um 10:37)

  • ffmpeg bricht den Stream ab - wo liegt mein Fehler?? Schau mal ob du hier fündig wirst!

  • Das bekomme ich nun, nachdem ich die Qualität auf 160x120 und 7 fps heruntergeschraubt habe.
    Was kann man dagegen tun?

    ffserver version 1.2.2 Copyright (c) 2000-2013 the FFmpeg developers
    built on Aug 19 2013 18:10:53 with gcc 4.6 (Debian 4.6.3-14+rpi1)
    configuration:
    ffmpeg version 1.2.2 Copyright (c) 2000-2013 the FFmpeg developers
    built on Aug 19 2013 18:10:53 with gcc 4.6 (Debian 4.6.3-14+rpi1)
    configuration:
    libavutil 52. 18.100 / 52. 18.100
    libavcodec 54. 92.100 / 54. 92.100
    libavformat 54. 63.104 / 54. 63.104
    libavdevice 54. 3.103 / 54. 3.103
    libavutil 52. 18.100 / 52. 18.100
    libavcodec 54. 92.100 / 54. 92.100
    libavformat 54. 63.104 / 54. 63.104
    libavfilter 3. 42.103 / 3. 42.103
    libswscale 2. 2.100 / 2. 2.100
    libswresample 0. 17.102 / 0. 17.102
    libavdevice 54. 3.103 / 54. 3.103
    libavfilter 3. 42.103 / 3. 42.103
    libswscale 2. 2.100 / 2. 2.100
    libswresample 0. 17.102 / 0. 17.102
    [video4linux2,v4l2 @ 0x22494b0] /etc/ffmpegserver.conf:13: Image size must be a multiple of 16
    Incorrect config file - exiting.
    fd:3 capabilities:4000001
    [video4linux2,v4l2 @ 0x22494b0] The driver changed the time per frame from 1/5 to 1/30
    [video4linux2,v4l2 @ 0x22494b0] Estimating duration from bitrate, this may be inaccurate
    Input #0, video4linux2,v4l2, from '/dev/video0':
    Duration: N/A, start: 539.542532, bitrate: 9216 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 160x120, 9216 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    [tcp @ 0x2249c20] TCP connection to 192.168.2.104:80 failed: Connection refused

    http://192.168.2.104:80/picam.ffm: Input/output error

    Das klingt nach einem Netzwerk- bzw. Formatproblem. Der Pi ist über WLAN verbunden. Kann es sein, dass der Pi mit .mjpeg nicht klar kommt?

    Allerdings zeigte der Pi bei einem Versuch für ca. 1 Minute an, dass etwas gestreamt wird. In diesem Moment konnte ich über VLC einen Netzwerkstream öffnen und bekam ein sehr unscharfes Standbild heraus. Die Kamera kann man vorne an der Linse scharf stellen, sobald das läuft, werde ich die Kamera scharf stellen. Aber auch, als ich vor der Kamera meine Hand bewegt habe, wurde gar nichts verändert. Also - wie gesagt - ein Standbild.

    Phantasie ist wichtiger als Wissen, denn Wissen ist begrenzt.
    Albert Einstein

    Einmal editiert, zuletzt von RaspberryPi-Bastler (20. August 2013 um 12:13)

  • Ich habe mit dem Programm die Webcam getestet.
    Als Ergebnis bekam ich "Not avaible" (Nicht verfügbar).

    Nun habe ich einfach mal Motion installiert und eingerichtet, damit kann ich einen Live-Stream in 640x480 und 30 Bildern pro Sekunde machen.
    Ich werde nun einfach Motion nutzen. Wenn ffmpeg nicht will, dann mache ich es damit.

    Zusätzlich nutze ich noch das Programm "fswebcam", womit ich Bilder machen kann und lokal abspeichern kann.
    Hauptsache, es funktioniert.

    Danke für deine Hilfe.

    Gruß
    RaspberryPi-Bastler

    Phantasie ist wichtiger als Wissen, denn Wissen ist begrenzt.
    Albert Einstein

    Einmal editiert, zuletzt von RaspberryPi-Bastler (20. August 2013 um 17:50)

Jetzt mitmachen!

Du hast noch kein Benutzerkonto auf unserer Seite? Registriere dich kostenlos und nimm an unserer Community teil!