[FFmpeg-user] What is rightway to convert rawframe into jpeg image?
satya gowtham kudupudi
satyagowtham.k at gmail.com
Sat Oct 19 05:42:39 CEST 2013
Firtst I've created a raw frame using
ffmpeg -f v4l2 -s 320x240 -i /dev/video0 -f rawvideo -vcodec rawvideo -r 1
-t 1 rawframe
ffmpeg version N-38332-g0a4aea6 Copyright (c) 2000-2013 the FFmpeg
developers
built on Sep 30 2013 19:27:13 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
configuration:
--prefix=/home/gowtham/NetBeansProjects/remotedevicecontroller/ffmpeg_build
--extra-cflags=-I/home/gowtham/NetBeansProjects/remotedevicecontroller/ffmpeg_build/include
--extra-ldflags=-L/home/gowtham/NetBeansProjects/remotedevicecontroller/ffmpeg_build/lib
--bindir=/home/gowtham/NetBeansProjects/remotedevicecontroller/ffmpeg_build/bin
--extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-nonfree
libavutil 52. 46.100 / 52. 46.100
libavcodec 55. 33.101 / 55. 33.101
libavformat 55. 18.104 / 55. 18.104
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 88.100 / 3. 88.100
libswscale 2. 5.100 / 2. 5.100
libswresample 0. 17.103 / 0. 17.103
libpostproc 52. 3.100 / 52. 3.100
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 1335.083679, bitrate: 36864 kb/s
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240,
36864 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Output #0, rawvideo, to 'rawframe':
Metadata:
encoder : Lavf55.18.104
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240,
q=2-31, 200 kb/s, 90k tbn, 1 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo -> rawvideo)
Press [q] to stop, [?] for help
frame= 1 fps=0.0 q=0.0 Lsize= 150kB time=00:00:01.00
bitrate=1228.8kbits/s
video:150kB audio:0kB subtitle:0 global headers:0kB muxing overhead
0.000000%
I tried converting rawframe to jpeg image using
$ ffmpeg -f rawvideo -vcodec rawvideo -s 320x240 -r 1 -pix_fmt yuv422p -i
rawframe -updatefirst 1 rawframe.jpg
ffmpeg version N-38332-g0a4aea6 Copyright (c) 2000-2013 the FFmpeg
developers
built on Sep 30 2013 19:27:13 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
configuration:
--prefix=/home/gowtham/NetBeansProjects/remotedevicecontroller/ffmpeg_build
--extra-cflags=-I/home/gowtham/NetBeansProjects/remotedevicecontroller/ffmpeg_build/include
--extra-ldflags=-L/home/gowtham/NetBeansProjects/remotedevicecontroller/ffmpeg_build/lib
--bindir=/home/gowtham/NetBeansProjects/remotedevicecontroller/ffmpeg_build/bin
--extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-nonfree
libavutil 52. 46.100 / 52. 46.100
libavcodec 55. 33.101 / 55. 33.101
libavformat 55. 18.104 / 55. 18.104
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 88.100 / 3. 88.100
libswscale 2. 5.100 / 2. 5.100
libswresample 0. 17.103 / 0. 17.103
libpostproc 52. 3.100 / 52. 3.100
[rawvideo @ 0xa0a6120] Estimating duration from bitrate, this may be
inaccurate
Input #0, rawvideo, from 'rawframe':
Duration: 00:00:01.00, start: 0.000000, bitrate: 1228 kb/s
Stream #0:0: Video: rawvideo (Y42B / 0x42323459), yuv422p, 320x240,
1228 kb/s, 1 tbr, 1 tbn, 1 tbc
[swscaler @ 0xa094060] deprecated pixel format used, make sure you did set
range correctly
Output #0, image2, to 'rawframe.jpg':
Metadata:
encoder : Lavf55.18.104
Stream #0:0: Video: mjpeg, yuvj422p, 320x240, q=2-31, 200 kb/s, 90k
tbn, 1 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo -> mjpeg)
Press [q] to stop, [?] for help
[swscaler @ 0xa094060] Warning: data is not aligned! This can lead to a
speedloss
frame= 1 fps=0.0 q=0.0 Lsize=N/A time=00:00:01.00 bitrate=N/A
But the rawframe.jpg is cluttered. I'm attaching the rawframe.jpg.
https://lh3.googleusercontent.com/-qUIhUMjFJog/UmH_OjWPp9I/AAAAAAAAAvE/8onctMkRB10/w320-h240-no/rawframe.jpgis
the link for rawframe.jpg if the attachment fails. What mistake I've
done? What is the right way of converting raw frame to jpeg image.
--
Gowtham
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rawframe.jpg
Type: image/jpeg
Size: 50648 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20131019/c894c2b6/attachment.jpg>
More information about the ffmpeg-user
mailing list