Capture a frame from AVI/MOV

Discussion in 'Perl Misc' started by pjsenthil@gmail.com, Jul 12, 2006.

  1. Guest

    Hi,


    I am writing code in CGI-perl,in which i am want to capture
    frames from a media player which runs mpeg or any video.(mov file in
    Quick time).'

    the purpose of doing this is to generate thumbnails (snapshot ) of the
    video when it is in the play mode..

    Friends pl help..Becoz i am not familiar in working on images.

    Regards
    Senthil
    , Jul 12, 2006
    #1
    1. Advertising

  2. Mumia W. Guest

    wrote:
    > Hi,
    >
    >
    > I am writing code in CGI-perl,in which i am want to capture
    > frames from a media player which runs mpeg or any video.(mov file in
    > Quick time).'
    >
    > the purpose of doing this is to generate thumbnails (snapshot ) of the
    > video when it is in the play mode..
    >
    > Friends pl help..Becoz i am not familiar in working on images.
    >
    > Regards
    > Senthil
    >


    Perhaps you should get mplayer and investigate
    mplayer's command line parameters. Because mplayer
    creates something other than a normal X Window, you'll
    probably not be able to simply take a snapshot of the
    window image. Instead, you'll want to command mplayer
    to output one of the video frames to disk.

    HTH
    Mumia W., Jul 12, 2006
    #2
    1. Advertising

  3. Guest

    First of all thanx for your reply.
    I read the mplayer. there is option like converting the whole video
    file into frames..but not the required frame.

    That option is also there "grab_frame" but it is not implemented.


    one more thing..I have to embed the Mplayer into a web page.how can i
    do that .

    and also how can i control the command line options Mplayer from my
    perl code.through which package can i able to do it.

    Regards
    Senthil

    Mumia W. wrote:
    > wrote:
    > > Hi,
    > >
    > >
    > > I am writing code in CGI-perl,in which i am want to capture
    > > frames from a media player which runs mpeg or any video.(mov file in
    > > Quick time).'
    > >
    > > the purpose of doing this is to generate thumbnails (snapshot ) of the
    > > video when it is in the play mode..
    > >
    > > Friends pl help..Becoz i am not familiar in working on images.
    > >
    > > Regards
    > > Senthil
    > >

    >
    > Perhaps you should get mplayer and investigate
    > mplayer's command line parameters. Because mplayer
    > creates something other than a normal X Window, you'll
    > probably not be able to simply take a snapshot of the
    > window image. Instead, you'll want to command mplayer
    > to output one of the video frames to disk.
    >
    > HTH
    , Jul 12, 2006
    #3
  4. Vilmos Soti Guest

    writes:

    > I read the mplayer. there is option like converting the whole video
    > file into frames..but not the required frame.


    This is how I extract a specific frame through mplayer:

    mplayer -vo jpeg -ao null -ss $icon_time -frames 2 avifile.avi

    Check the -ss switch in the manpage. You might also want to check
    the -vo switch, and use png instead of jpeg depending on your needs.

    You need to extract 2 frames, since the first will be the very
    first frame of the video, and the second one is the one you need.

    > That option is also there "grab_frame" but it is not implemented.


    Where is it? In the source? I couldn't find it in the manpage.

    Vilmos
    Vilmos Soti, Jul 12, 2006
    #4
  5. Guest

    Thanx For your reply..I am able to get a single frame.as u have told..

    And now i am not able to idea.how to embed it into a webpage .

    actually my idea was to embed it on my page and play video and when he
    want a particular frame he can get that frame.

    so how can i control the Mplayer from my perl code .is there and
    package for it to do..
    ie the commmand line how can i invoke from perl script.
    Regards
    Senthil

    Vilmos Soti wrote:
    > writes:
    >
    > > I read the mplayer. there is option like converting the whole video
    > > file into frames..but not the required frame.

    >
    > This is how I extract a specific frame through mplayer:
    >
    > mplayer -vo jpeg -ao null -ss $icon_time -frames 2 avifile.avi
    >
    > Check the -ss switch in the manpage. You might also want to check
    > the -vo switch, and use png instead of jpeg depending on your needs.
    >
    > You need to extract 2 frames, since the first will be the very
    > first frame of the video, and the second one is the one you need.
    >
    > > That option is also there "grab_frame" but it is not implemented.

    >
    > Where is it? In the source? I couldn't find it in the manpage.



    ******And regarding the grab frame option ..it is given in
    slave.txt.*******


    >
    > Vilmos
    , Jul 13, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rgemini
    Replies:
    0
    Views:
    342
    Rgemini
    Sep 14, 2004
  2. Dmitry Borisov

    Re: avi file duration, frame-count etc

    Dmitry Borisov, Sep 14, 2004, in forum: Python
    Replies:
    1
    Views:
    412
    Rgemini
    Sep 14, 2004
  3. Igor
    Replies:
    2
    Views:
    513
  4. Replies:
    5
    Views:
    451
  5. Iain Lea
    Replies:
    0
    Views:
    112
    Iain Lea
    Apr 14, 2005
Loading...

Share This Page