htmlVideoLoader() and NotifyObject

Help for using specific functions

htmlVideoLoader() and NotifyObject

Postby Kataleena » Sun Aug 24, 2014 7:09 pm

Hi,

I have 6 mp4 on different pages, I'm using htmlVideoLoader() and NotifyObject to move to the next page at the end of the video.

I'm using:

If value contains "ended"
goto the next page
end if

However its going to the next page on some of my video about 3 seconds before the video is finished, it happens every time on 1 video and only sometimes on some of the others.

I'm at a complete loss, please help.

Thanks
Kate
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm

Re: htmlVideoLoader() and NotifyObject

Postby Clifton » Sun Aug 24, 2014 7:15 pm

Hello,

It is very important to know if this is a browser-specific issue or if it happens in every browser.

Also, about how long are the videos?

Thanks,
Clifton
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: htmlVideoLoader() and NotifyObject

Postby Kataleena » Sun Aug 24, 2014 7:20 pm

Hi Clifton,

Thank you for your fast reply, it happens on IE, Chrome and Mozilla and I have tested on different versions and computers.

My Videos range from 3-6 minutes.

Thanks Kate
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm

Re: htmlVideoLoader() and NotifyObject

Postby Clifton » Sun Aug 24, 2014 9:50 pm

If the problem exists in all browsers, then you may need to do some debugging of the mp4 videos to see if they are out of sync with audio and video feeds. For example, if the audio ends early and reports that to the player, then the "ended" event will fire. If the video feed ends early (before the audio has finished playing) then the event will also be fired. Regardless, the PowerPac video player is receiving the event from the html object element and is simply responding as it is designed.

Out of sync videos may only show themselves when played in web browser because of the codecs used by the browser and/or the canvas they are played on. This can also happen if the audio data rate is too high/low or the video frame rate is higher than the hardware can keep up with. In this latter case, the HTML 5 video player will drop frames which could cause and early end. The fact that the end occurs at different times may suggest that this is part of the problem.

How to test this theory: (try one or more of these debugging techniques)
  • Set a time marker that corresponds to a point a few milliseconds before the end of the video. Does the end event fire BEFORE the marker is reached? If so, then the audio/video feeds are out of sync and the video is not reporting its position correctly.
  • Set a time marker somewhere in the middle of the video, when the marker fires, then use htmlVideoControl() to move the video to the last frame and pause it. You will have to call the function twice to do this. Once to move the playhead and a second time to pause the video. This technique may be a little stubborn unless the video stream has been fully cached first.
  • Try allowFlashFallback = true so the Flash can play the video. If the video ends properly, then it is very likely the video is having trouble with the decoder used when it is played as pure HTML 5.
  • Try and re-encode the video using a different frame rate or audio data rate. Does this affect the playback and how the end event is fired?
If it seems the audio/video streams are out of sync:
  • Try adding a few empty frames to the end of the video and re-encode. This may at least make the situation workable.
  • Try using a different encoding package to re-encode the video.
  • Convert the video to avi or ogv format, then back to mp4. This sometimes cleans things up too.
  • Try changing the encoding to h263 for these videos.
NOTE: Not all video streams are created equal. Some videos play more smoothly than others and report their position better. I've seen short videos (less than 30 seconds) report their positions to the browser in jerky increments. In these cases, it helps to increase the frame rate. Frame rates less than 15 may just not work very well.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: htmlVideoLoader() and NotifyObject

Postby Clifton » Mon Aug 25, 2014 7:43 pm

Hi Kate,

I found this nice tutorial on how to resynchronize audio/video rates in mp4 files. While it discusses converting out of sync flv files to an mp4 container, you can use the same method to input and output mp4 into the same container format. There will be no loss of quality in the resynchronization process.

http://youtu.be/2gsBImLVHHs

I intend to use this the next time I encounter this problem. It seems a lot easier than any other method that I have used. In the process, I found that this problem is far more common than I originally thought.

I think this is a perfect solution for you to try.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: htmlVideoLoader() and NotifyObject

Postby Kataleena » Wed Sep 10, 2014 1:47 am

Hi Clifton,

I found the problem was the streaming server link I was using from the CDN company that hosts my videos. I’m using there standard HTML link now and its working fine. I will however check out the tutorial as its all useful information and might allow me to use the streaming server link again. Thanks

Cheers,
Kate
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm


Return to Function Help

Who is online

Users browsing this forum: No registered users and 4 guests

cron