Video Insanity: Time

I really feel like Alice in Wonder Land every time I try to do any thing to change the Dolphin video system. There is no end to the Rabbit Hole in sight, and nothing makes sense.

 

I am working on using a new player for the embed code that includes a custom skin, and a in video advertising system.

One of the requirements to make the video ad plugin to work is to know the duration of the content stream. It took some time, but I found a way to get and decode the 'Time' field form the RayVideoFiles table.

 

The issue is some of the videos in my database do not have the Time filed set.  After climbing further down the Rabbit Hole I find that the Time field is not set until someone actually plays the video! And each time the video is played the Time field is updated along with the number of views.

 

Now I have two issues. First, my embed code will not work properly unless the video is played at least once. Just visiting the page is not enough (auto play is off) and if someone grabs the code the first time visiting the page, the duration is not set. It will only work if you visit the page after the video has been played.  Second, if I replace the default video player on the site, the duration will not be set at all.

 

Hopefully the community can help me come up with a better way of setting the duration of a video in the Time field that doesn't require someone to play the video. Ideally this would be done during the video upload process.

 

For those that are interested, here are my basic goals for Dolphin video: 1) Stream-able H264 videos. 2) Two-Pass H264 video encoding 3) Branded video player with ads for embedding. 4) Support for Pre, Mid, Post, and Overlay ads in the sites player. If enough people are interested I may do a blog to document my progress.

Light man a fire keep him warm for a night, light him ON fire & he will be warm the rest of his life
Quote · 18 Aug 2010

I like the idea. I hope you can get it to work. I don't understand why boonex keeps using ray for video. I would like to something else that works like Vidi script or a Utube clone

Give me something to believe in...
Quote · 19 Aug 2010

Using FireBug I found that the Dolphin / Ray flash player is responsible for updating the Time field. When the player is told the time is '0' it sends a POST request with the duration/time of the video.

 

http://localhost/flash/XML.php?module=video&action=updateFileTime&id=113&_t=88400

Referer: http://localhost/flash/modules/video/app/player.swf Content-type: application/x-www-form-urlencoded Content-length: 25 time=129592%2E99999999999

 

From this you can see that /flash/XML.php was called with the options ?module=video&action=updateFileTime&id=113&_t=88400

The actual time is part of the POST packet.

 

Using something like this as part of the video uploading process would negate the need of the flash player to update the time. (thus allowing us to use different players)

 

<?php
$videofile="/var/video/user_videos/partofvideo.avi";
ob_start();
passthru("/usr/bin/ffmpeg -i "{$videofile}" 2>&1");
$duration = ob_get_contents();
ob_end_clean();

$search='/Duration: (.*?),/';
$duration=preg_match($search, $duration, $matches, PREG_OFFSET_CAPTURE, 3);
//TEST ECHO
echo $matches[1][0];
?>

But I do not know enough to add this to the video encoding scripts.

Light man a fire keep him warm for a night, light him ON fire & he will be warm the rest of his life
Quote · 19 Aug 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.