Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi

I have been looking through the ffmpeg documentation and samples provided with the library and I can not figure out how to acquire a live stream from a webcam, I know it is possible, but can not figure out how to do this.

Does anyone have a tutorial or some sample code to access a webcam and get a live stream from it. I want to be able to acquire a live stream and encode it.

Thanks in advance!
Posted
Comments
Sergey Alexandrovich Kryukov 12-Mar-14 18:57pm    
Interesting problem, by they way, practically important, I voted 5 for the question.
—SA

1 solution

 
Share this answer
 
Comments
godspeed123 12-Mar-14 13:00pm    
Hi Sergey

Thanks for the links, I have seen these, but they dont provide a way to access this in C++. I want to use the api to do this. These links provide a way to do it via command line.
Sergey Alexandrovich Kryukov 12-Mar-14 13:06pm    
You are right, but I thought it would give you some ideas.

If you analyze it and compare with the source code, you will be able to figure out how streaming works "inside code". In particular, you can look at the code of the utility when it processes these command line option, to see what library calls are made to implement that. I understand that it's not easy, but you cannot search of some (maybe non-existing documentation) forever, will need to make a next step, eventually. Can you see my point?

—SA
godspeed123 12-Mar-14 14:37pm    
I see what you mean, I will try looking at this.

Thanks for the help!
Sergey Alexandrovich Kryukov 12-Mar-14 14:41pm    
You are welcome. I am sure you will be able to dig it out. The problem is that you are trying to use rarely used FFMpeg features. So, it might be too difficult to find better documentation.
Good luck.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900