stream video with eventmachine? - ruby

It seems to me that EM::FileStreamer should be usable out of the box, but I tried it with the <video> tag and with an embedded Quicktime plugin, but neither one would actually show the video.
I've connected to my EM server with telnet and found that it does indeed stream my video file. I'm at a loss as to why it's not buffering and playing in my browser. Anyone have any hints for me?

That should work, however the video must be encoded properly to stream in that fashion. I am assuming your using an mp4? If so, have you run qt-faststart on the file?
Here's an article with a bit of info.
http://www.stoimen.com/blog/2010/11/12/how-to-make-mp4-progressive-with-qt-faststart/
I also have my sample video encoding app on github, which does this automatically for you when you upload videos.
https://github.com/zquestz/asset-manager
Just make sure qt-faststart is in your PATH. Once the index information is at the beginning of the file, thing should work as expected.
Videos encoded with libtheora should work out of the box for supported browsers.

Related

Is there a way to use libvlc / libvlcsharp to non interactively transcode or compress a video on iOS?

I am using libVLCSharp (Xamarin bindings to the libvlc library) for video playback. I am adding a feature to transcode / compress downloaded videos to the local filesystem. Normally I'd use mobile-ffmpeg for this, but since internally VLC uses ffmpeg with different build configurations, ffmpeg transcoding does not work - android it crashes the app, ios returns a 'Invalid data found when processing input' error message when attempting to convert. The code works fine when libvlcsharp is uninstalled and there is only one instance of the ffmpeg library being used.
So, I'm looking for video compression / transcode options for Xamarin.iOS.
I've looked into the docs for libvlcsharp and it sounds like we can transcode, but it's somewhat vague on how to do that:
https://github.com/videolan/libvlcsharp/blob/3.x/docs/how_do_I_do_X.md
How do I do transcoding?
Pretty similarly to how you would do it from the CLI. Read https://wiki.videolan.org/Transcode/ and try media options with Media.AddOption.
In my case, I'd like to transcode non-interactively / in the background of the app. There is a 'dummy' option in the command line interface for doing this, so I was wondering how we'd do this from libvlc / libvlcsharp.
So far, my code from these docs looks like this:
using(var vlc = new LibVLC())
{
Media media = new Media(vlc, source, FromType.FromLocation);
media.AddOption($":sout=#transcode{{vcodec=h264,venc=x264{{cfr=40}},vb=2048,scale=auto,acodec=mp4a,ab=96,channels=2,samplerate=44100}}:std{{access=file,mux=ts,dst={destination}}}");
media.AddOption("dummy");
//How do I start the transcoding non interactively??
}
As replied on the libvlc discord server, when you are transcoding a video, it is not displayed at all and you just don't need to create a VideoView, the MediaPlayer alone is enough.
The rest is finding the correct transcoding options, and you already found the correct wiki page for that.

flowplayer-3.2.18 playing Video file with black screen

I'm using flowplayer-3.2.18 plugin in a html file to play video files uploaded in my Media server. I'm trying to play a .FLV file in Flowplayer, file is loaded and played but with a black screen! Can anybody help to resolve the issue?
I faced same issue too and didn't find good solution.
But this is deffenetelly related to the video codecs. I changed my video codec for my video file and it works now.
Also you can try to check this video file using Wowza player and if it doesn't work too you can be sure that is something wrong with video file

How to play uploaded videos in an iframe on a Mac system

I have tried using iframe and also video tag and object tag to play the video. In some cases, it plays only the audio from the video, but video doesn't show up.
Secondly, the same video file plays well on a separate tab in the browser, but not within my iframe.
This issue is on all browsers on my Mac, but on a windows machine it plays well.
I finally found it. Apple has a good documentation of its own for this. https://developer.apple.com/library/mac/documentation/quicktime/conceptual/qtscripting_html/QTScripting_HTML_Document/ScriptingHTML.html#//apple_ref/doc/uid/TP40001525-2-GettingaBrowsertoLoadQuickTime
I simply had to use the embed tag properly as they have explained.

Can't play video on FireFox and IE

I tried searching for a solution to this and within three days of browsing the forum I could't find any help.
This is the link where I have my video:
http://www.aguacatesjbr.com/English/Company/company.html
I believe the code is correct because I replaced my source video with the Oceans-Clip video provided by the site. The Oceas-Clip video CAN PLAY on FireFox and IE but not my original video. However, if I type in directly the address of my video it DOES render on FF and IE.
I donĀ“t think it is size problem because I was testing it with a video that weights 4.20MB.
I am having this problem with IE and FireFox in both PC and MAC. Android and Apple devices work perfectly as well with Chrome and Safari.
First of all, you need to serve the videos with the correct mime type, which is video/mp4 for H.264 in mp4, and video/webm for WEBM. See MSDN, MDN.
Right now you serve the .mp4video as video/mpeg.
Then, I your page has a source for video/webm pointing to http://www.aguacatesjbr.com/Videos/JBR_video.webm, which does not exist at the time of writing. Fix that.
Firefox can play back H.264/mp4 on certain platforms only. For a list of currently supported platforms and video support in Firefox in general see "Supported media formats".
Lastly, there will be warning messages regarding video load failures in newer Firefox versions. E.g.:
[20:35:11.515] HTTP "Content-Type" of "video/mpeg" is not supported. Load of media resource http://www.aguacatesjbr.com/Videos/JBR_video.mp4 failed. # http://www.aguacatesjbr.com/English/Company/company.html
[20:35:11.515] All candidate resources failed to load. Media load paused. # http://www.aguacatesjbr.com/English/Company/company.html

Is it possible to grab a snapshot from a previously recorded video on Windows Phone 7?

I'd like to know if it's possible to grab snapshots from previously recorded videos. Those videos are recorded in the app itself.
By the way, I'd like to grab the snapshot from a video file saved in IsolatedStorage without having to play the video.
Is it possible? If so, how can I do it?
Cheers,
Rafael
I am not aware of an official platform feature to do this. However, if the video file is within your app's isolated storage, you might be able to:
Send the video to a server to do the processing
Add codecs/C# code to your app to process the raw MPEG4 frames.
Try using WriteableBitmap to capture a specific frame when using the media element. Since most media is handled in hardware, however, it is possible that the frame will be blank.
I solved the problem by creating the thumbnail while recording the video (captureSource.CaptureImageAsync()). To do that, I used the same instance of the CaptureSource I'm using to record the video.

Resources