[MPlayer-users] Screenshot from specific frame number

84 views
Skip to first unread message

Marlon Smith

unread,
Mar 4, 2012, 6:26:49 PM3/4/12
to mplaye...@mplayerhq.hu
Hi everyone,

I have a raw h.264 video file, and I'd like to take a screenshot of one
of the frames. I know the video is encoded at 30fps. Normally, I can
use the -ss option to seek to the time location I want, but since this
is a raw h.264 file that doesn't seem to be an option.

Can anyone think of a way for me to seek to a specific frame, and take a
screenshot of that frame? That way I can still take a screenshot at the
time I want.

Thanks!

Marlon
_______________________________________________
MPlayer-users mailing list
MPlaye...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users

Onur Küçük

unread,
Mar 4, 2012, 6:31:31 PM3/4/12
to MPlayer usage questions, feature requests, bug reports

On Sun, 04 Mar 2012 15:26:49 -0800
Marlon Smith <marlon....@gmail.com> wrote:

> Hi everyone,
>
> I have a raw h.264 video file, and I'd like to take a screenshot of
> one of the frames. I know the video is encoded at 30fps. Normally,
> I can use the -ss option to seek to the time location I want, but
> since this is a raw h.264 file that doesn't seem to be an option.
>
> Can anyone think of a way for me to seek to a specific frame, and
> take a screenshot of that frame? That way I can still take a
> screenshot at the time I want.

Using -vo with an image format may help, that way you can take images
and select which one you want from them. See man page and

mplayer -vo help

--
Onur Küçük Knowledge speaks,
<onur.--.-.delipenguen.net> but wisdom listens

Marlon Smith

unread,
Mar 4, 2012, 6:44:02 PM3/4/12
to mplaye...@mplayerhq.hu
Hi Onur, thanks for the quick reply. I've been doing this to get a
screenshot from an avi video file:

mplayer input_file.avi -nosound -ss 00:00:10 -vo png -frames 1

and it does exactly what I want. It just doesn't work for raw h.264
files since I can't seek to a time location. In the example above, I'd
love to just replace the 00:00:10 with frame #300, but mplayer doesn't
seem to give me that option.

Marlon

Marlon Smith

unread,
Mar 6, 2012, 2:15:17 PM3/6/12
to mplaye...@mplayerhq.hu
Does anyone else have any thoughts on this? I'd really appreciate it.

Marlon

On Mon, 2012-03-05 at 01:31 +0200, Onur Küçük wrote:

Lobster

unread,
Mar 6, 2012, 2:28:35 PM3/6/12
to MPlayer usage questions, feature requests, bug reports
On 7/03/2012 8:15 a.m., Marlon Smith wrote:
> Does anyone else have any thoughts on this? I'd really appreciate it.
>
> Marlon
>
> On Mon, 2012-03-05 at 01:31 +0200, Onur Küçük wrote:
>
>> On Sun, 04 Mar 2012 15:26:49 -0800
>> Marlon Smith<marlon....@gmail.com> wrote:
>>
>>> Hi everyone,
>>>
>>> I have a raw h.264 video file, and I'd like to take a screenshot of
>>> one of the frames. I know the video is encoded at 30fps. Normally,
>>> I can use the -ss option to seek to the time location I want, but
>>> since this is a raw h.264 file that doesn't seem to be an option.
>>>
>>> Can anyone think of a way for me to seek to a specific frame, and
>>> take a screenshot of that frame? That way I can still take a
>>> screenshot at the time I want.

You could try using the framestep vf,
i.e `mplayer -nosound -benchmark -vf framestep=2800 -frames 1 -vo png
input.h264`

be aware, every frame until the frame you want will be decoded,
meaning if it is a long way into the file it may take a while.
I have not tested this myself so cant confirm it will work.

Marlon Smith

unread,
Mar 6, 2012, 5:53:05 PM3/6/12
to mplaye...@mplayerhq.hu
Thanks Lobster! That was exactly what I needed; I can deal with it
taking a minute to speed through the file.

Much appreciated!

Marlon

Marlon Smith

unread,
Mar 11, 2012, 11:35:48 PM3/11/12
to mplaye...@mplayerhq.hu
Hi everyone,

In the version of mplayer I'm running in Linux, I use the following
command to create a raw h.264 file, which mplayer tells me is an h.264
elementary stream file when I play it back:

mencoder input_filename -nosound -of rawvideo -ofps 30 -vf harddup -ovc
x264 -x264encopts bframes=0 -o output_filename

When I run the same command in Windows (I've tried with several of the
precompiled Windows binaries available), mplayer tells me:

libavformat file format detected

instead of what it said with the file generated in Linux, which is:

H264-ES file format detected

Does anyone know if there's a parameter I'm missing to specify that I
want mencoder to create an elementary stream? I'm converting the files
for some custom hardware, and it's very picky about what it will play.

Thanks!

Marlon

Reply all
Reply to author
Forward
0 new messages