[MPlayer-users] Possible to get raw frames

Ivan ivan.q.public at gmail.com
Tue Sep 29 07:02:00 CEST 2009


> Is it possible to get a raw, decoded frame from an mpeg stream  
> somehow?
> I want it decoded, but not filtered in any way such as color space
> conversions etc...

You can use ffmpeg:

ffmpeg -i MOVIE_FILE -ss START_TIME -t DURATION -f rawvideo  
RAW_OUTPUT_FILE

FFmpeg will tell you the pixel format of the input movie and will use  
the same format for the raw output, which will probably be yuv420p  
(planar YUV with 4:2:0 chroma subsampling).  Note that ffmpeg uses  
exact seeking, which can be very slow if START_TIME is late in a long  
movie (we're talking slow as in decoding every frame from the  
beginning).

You can reuse the raw frame(s) as input to ffmpeg like so:

ffmpeg -f rawvideo -pix_fmt PIXEL_FORMAT -s WIDTHxHEIGHT -i RAW_FILE  
[output options...]

You could also process the raw stream and send it to ffmpeg through a  
pipe:

[process raw stream...] | ffmpeg -f rawvideo -pix_fmt PIXEL_FORMAT -s  
WIDTHxHEIGHT -i - [output options...]

best,
Ivan



More information about the MPlayer-users mailing list