Converting to YUV
ffmpeg -i ARDrone.mp4 -f rawvideo -vcodec rawvideo -pix_fmt yuv420p ARDrone.yuv
All flags after -i ARDrone.mp4 are intented for ouput:
- -f rawvideo – raw output file format
- -vcodec rawvideo – video codec for output stream (not used for rawvideo)
- -pix_fmt yuv420p – pixel format of video fram
Playing YUV using mplayer
mplayer ARDrone.yuv -demuxer rawvideo -rawvideo w=480:h=270:format=i420
To play a raw video properly it’s necessary to specify frame size and pixel format since this information is not presented in the file.
Converting to YUV and resizing video
ffmpeg -i ARDrone.mp4 -f rawvideo -vcodec rawvideo -pix_fmt yuv420p -s 176x144 ARDrone_176x144.yuv
You may also use abbreviations instead of specifing a format as WxH. Fox example, -s 176×144 can be replaced by -s qcif.
Resizing raw video
If you want to resize existing raw video you must add information about your input file such as video file format, video codec, frame size and pixel format.
ffmpeg -s 480x270 -f rawvideo -vcodec rawvideo -pix_fmt yuv420p -i ARDrone.yuv -f rawvideo -vcodec rawvideo -pix_fmt yuv420p -s qcif ARDrone_qcif.yuv
Converting to YUV and clipping video
ffmpeg -i ARDrone.mp4 -f rawvideo -vcodec rawvideo -pix_fmt yuv420p -ss 5 -t 10 ARDrone_10s.yuv
This command converts the video file to raw format and extract a clip from 5th second (-ss 5) to 15th. Flag -t sets video duration.
No comments:
Post a Comment