I am uploading videos to SQL SERVER SQL database using MVC. So far I can programmatically download unprocessed videos to my Computer process them eg convert to desired format/generate thumbnails/ etc etc and reupload the videos. I am using VLC Command Line [I know this might get me thumbs down but hey it works.] and a custom program. I read a lot about FFMPEG but most examples are in PHP and I am yet to come across any MVC example. I am thinking of transitioning to FFMPEG but want to ask people if the right place for FFMPEG is on the SERVER or on a PC? And can you point me to any examples/tutorials of FFMPEG in MVC/ASP.
Related
I want to stream live video from my website. This website will be basically for a TV Channel which hosts shows 24 hours. So, this video will stream live for 24 hours like some sports channel. So, If anyone have some idea of Streaming video wholeday from my own website, please tell me.
I have searched and found out solution for encoder as Teradek Vidiu and Software solution as DaCast and UStream.
But, I did not find DaCast or UStream useful for providing stream from my website for whole day. They are useful when I want to go for any event streaming. I Can also go for Developing my own RTMP Server, but i found that it will have security issues then.
You could use MonaServer. I'm the co-author of this project, it is a media server that is well suited for real-time streaming as it implements RTMFP (no more security issues than other solutions). It is already used by TV channels. You can develop your flash client or ask us to build it.
You can try publishing with this sample : http://raspi.monaserver.ovh/MonaClients/VideoPublisher/
And reading with this one : http://raspi.monaserver.ovh/MonaClients/VideoPlayer/
And you can use Netgroup for P2P streaming if you have limited bandwidth.
There is a free nginx-rtmp module for NGINX fast web server, which supports recording, on-the-fly encoding, RTMP broadcasting, authorization and statistic page.
We used it in an online education project for video recording and it worked good.
https://github.com/arut/nginx-rtmp-module/wiki
According to our tests - works much better and faster then other opensource Red5 or crtmpd servers. Good opensource RTMP server alternative.
When uploading a file I know I can access its properties but is it always the same or it varies? I mean, I am writing an app for myself where I can upload songs or videos to my server to watch later, and I'd like to populate the info about said files automatically as much as possible so I was wondering if it's possible to get things like length, quality, name, artists, artwork, or pick a first image like youtube does for its videos?
I'm fairly new to ruby (using rails) so I am unsure as to where to find this or if it's even possible
You can do that using FFMpeg (read the license first).
FFMpeg gives you everything you were asking about and some more.
it's very powerful.
For mp3, check out mp3-info, I haven't used it before but looks promising...
User can upload any video of any type... after that I need to convert this video to *.flv
How can I do this using RoR?
We do this with paperclip and ffmpeg. Paperclip allows you to add custom processors to a Paperclip attachment. We created such a processor which just calls ffmpeg on the command line to create the flash version of the video. ffmpeg even allows you to extract stills from the video for thumbnail representations.
With paperclip and ffmpeg and flvtool2
Have look at this gist with all you'll need. https://gist.github.com/507804
It has:
Video to thumbnails
Video to flash
Correct geometry calculations etc...
There are two ways to do it, yourself or hosted solution.
If you want to do it yourself, start with Bert's solution and go from there. Remember transcoding is CPU intensive, so you likely need to have a another server/on-demand instance doing this
If you want to go for a hosted solution, see Kaltura.com or encoding.com
sign up for pandastream - available as a heroku add-on as is zencoder
they're not cheap options though so maybe look around for something less costly first
I was planning to use the vlc library to decode an H.264 based RTSP stream and extract each frame from it (convert vlc picture to IplImage). I have done a bit of exploration of the vlc code and concluded that there is a function called libvlc_video_take_snapshot which does a similar thing. However the captured frame in this case is saved on the hard disk which I wish to avoid due to the real time nature of my application. What would be the best way to do this? Would it be possible without modifying the vlc source (I want to avoid recompilation if possible). I have heard of vmem etc but could not really figure out what it does and how to use it.
The picture_t structure is internal to the library, how can we get an access to the same.
Awaiting your response.
P.S. Earlier I tried doing this using FFMPEG, however the ffmpeg library has a lot of issues while decoding an H.264 based RTSP stream on windows and hence I had to switch to VLC.
Regards,
Saurabh Gandhi
What is the best way to add video uploading, encoding and streaming functionality to my Rails app ?
I'm thinking about a mix as : Rails app + Video Online Encoder + Amazon S3. What do you think ?
For the Video Online Encoder (VOE), which one is the easier to use with Rails : heywatch, panvidea, encoding.com, pandastream, ... ?
By the way, the application will allow users to play streamed videos with dynamic Texts, Schemas and Sounds added to them at the run time. There's an example :
in rails app (backoffice or frontoffice) : Video upload (.mov, .avi, ...)
VOE : video encoding in FLV format + storage in Amazon S3
in rails app, backoffice : in a home-made Flash application, "add" to the video a Text and a Schemas showed after 1 minute for example (informations stored in the Rails app DB).
in rails app, frontoffice : play the streamed video from Amazon S3 (+Cloudfront) in a home-made Flash player which show dynamicaly the Text and the Schema over the video after 1 minute of playing.
The part I really don't understand is the FLV video Stream. I was thinking that Cloudfront could do that.
I hope I'm clear enough ;-)
Thank you all for your answers !
Disclaimer: I am a co-founder for transloadit.com.
I would discourage you from rolling your own solution. The link alexy13 posted will certainly get you an application that can receive user videos and encode them. However, you'll end up with a few limitations:
Resized videos will be distorted unless their aspect ratio is 4:3. To avoid that you need to sniff their dimension before the conversion and then apply a set of padding -vfilters to ffmpeg. Sniffing the dimension correctly will require a cocktail of at least 2 command lines tools (ffmpeg itself and exiftool) + a bunch of crazy code to deal with display aspect ratios that differ from the pixel aspect ratios.
Not all videos will convert. Sometimes you need to do additional sniffing on the video content and set some custom flags, otherwise you'll receive an error. Granted, 95% of all videos will probably work - but getting those last 5% is hard.
You will need an additional web server that does the video encoding, otherwise your site will be very sluggish while a video is being encoded. You can work around this by using the nice command to limit the CPU resources used by ffmpeg, but that will result in significantly longer encoding times.
This is a short list of problems, but generally you are ~100 hours away from having a system that runs without hickups and can deal with some load.
So I would encourage you to re-consider going with a service. Our competitors are quite nice, but of course I'd also be very happy if you would check out our service (transloadit.com) or shoot me an email at felix.geisendoerfer#transloadit.com if you have any questions.
There is also a Rails3 sample application for using transloadit with paperclip and S3:
http://github.com/joerichsen/transloadit-paperclip-example
--fg
Zencoder looks cool and it probably has the API support you want. Use flash for the player I'm guessing? You will need FMS or Red5 for that. Here is a link to a really simple example that transcodes something stored in S3 for you, in Ruby of course!: http://zencoder.com/docs/integration-libraries/#library
I would feel skeptical using a free third party online service. I would consider using server-side video encoding because the third-party web service could have variable performance, and could do basically anything to the video. If you don't have many CPU's then a third-party service might be a good choice.
EDIT: This Link should help you a bit