DirectShow Capture support
Re: DirectShow Capture support
what about mjpeg?
>> using -vcodec mjpeg -i ... -vcodec copy -f mjpeg , I can see frames getting copied
can you specify a muxer with -f mp4 ?
>> using -vcodec h264 -i ... -vcodec copy -f mp4, no frames were copied. Leaving this setup running for a while didn't change the output.
If its feasible at your end, I can ship the camera to you, and let you work on it.
Thanks
>> using -vcodec mjpeg -i ... -vcodec copy -f mjpeg , I can see frames getting copied
can you specify a muxer with -f mp4 ?
>> using -vcodec h264 -i ... -vcodec copy -f mp4, no frames were copied. Leaving this setup running for a while didn't change the output.
If its feasible at your end, I can ship the camera to you, and let you work on it.
Thanks
-
- Posts: 1877
- Joined: Fri Aug 05, 2011 9:56 pm
Re: DirectShow Capture support
my only concern is that I may have to keep it for months trying to figure out what is going on...if you're ok with that then send it on, otherwise in a month or 2 I'll hopefully buy my own and try it out.
-r
-r
DirectShow Capture and streaming
Hello:
I've an application, where I need to stream and capture pics of the same stream at random intervals ( user triggered).
To support this I start a ffmpeg session with 2 outputs:
a. h264 stream (rtmp) to a media server
b. mjpeg stream (udp) to a local server
I then start an another ffmpeg session to read the udp stream and extract a frame from it.
While all this works, the capture session (from the udp stream) takes about 5-6 seconds to grab a frame, making this setup quite inaccurate.
Is there a better way of doing this ? How can I make the capture session quick ?
Thanks
I've an application, where I need to stream and capture pics of the same stream at random intervals ( user triggered).
To support this I start a ffmpeg session with 2 outputs:
a. h264 stream (rtmp) to a media server
b. mjpeg stream (udp) to a local server
I then start an another ffmpeg session to read the udp stream and extract a frame from it.
While all this works, the capture session (from the udp stream) takes about 5-6 seconds to grab a frame, making this setup quite inaccurate.
Is there a better way of doing this ? How can I make the capture session quick ?
Thanks
Re: DirectShow Capture support
I sent you a PM for the shipping coordinates.rogerdpack wrote:my only concern is that I may have to keep it for months trying to figure out what is going on...if you're ok with that then send it on, otherwise in a month or 2 I'll hopefully buy my own and try it out.
-r
-
- Posts: 1877
- Joined: Fri Aug 05, 2011 9:56 pm
Re: DirectShow Capture and streaming
How does your setup support random capture?mobi1300 wrote:Hello:
I've an application, where I need to stream and capture pics of the same stream at random intervals ( user triggered).
To support this I start a ffmpeg session with 2 outputs:
a. h264 stream (rtmp) to a media server
b. mjpeg stream (udp) to a local server
I then start an another ffmpeg session to read the udp stream and extract a frame from it.
While all this works, the capture session (from the udp stream) takes about 5-6 seconds to grab a frame, making this setup quite inaccurate.
Is there a better way of doing this ? How can I make the capture session quick ?
Thanks
Is it 5-6 seconds just to startup and capture the frame? is it using 100% cpu?
http://ffmpeg.org/trac/ffmpeg/wiki/Stre ... de#Latency might be helpful.
Re: DirectShow Capture and streaming
As you can see, I am sending mjpeg frames to the local server, hoping delineating them would be easier that way. Tried playing with the -analyzeperiod but much luck.rogerdpack wrote:Here is the whole cmd:mobi1300 wrote:Hello:
I've an application, where I need to stream and capture pics of the same stream at random intervals ( user triggered).
To support this I start a ffmpeg session with 2 outputs:
a. h264 stream (rtmp) to a media server
b. mjpeg stream (udp) to a local server
I then start an another ffmpeg session to read the udp stream and extract a frame from it.
While all this works, the capture session (from the udp stream) takes about 5-6 seconds to grab a frame, making this setup quite inaccurate.
Is there a better way of doing this ? How can I make the capture session quick ?
Thanks
ffmpeg-32 -f dshow -s 432x240 -pix_fmt yuv420p -i video="Logitech HD Pro Webcam C920" -vcodec libx264 -f flv junk01.mp4 -vcodec mjpeg -r 10 -f mjpeg udp://127.0.0.1:6666
(shown here with file not rtmp)
How does your setup support random capture?
When I need to do a capture, I simply fire an another instance of ffmpeg, like this:
.\ffmpeg-32 -f mjpeg -r 10 -i udp://127.0.0.1:6666 -frames 1 -f image2 pic2.jpg
Is it 5-6 seconds just to startup and capture the frame? is it using 100% cpu?
The capture process from the start to finish takes 5-6 ( sometimes longer). The CPU barely goes over 10%, even with both the instances running.
http://ffmpeg.org/trac/ffmpeg/wiki/Stre ... de#Latency might be helpful.
Thanks.
-
- Posts: 1877
- Joined: Fri Aug 05, 2011 9:56 pm
Re: DirectShow Capture support
how often is it sending frames? you might get some useful info using -loglevel debug. Unfortunately I don't have the ability to try and reproduce it here, I wonder what is going on...also hopefully with some improvements in libavfilter in the (long or short) future we can create a filter that "takes a single snapshot" or the like, that would avoid startup cost...
Re: DirectShow Capture support
Hello, I'd like to know if there are any news concerning the problem of @mobi1300. I've got a similar one. Dealing with a couple of different commands, I'm not able to get a working mp4-outputfile, which is playable from WMP or VLC - although it does from ffplay and wowza (wondering).
On the other side, outputformats such as avi or flv works as expected:
Don't know where to start, finding a solution for this, already tested a lot of different gits...
Code: Select all
ffmpeg -loglevel debug -r 10 -f dshow -i video="SMP WebCam" -c:v libx264 webcam.mp4
ffmpeg -f dshow -i video="SMP WebCam" output.mkv
ffmpeg -f dshow -i video="SMP WebCam" output.mp4
Code: Select all
ffmpeg -loglevel debug -r 10 -f dshow -i video="SMP WebCam" -c:v libx264 webcamflv.flv
ffmpeg -loglevel debug -r 10 -f dshow -i video="SMP WebCam" -c:v libx264 webcamflv.avi
-
- Posts: 1877
- Joined: Fri Aug 05, 2011 9:56 pm
Re: DirectShow Capture support
your problem is that the output is not playable (I think mobi300's problem was latency was too high) is that correct?
Anyway I'd guess you need to specify -pix_fmt yuv420p
as by default it encodes it to yuv422 or yuv444 or something, which isn't recognized by all players.
Anyway you can try it at least, though that it really weird that it works in an flv...hmm...
Could you post the console output of running $ ffmpeg -i filename
for each of the output files?
-roger-
Anyway I'd guess you need to specify -pix_fmt yuv420p
as by default it encodes it to yuv422 or yuv444 or something, which isn't recognized by all players.
Anyway you can try it at least, though that it really weird that it works in an flv...hmm...

Could you post the console output of running $ ffmpeg -i filename
for each of the output files?
-roger-
Re: DirectShow Capture support
Thanks for your fast reply. I already tried your suggestion with pix_fmt and got some error-messages. Now I realized that it was my fault, setting the pix_fmt-argument behind the input-source does the magic
Thank you very much!

'