Hi folks.

I'm looking for some pointers on how to "stream" a video file which is online.
I have no control over its location it could be http://anywhere.com/ontheweb.mp4 for example.
In my browser if I put the link into the address bar, it will simply download it to HDD.
I would like to find a code solution to play that video immediately. Perhaps in an embedded browser or even some other 3rd party software I can embed in my window (I've heard a little about ffmpeg, but not sure even what it is, let alone if it's capable.

Video files extensions will vary I suppose, but I'm happy to just stick with mp4 to get started.
Any hints, tips, suggestions are very welcome.

Thank you for taking the time to read.

Recommended Answers

All 13 Replies

I'll write I looked into this not long ago using HTML5's video support. There are now many example HTML5 code examples but the encoding of the video must be something supported by HTML5.

The big problem of MP4 is this: "MPEG-4 Part 14 or MP4 is a digital multimedia container format most commonly used to store video and audio" so you can't be sure it's encoded in a way that your decoder can handle.

I know those new to video files are shocked a little as we talk about containers versus encoding. Think as the MP4 file as a bucket. We can dump almost any encoded content in there but it doesn't mean our player will handle it.

OK, so how to handle what HTML5 does not? Maybe VLC Player (read https://productforums.google.com/forum/#!topic/chrome/EOwAyyjOphA ) but be aware that we have no control over the target PC, mobile or what browser they are going to use.

So my thought here is to head to HTML5 videos only.

There are good libraries provider such as Telerik.

I have found I can embed vlc media player to handle this, but not yet sure if vlc will need to be installed on end users machine.

@999, toss up a web page for folk to test. As I can remove and reinstall VLC in a minute to test as well as boot into my backup OS (Tails) then it's not too hard to see if it will fly.

OK, bog standard Windows 10. Firefox and VLC Player not installed. Will check if Flash was installed.
1. MP4 played.
2. FLV asked what to do with it.
3. MKV asks what to do.
4. 3GP asks to activate QuickTime.
5. Tutorial played.

OK, let's make sure iTunes and Flash is gone and retest.

OK, no more shockwave, Air or Apple software. Reboot and

  1. MP4 played.
  2. FLV asked what to do with it.
  3. MKV asks what to do.
  4. 3GP asks to activate QuickTime.
  5. Tutorial played.

So remembering that MP4 is a container you only need to test the results on a clean or your target machines.

Hope that helped.

Thanks rproffitt.

I must concede though that I'm not certain how you tested these.
Was it via vlc com object embedded in C# app?

In the top question I took it that you wanted to play it in a browser streamed from a web site. So I used the links you gave later to see what happens on a clean as I can make it Windows 10 laptop (which is my guinea pig machine here.) I see I made a mistake in item 4 after I cleaned off all Apple software (quicktime and iTunes) so the second test should have read 3GP asks what to do with the file.

Now let's say you have a C# app and you want to play a video that is online. Keeping in mind we don't have any say in the machine state, the web browser tests still tell us a lot here.

In VS2008 and later there is a WebBrowser object that I've used and can control in C#. This inherits all the playback issues I alluded to from the start but did play the file from the web if it's supported in the web browser.

Ah, I see. Thank you for that, it does help.

Eventually, I will want my software to play all video types in whatever containers they might be, including live streams (rtmp) so for now I'm leaning toward vlc embedded, which has handled all file types on web I've threw at it.

Just need to find an rtmp stream to try.

What I will need to find out is if end user will need full vlc install or just activex control.

Thanks again for sparing your time, I appreciate it.

To play your videos in live stream , do go for HTML5 Video tag which supports mp4 format and also check if they are in H264 codec format to play them in all browser and devices . Use FFMpeg for conversion if you require to change them to said codecs.

I'm not sure I understand. the video will be of unknown origin, and format and might even be rtmp, rtmpe stream or something like that, my aim is to be able to handle as many situations as possible. If I were to use a browser it would be windows forms webrowser control. Is what you suggest still valid?

Hi, if you are looking for live streamng handling with rmtp for flash , I would suggest convert the video with your scenario which handles mpeg-dash format for live streaming if your into HTML5 of choice.below link will help on the understanding.

Click Here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.