Results 1 to 7 of 7

Thread: Using avconv to extract image frames from a movie

  1. #1
    Join Date
    Nov 2007
    Location
    Romania/Bucharest
    Beans
    50
    Distro
    Ubuntu 12.04 Precise Pangolin

    Using avconv to extract image frames from a movie

    Hi,

    I'm trying to extract frames from movies that I've recorded on my Desktop using HyperCam (a video capture software on Windows ).

    I used avconv to do this and it is ok when I extract all frames with the command:
    Code:
    $ avconv -i file.avi -f image2 Out%00d.jpg
    However, I want to extract say one frame per second with the "-r" option but this does not work...

    Code:
    silviu@silviu-pc:~/REC/pics.out$ avconv -i ../s1-formare.avi -r 1 -f image2 Out%00d.jpg
    avconv version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
      built on Jun 12 2012 16:52:09 with gcc 4.6.3
    Input #0, avi, from '../s1-formare.avi':
      Duration: 00:10:43.60, start: 0.000000, bitrate: 961 kb/s
        Stream #0.0: Video: msvideo1, rgb555le, 640x480, 5 tbr, 5 tbn, 5 tbc
        Metadata:
          title           : HyperCam Video
    Incompatible pixel format 'rgb555le' for codec 'mjpeg', auto-selecting format 'yuvj420p'
    [buffer @ 0x1818320] w:640 h:480 pixfmt:rgb555le
    [avsink @ 0x1817340] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
    [scale @ 0x181d8a0] w:640 h:480 fmt:rgb555le -> w:640 h:480 fmt:yuvj420p flags:0x4
    Output #0, image2, to 'Out%00d.jpg':
      Metadata:
        encoder         : Lavf53.21.0
        Stream #0.0: Video: mjpeg, yuvj420p, 640x480, q=2-31, 200 kb/s, 90k tbn, 1 tbc
        Metadata:
          title           : HyperCam Video
    Stream mapping:
      Stream #0:0 -> #0:0 (msvideo1 -> mjpeg)
    Press ctrl-c to stop encoding
    [mjpeg @ 0x18168e0] Error, Invalid timestamp=0, last=0
    Video encoding failed
    When I use the "-r" option with a value lower than the actual framerate (5fps) of the input movie I get the same error.

    Can someone help with this, please ? Or a suggestion for another program...

  2. #2
    Join Date
    Jul 2009
    Location
    EastEngland/Cyberspace
    Beans
    Hidden!
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Using avconv to extract image frames from a movie

    ---------------------------yes sorry i had not seen the second half of your question

    so
    mplayer -ao null -vo png input.file
    only gives you what you already have...........
    Last edited by shantiq; July 2nd, 2012 at 06:27 PM.
    Until you know you do not know ● Linux is Latin for off-the-beaten-track [◄►] ● Is there Voodoo in the machine?
    ShanArt
    ●Xmms

  3. #3
    Join Date
    Nov 2007
    Location
    Romania/Bucharest
    Beans
    50
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Using avconv to extract image frames from a movie

    Quote Originally Posted by shantiq View Post
    ---------------------------
    I can do this also with avconv. What I need is to extract 'some' images, say one per sec or one at 2 secs.

    No I observed that it works with ffmpeg. I didn't use ffmpeg for the first time because I saw that it's deprecated... but avconv doesn't work for the example I've given in the previous post and ffmpeg works.

  4. #4
    Join Date
    Jun 2012
    Beans
    2

    Re: Using avconv to extract image frames from a movie

    This is what I use and it works for me without any errors:

    avconv -i videofile.avi -vsync 1 -r 1 -an -y 'videofolder/videoframe%d.bmp'

    Replace the bold text with your file/folder/frame names.
    Last edited by kcmichaelb; July 13th, 2012 at 09:31 PM. Reason: i added a space between videofile.avi and -vsync

  5. #5
    Join Date
    Jun 2012
    Beans
    2

    Re: Using avconv to extract image frames from a movie

    The example I posted has .bmp but it also works with .jpg.

  6. #6
    Join Date
    Aug 2012
    Beans
    1

    Smile Re: Using avconv to extract image frames from a movie

    For me works very well
    thx

  7. #7
    Join Date
    Nov 2007
    Location
    Romania/Bucharest
    Beans
    50
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Using avconv to extract image frames from a movie

    thank you, your example works

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •