I'm attempting to create a simple video conversion app which accepts any video format and then formats it into the desired format "automagically" all while attempting to keep aspect ratio and sound quality consistent. I do a ton of video converting and it would be handy for me to just shoot it off to a server to do all the converting while I work on other projects.
After some research it looks like FFMPEG is my best bet ...
Anyone have any thoughts? Is there a open source project that has already done this / code that I might have missed or looked over?
I donot recommend hosting such a service yourself. I think you should be able to find 'off-the-shelf' cloud provider with 'instant' transcoding machines on-demand.
You are not looking for application hosting, such as GAE, you are looking for P aaS (Platform as a Service), such as Azure, AWS EC2; Here is a good comparison:
https://softwareengineering.stackexchange.com/questions/64727/windows-azure-vs-amazon-ec2-vs-google-app-engine (note the answer by a GAE developer).
Basically, PaaS should be able to deliver you computing units (where you are specifically expected to utilize the full CPU (etc) potential of the instance - after that, you just terminate the instance; you pay by the hour, and you scale up as required; You can equally good run 1 small instance for a month, or run 60 large instances for a few hours and work out the financial equation).
I do remember seeing pre-existing cloud images precisely for doing video transcoding - don't remember where exactly, but look around at rightscale.com (which works with Rackspace and EC2 IIRC, perhaps more these days).
ffmpeg is easily the best choice for this. I use ffmpeg in my Python DLNA Digital Media Server to convert video files of any kind to the type expected by my television.
I've had a play with VLC's dummy interface, and mencoder, and neither came close to ffmpeg's usability.
Related
I'd like to either 1) Stream my camera+mic or 2) Stream my desktop+mic (or OBS) to many people (1 to many) watching from a web browser. Since I'd like to communicate with people in real time low latency is highly preferred (1 second or less would be great).
What's the standard way of doing this today? I have no idea what twitch uses but from playing with rtmp (using the nginx rtmp module) there seems to be a 4+second delay (or maybe I configured it poorly) and doesn't seem to have native browser support. People watching will use their desktop computers but some may be watching from their phones.
Am I to use webrtc somehow (does it support 1 to many? what software do I use)? Or HLS (which seems to want recordings, what config do I want for a live video)? What are my options?
This is an extremely difficult question. If you only need a hand full of viewers (around 10 or less), WebRTC the way to go. If there is a lot of viewers, and you can spend a lot of money, WebRTC is still a good choice, but the bandwidth cost can add up. If you don’t have a lot of money, but need a lot of viewers, you need cheeper bandwidth, this means using an HTTP CDN, and HLS or DASH which adds latency, but is cheeper to operate. If you have 100+ million dollars, you can build your own WebRTC cdn and have the best of both.
So to answer your question, there is no standard way. It depends on your circumstance, use cases and budget.
I'm aware that browsers usually restrict players to mp4 and webm type of media, but I'm wondering if it's possible for an electron-based app to run local videos with formats such as MKV and AVI. I can't find a definite source telling me what is and what is not available.
Electron is still limited to web technologies...
This means even though you have access to the file system and whatnot through the node APIs, content rendering happens inside a BrowserWindow which has about the same support for video playback as webkit based browsers.
You can use HTML5 video or canvas for this purpose, and that's pretty much it natively. (Flash is theoretically also supported, but the amount of work required to get it running is not worth it in my opinion... also, it's Flash, so, no.)
... but that's not entirely true
Even though native support ends there, you have various paths you can take to work around these limitaions. I'll list a few of the most common ones:
Convert your MKV/AVI video in the background to one of the supported formats. This has the drawback of needing the entire video file to be present on your filesystem (i.e doesn't work for streams).
Transcode your MKV/AVI stream on the fly to a supported format. This is pretty flexible but has some serious requirements on your environment, like having ffmpeg (or something similar) installed locally. Good luck packaging that if you want to distribute your app.
Embed a player capable of MKV/AVI playback. Most common example is VLC Player embedded through node bindings to libvlc. Check out the wcjs-player & wcjs-prebuilt modules if you want to go this way, they are node wrappers for the webchimera.js video player, which uses VLC in the background. (I'm not affiliated with them, just currently using the modules for something similar in one of my projects with success so far.)
I'm sure there are other solutions to this, but these are the most logical ones I've found while researching on the subject. Hope this helps!
If you're like me and you encountered this thread after searching for something like ".mkv Electron" just be aware that the current top response is no longer accurate.
Electron now plays .mkv files natively with <video> elements along with a number of other formats likely including .Avi. Don't be like me and try to go down the horrible rabbit hole that is webchimera and trying to get it to work with electron.
I'm considering building a website that helps musicians collaborate remotely. To do this, they would need to share large (uncompressed) audio files.
For the solution I'm considering, I'd like to be able to perform the following functions:
upload/download uncompressed audio files
stream uploaded audio
My concern is the large bandwidth demand. Should I perform these actions on my own (hosted) server space, or is there a service with APIs I can use?
I've checked out Amazon's S3 which allows me to host files, however I can't find anything that suggests I can stream from their services. I'm not sure that S3 is right for what I'm trying to achieve.
Can someone provide some high-level architectural advice?
Thanks in advance.
What Paul mentioned in his comments is true... S3 is not designed to be a CDN.
However, if your audio files aren't intended to be used by over a thousand people at a time, you don't actually need a CDN. You can put them on S3 and stream directly from there (over HTTP) without difficulty. It sounds like you're going to have a bunch of tracks that will only be accessed by a handful of people. S3 is fine for this.
When it comes to publishing finished work that might be used by many, that would be a good time to use Cloudfront.
I'm working on a project for teachers and students to be able to have a medium to interact with one another using Azure as a medium for content delivery. However, since this is basically a free service (and a non-profit site), not every teacher can buy a copy of Encoder Pro to encode their streams.
This is where I'm at a crossroads and not sure what path to go down. I want teachers to be able to stream their desktops and interact with students, probably using the MSN chat services or facebook chat services since it's infrastructure that I don't need to pay for. However, additionally the question is how do they capture their desktop? And would Azure be able to convert that into a "smooth streaming" file, so that people with lower bandwith connections can see the stream reliabily? I know Azure can function as a CDN, but I'm not sure if it can do the conversion to live smooth streaming so that students can actually make use of the service.
Any ideas would be helpful.. I'm kind of brainstorming right now and working on the client end of things, but I've slowed down until I can figure out this problem.
Thanks!
To answer part of your question, Azure recently added a Media Services component. It's still in preview mode (free for now). Think of it as a hosted Expression Encoder Pro exposed with a bunch of APIs. For more info https://www.windowsazure.com/en-us/develop/net/how-to-guides/media-services/
I'm doing a language web site for my university language center, where students login and see videos to learn English. i have to do it like this,
person is logging in to the system, search using a search area and find the details,lessons and videos relevant to that videos. this functionality exactly matches the youtube scenario.
for implementing twitter like functionality we can use status-net, is there a similer library, statusnet like famous implementation for youtube or a some kind of platform or a framework like codeigniter that we can use to implement youtube like site very easily??
please suggest some options?? a open source one or a commercial one ???
and what is the best video format to use in a such web site?? flv?? mp4?? or mov???
regards,
Rangana
Your best option is to use a 'cloud' based video processing service. Most have a sample project / library for many different languages and frameworks. Here is a list of a few I've tried and liked:
http://zencoder.com/
http://transloadit.com/
http://pandastream.com/
The typical steps involve uploading the video files to a large 'cloud' static asset host (such as S3) through the browser. If you are inexperienced it is best to select a processor that provides an uploader (it will handle putting the files in the right spot). Of the three, Transloadit and Panda both have custom unloaders.
Usually the service will allow you to either pass the encoding settings (what formats and qualities to) output to as parameters or configure them in your account. To support all current HTML5 browsers you just need H264 (.m4a) and OGG (.ogv). However, the new trend in the video world is for WEBM (.webm) so you might want to include it as well.
Next you will receive a unique code from the web service that you must store in persistent storage (database). The web service can be configured to 'callback' (perform an HTTP POST or GET request to your service) once the video is encoded.
Once your recieve a callback you can activate your video and start dislpaying it on your pages. For displaying, if you are inexperienced I'd highly recommend you use one of the following players:
http://sublimevideo.net/
http://longtailvideo.com/
http://videojs.com/
They all do similar things for different prices. My current personal favourite is Sublime Video (it offers cool light box effects and a gorgeous player).
Why do you have to re-implement Youtube when you can just use it for hosting your videos for free? Many online e-learning portals (e.g. Khan academy) do exactly that.
As far as the best video format to use -- go read about H.264/AVC. It's what Youtube currently uses.
I think you will not find already built solution ;)
But it's not really that hard. You can use existing frameworks that will make your life easier while you build account management system, the rest shouldn't be really that hard (assuming you don't really want to re-build the whole Youtube ;D ).
For playing videos, you can use JW Player. A great piece of software, you should check it out.