reset password
Author Message
abhishek_sharma
Posts: 79
Posted 14:35 Mar 12, 2012 |

Can anyone tell me how to stream video.

I have a mnt drive containing  TB's of video and I am willing to make a personal site to play those videos to the world.

I am using HTML5 video tag something like this <video><source src="video.abhi.com/Video/video1.mp4"/></video>

This Video servlet is something like this

Read correct video file from drive , and set the proper content type and content length, and copy the contents of the file to the servlet's output stream.

Thou  I can play video but only once and I can't seek video back and forward.

Do I need to setup RTMP server etc.


Please Help Thanks

cysun
Posts: 2935
Posted 15:12 Mar 12, 2012 |

I'm not familiar with the status of video playback support in HTML5. It seems like your approach is fine. Maybe the problem is because HTML5 video player is not advanced enough yet. I'd try the same thing with Flash/Silverlight and see it has the same problem.

cysun
Posts: 2935
Posted 15:23 Mar 12, 2012 |

One more thing. In order to support rewind/fast forward, your servlet may need to support the HTTP range header. You should check the HTTP requests when you try to rewind/fast forward.

abhishek_sharma
Posts: 79
Posted 15:29 Mar 12, 2012 |

Thank you Dr. Sun for your reply.

I did some other approach

1) I placed a video file (say video1.mp4) in a web server (Videos directory ) and using same HTML5 tag I can play it perfectly with seeking back and forth <video><source src="Videos/video1.mp4 type="video/mp4"/></video>

2) I placed a file in Amazon S3, and using Cloudfront I created a distribution method (with delivery method as download)

<video id="my_video_1" class="video-js vjs-default-skin" controls  preload="auto" width="640" height="264"  data-setup="{}">
                "<source src="http://d19sqrwqpipzi1.cloudfront.net/L_00010.mp4" type='video/mp4'></video>"

Both this approach is working

The problem neither I can use Web server nor Amazon.

Is it my  file is not staying in buffer ? At this point I am so confused .

Thanks
 

abhishek_sharma
Posts: 79
Posted 15:29 Mar 12, 2012 |
cysun wrote:

One more thing. In order to support rewind/fast forward, your servlet may need to support the HTTP range header. You should check the HTTP requests when you try to rewind/fast forward.

Thanks you Dr. Sun

cysun
Posts: 2935
Posted 15:33 Mar 12, 2012 |
abhishek_sharma wrote:

Thank you Dr. Sun for your reply.

I did some other approach

1) I placed a video file (say video1.mp4) in a web server (Videos directory ) and using same HTML5 tag I can play it perfectly with seeking back and forth <video><source src="Videos/video1.mp4 type="video/mp4"/></video>

2) I placed a file in Amazon S3, and using Cloudfront I created a distribution method (with delivery method as download)

<video id="my_video_1" class="video-js vjs-default-skin" controls  preload="auto" width="640" height="264"  data-setup="{}">
                "<source src="http://d19sqrwqpipzi1.cloudfront.net/L_00010.mp4" type='video/mp4'></video>"

Both this approach is working

The problem neither I can use Web server nor Amazon.

Is it my  file is not staying in buffer ? At this point I am so confused .

Thanks
 

In that case I think it's because the servlet is not sophisticated enough to handle things like the range header. Like I said in the previous post, examine the HTTP requests (you can set up an Eclipse TCP/IP monitor between a browser and the web server in your Test 1 setup) and see what the requests look like.

abhishek_sharma
Posts: 79
Posted 15:39 Mar 12, 2012 |

I will do that right now.

Thanks once again

abhishek_sharma
Posts: 79
Posted 17:42 Mar 12, 2012 |

Dr Sun ,

Thank you for your guidance.  My TCP/IP Monitor not showing any request , may b because I am not making any request and more over there are some browser compatibility issues

After spending a couple of days I feel like I have to configure my own video server. I am planning to go with HTTP pusedostreaming .

Is I am heading  in right direction ?

 

cysun
Posts: 2935
Posted 17:51 Mar 12, 2012 |
abhishek_sharma wrote:

Dr Sun ,

Thank you for your guidance.  My TCP/IP Monitor not showing any request , may b because I am not making any request and more over there are some browser compatibility issues

After spending a couple of days I feel like I have to configure my own video server. I am planning to go with HTTP pusedostreaming .

Is I am heading  in right direction ?

Are you sure you configured TCP/IP correctly?... Anyways, do what you want and have fun.

abhishek_sharma
Posts: 79
Posted 19:40 Mar 12, 2012 |

It was wrong configuration ..

just for everyone information use lighthttpd server for mid range video server and use http psuedostream.

i will post code n all steps soon

thanks once again Dr Sun

jadiagaurang
Posts: 53
Posted 20:28 Mar 20, 2012 |
abhishek_sharma wrote:

Dr Sun ,

Thank you for your guidance.  My TCP/IP Monitor not showing any request , may b because I am not making any request and more over there are some browser compatibility issues

After spending a couple of days I feel like I have to configure my own video server. I am planning to go with HTTP pusedostreaming .

Is I am heading  in right direction ?

 

Hey Abhishek,

If I want to debug HTTPRequest and HTTPResponse. I personally like to use  Charles Web Debugging Proxy . I have used Fiddler2 as well. Both are good and give you more feature then Eclipse TCP/IP Monitor.

abhishek_sharma
Posts: 79
Posted 12:46 Mar 21, 2012 |
jadiagaurang wrote:
abhishek_sharma wrote:

Dr Sun ,

Thank you for your guidance.  My TCP/IP Monitor not showing any request , may b because I am not making any request and more over there are some browser compatibility issues

After spending a couple of days I feel like I have to configure my own video server. I am planning to go with HTTP pusedostreaming .

Is I am heading  in right direction ?

 

Hey Abhishek,

If I want to debug HTTPRequest and HTTPResponse. I personally like to use  Charles Web Debugging Proxy . I have used Fiddler2 as well. Both are good and give you more feature then Eclipse TCP/IP Monitor.

Hey Gaurang,

Thanks for the suggestions

 

abhishek_sharma
Posts: 79
Posted 12:52 Mar 21, 2012 |

Just for sharing, this is what I did for personal video player.

Check attahcment and shoot me any question.

Thanks to Dr. Sun 

Attachments:
Last edited by abhishek_sharma at 14:36 Mar 21, 2012.
jadiagaurang
Posts: 53
Posted 23:38 Mar 21, 2012 |
abhishek_sharma wrote:

Just for sharing, this is what I did for personal video player.

Check attahcment and shoot me any question.

Thanks to Dr. Sun 

It looks interesting to me. I have two nix (CentOS 6 and Mac OS X 10.7.3.). I will give a shot for heck of it. :) Thanks for sharing though.

abhishek_sharma
Posts: 79
Posted 23:40 Mar 21, 2012 |
jadiagaurang wrote:
abhishek_sharma wrote:

Just for sharing, this is what I did for personal video player.

Check attahcment and shoot me any question.

Thanks to Dr. Sun 

It looks interesting to me. I have two nix (CentOS 6 and Mac OS X 10.7.3.). I will give a shot for heck of it. :) Thanks for sharing though.

Ur welcome.... I haven't tried on CentOS but on OSX i encounter some issue