Capture still image from remote ip cam using avconv

6,904

Solution 1

Finally found the answer lurking around online:

avconv -y -loglevel debug -stimeout 2 -rtsp_transport tcp -i "rtsp://[user]:[pass]@[IP]/11" -q:v 9 -s 1920x108 -vframes 1 test.png

Solution 2

According to AVcon Documentation: https://libav.org/avconv.html#fbdev

The correct syntax for taking a screenshot (using Fbdev) is:

avconv -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg

Hope this helps.

Share:
6,904

Related videos on Youtube

Stevanicus
Author by

Stevanicus

something boring goes here

Updated on September 18, 2022

Comments

  • Stevanicus
    Stevanicus over 1 year

    I'm attempting to capture a single still from an ip camera with avconv in ubuntu (server).

    Can anyone tell me what's wrong with the following command:

    avconv -i rtsp://[USER]:[PASS]@[IPADDRESS]:554/11 -s 1920x1080 -f image2 foo.jpg
    

    The error message I'm getting at the moment is:

    avconv version 9.18-6:9.18-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
      built on Mar 16 2015 13:19:10 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
    [rtsp @ 0xb938e0] Could not find codec parameters (Video: h264, 1920x1080)
    [rtsp @ 0xb938e0] Estimating duration from bitrate, this may be inaccurate
    Guessed Channel Layout for  Input Stream #0.1 : mono
    Input #0, rtsp, from 'rtsp://xxx:[email protected]:554/11':
      Metadata:
        title           : rtsp session
      Duration: N/A, bitrate: N/A
        Stream #0.0: Video: h264, 1920x1080, 90k tbn
        Stream #0.1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
    [buffer @ 0xb98520] Invalid pixel format string '-1'
    Error opening filters!
    

    In case it's of any value, I'm using a 2.0 MB IP Camera from Sinocam. I am able to view a live stream from the camera remotely using iSpy. However, I am unable to access and create an image still using avconv.

    Thank you.

    UPDATE

     avconv -i rtsp://[user]:[pass]@[ip]:554/11 -f h264 -pix_fmt yuyv422 -video_size 1920x1080 screenshot.png
    

    Creates the image file, however still fails:

    [rtsp @ 0x1045a80] Could not find codec parameters (Video: h264, 1920x1080)
    [rtsp @ 0x1045a80] Estimating duration from bitrate, this may be inaccurate
    Guessed Channel Layout for  Input Stream #0.1 : mono
    Input #0, rtsp, from 'rtsp://admin:[email protected]:554/11':
      Metadata:
        title           : rtsp session
      Duration: N/A, bitrate: N/A
        Stream #0.0: Video: h264, 1920x1080, 90k tbn
        Stream #0.1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
    File 'screenshot.png' already exists. Overwrite ? [y/N] y
    [buffer @ 0x1035280] Invalid pixel format string '-1'
    Error opening filters!
    
  • Stevanicus
    Stevanicus over 8 years
    thanks for your reply unfortunately: fbdev doesn't seem to work for rtsp: ' Could not open framebuffer device: Unknown error -2 rtsp://[user]:[pass]@[ip]:554/11: No such file or directory'
  • Stevanicus
    Stevanicus over 8 years
    question updated
  • Franco
    Franco over 8 years
    Have you tried changing codec parameters? Please Try 1920x1088 instead. It may be a resolution issue.
  • Franco
    Franco over 8 years
    sorry Is this your camera: szsinocam.com/… for it says on description resolution is 1280*720. Even if its not the exact model I would try 1280*720 as well
  • Stevanicus
    Stevanicus over 8 years
    this is the camera: tvc-mall.com/details/…