Ask Your Question
1

Reading a video in streaming (from youtube or dailymotion,...) using its URL or id

asked 2014-02-12 06:12:59 -0600

MLOO gravatar image

Hello, I'm programming in c++ and I want to read a video in streaming from internet (youtube,dailymotion...) using an url. Is it possible with OpenCV and which function should i use? Thanks.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-02-17 21:48:53 -0600

prakharmohan gravatar image

I have never done this but I think the function cvCaptureFromFile() can be used to do it. Don't know its current equivalent according to the newer documentation but you can use this. It works with some Network camera so ideally it should work.

Also, you can use VLC to stream and capture a stream too. Hope this helps :)

edit flag offensive delete link more

Comments

Thanks for answering :) but i need to open videos stored on the internet via streaming and process them with OpenCV

MLOO gravatar imageMLOO ( 2014-02-18 04:34:15 -0600 )edit

Well in that case you can use VLC to store the stream and then use VideoCapture::Open() to open the video. Tell me if this helps then I can edit my answer and you can accept it. :)

prakharmohan gravatar imageprakharmohan ( 2014-02-18 04:55:05 -0600 )edit

Thanks alot prakharmohan :) yes it is a good idea but how can i use VLC in codeBlocks ? and is it possible? infact i should process many URLs (Big Data) and i cant store all the stream in desktop, i mean i want to read only videos i don't want to store them!! what do you think?

MLOO gravatar imageMLOO ( 2014-02-19 05:10:46 -0600 )edit

You are using C++? You can always open the exe files using the system() method. And if you just want to open the stream you can use cvCaptureFromFile() as I have mentioned in my answer. It works provided you provide the correct link and have all the codecs. :)

prakharmohan gravatar imageprakharmohan ( 2014-02-19 05:26:42 -0600 )edit

Yes your answer helps me i ll try it, thanks alot prakharmohan :))))

MLOO gravatar imageMLOO ( 2014-02-19 05:50:40 -0600 )edit

I tried cvCaptureFromFile() and i have these wornings:"compressed swf format not supported" and "error opening file <../../modules/highgui/src/cap_ffmpeg_impl.hpp:365>" so i think at first i should convert swf to avi no!!

MLOO gravatar imageMLOO ( 2014-02-19 08:19:44 -0600 )edit

I think if i install k-lite codec pack perhaps my problem will be resolved ;) i ll try :)

MLOO gravatar imageMLOO ( 2014-02-19 08:36:29 -0600 )edit

Yup, that is ffmpeg problem. Are you using Linux for development? Because in that case you can specify at the time of compilation that you want to use ffmpeg. If you are on Linux, give it a try.

prakharmohan gravatar imageprakharmohan ( 2014-02-19 21:34:42 -0600 )edit

No i'm not using Linux, i'm using windows 8 :( no matter i'll try thanks :)

MLOO gravatar imageMLOO ( 2014-02-20 03:07:44 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-02-12 06:12:59 -0600

Seen: 4,874 times

Last updated: Feb 17 '14