(Noob here - be gentle with me) Difficult gstreamer pipeline - Decode/demux h264 file to jpeg on Windows using DirectShow
Bo Lechnowsky
bo at respectech.com
Sun Aug 11 00:14:45 PDT 2013
I've been trying for days to get gstreamer's gst-launch-1.0 to output an
h264 stream as individual jpegs, but want only one per second, and using
the DirectShow hardware acceleration. I've tried numerous iterations of
commands, and this is the closest I've gotten:
gst-launch-1.0 filesrc location=test.h264 ! decodebin ! videorate !
video/x-raw,framerate=1/30 ! jpegenc ! multifilesink location=img%03d.jpg
This gives me 300 jpegs from my 10 second h264 stream, and it doesn't
use the DirectShow hardware interface.
I've used gst-inspect to try to use what I thought was the DirectShow
decoder for h264 (video/x-h264) but that gives me errors. I've also
tried to change the framerate from 1/30 to 30/1 and 1/1, but always get
the same 30 jpeg per second output. Therefore, I'm assuming that
framerate is a method for me to tell gst how many fps the source file is.
I thought decodebin was supposed to automatically select the best
decoder based on the input stream, but it appears to be using a CPU
intensive one (instead of GPU hardware-accelerated) judging by how the
CPU on my test machine pegs at 100% for the duration of the gstreamer
process.
Ideally, I'd also like the jpegs to be output at a different resolution
than the resolution of the video, but everything I've tried
(width=640,height=480) either causes errors or doesn't result in a
resized jpg.
I know how to do all this with avconv, but it also is CPU intensive and
I'm trying to free the CPU to perform other tasks during the decoding
process.
My test system is older and has an ATI Radeon Xpress 1250 card in it and
the system says it is running DirectX 9.0c. According to specs, the
X1250 has DirectX 9 in hardware. I don't know when h264 decoding was
added to DirectX, but I'd assume it was in well before DirectX 9.
I'd REALLY appreciate any help any of you gurus could provide!
More information about the gstreamer-devel
mailing list