I need to capture every single byte of the video stream from webcam -after using commandline-ffmpeg to compress it with codec.
So can you please light me up with somewhat the ffmpeg commandline look like and the strategy to get the output stream into my program written by VB6 or VB.net ? (I need to manipulate with every single byte!) Highly appreciate any suggestion.
Update : I wonder if it's possible to save the output as "avi" file on hard disk and at the same time use my program to read content of the saving file. Can I playback the "part of avi file" that I retrieve while the file is being saved (appended) ? Is there any better file format for writting & reading (recording & playing) at the same time other than "avi" ?
Or any better/faster solution?
Pelase go through the page https://trac.ffmpeg.org/wiki/Capture/Webcam
It is clearly mention there how to capture webcam video using ffmpeg.
Yes you can save avi stream to disk and read from it at the same time, I am sure it is possible in linux because there is no file locking.
Or you can write to a pipe and read it from the pipe frame by frame.
Linux example to capture video and write it to a pipe.
Reading from /dev/video0
ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0 -f rawvideo -pix_fmt yuv420p pipe1.
You should first create pipe1 to run this command, now you can read from this pipe. Piple is FIFO data strecture in linux which will flush as data is being read. SO this will suit your requirement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With