Set new startTime and endTime on videojs - pdk

My problem is that I'm trying to reposition the start time and end time on the seek bar. My use case is this: i'm watching the video with a progress bar that go from 0 to 300 sec (e.g.). When i arrive at 200 sec, i want to set start time at 200 sec so the marker go to new 0 (old 200) and the stream continues. I'm using the last version of videojs and my code is not necessary because is almost native.

Related

Mac control center "now playing" info not showing duration over 1h

For a Mac app I'm trying to use the MPNowPlayingInfoCenter with playback controls and track info.
I'm using the MPMediaItemPropertyPlaybackDuration property to set the track duration, with the number of seconds as NSNumber wrapped value.
Tracks over 1 hour do not show the full duration and roll over at 59:59.
Is there any way to make items in the control center show their full duration & elapsed time?
Notes:
The image shows Control center information for a track with a duration of 1:52:33 and current play position is 1:00:05.
The seek bar works correctly.
That looks like a macOS bug since media played using QuickTime Player also exhibits the same erroneous behavior. Please file a macOS feedback report!

Set start time AVUrlAsset using CMTime for Xamarin

I am trying to merge an audio in video but this custom audio does not necessarily from the beginning. The user listens for a music and then if the user feels like want to start the video recording, the user will tap on a button that starts the video recording while the music is playing.
So the user could start after 20 or 32 seconds after the audio started.
I have no problem in merging, but my problem is understanding how to set the CMTimeRange.Start using CMTime for my audio background.
The Start time value is a .NET's TimeSpan, now for example the user started after 32 seconds
var startTime = new TimeSpan(0,0,32);
or the user started after 53 seconds and then starts the video recording.
how do you translate this to CMTime?
First, we get the seconds From TimeSpan by using
TimeSpan span;
double time = span.TotalSeconds
Then ,we have to understand CMTime and how to translate float values to it.
Here you can refer to .
CMTime has a value and a timescale field, and time = value/timescale .

Delay lines of subtitles by 0.04 seconds more than the line before

I used aegisub to synchronize the subtitles of a 1 hour video.
It looks perfect inside aegisub, but when I open the file.ass with another player there is a gradual delay...
It is up to 23 seconds at the end of the video!
I did the math and each lines are ~0.04 sec delayed. (The first 0.04, the second 0.08, etc...)
Is there a way to automatically change the timing using what I know ?
Not sure if aegis can fix this, but I fixed it with Gaupol : Tool, Transform position and i subtracted the delay on the last line.

measure elapsed time of image loading in Corona SDK

I'm trying to benchmark the loading of large images in Corona SDK.
local startTime = system.getTimer()
local myImage = display.newImageRect( "someImage.jpg", 1024, 768 )
local endTime = system.getTimer()
print( endTime - startTime ) -- prints 8.4319999999998
This returns values of around 8 ms. I know it takes longer to load an display an image because if it really took 8 ms I wouldn't notice the delay, but I do notice it. I'd say it takes about 300 ms.
Also the FPS drop drastically when loading a large image. I'm monitoring this using an enterFrame event and when loading the image it prints values of around 0.3 for 1 frame.
Runtime:addEventListener( "enterFrame", myListener )
function onEnterFrame (event)
print( display.fps )
end
The frame takes a long time to render when loading, even when the loading of the image takes less than 1/60 of a second. I guess it means the rendering is happening asynchronously somewhere else.
So, how can I measure the time it takes to really load and display an image?
Since Corona SDK is closed source, we'll have to use the docs and imagination.
I see three possibilities here:
Corona is doing what it says, and your subjective experience is wrong.
Corona is loading the images in a background thread, so the call to display.newImageRect is non-blocking: it "starts" loading the image, and then continues. When this happens in other SDKs (mostly javascript-based ones) you get a "ready callback" that you can use on the image object, but I could not find such thing in the docs.
Corona loads the image quickly, but requires "extra work afterwards". For example, it generates lots of garbage which has to be garbage-collected. So the image gets loaded fast, but then this "extra work" slows down the app.
My bet is on 3. But this doesn't really matter. Independently of which one of these options is causing the slowdowns, they can be solved the same way: instead of loading the images right before you draw them, you have to preload them.
I don't use Corona SDK, but a quick google pointed me to the storyboard module, in particular to storyboard.loadScene.
Create a new scene, list all the images that you need on it, and load it before showing it - that way image loading will be done in advance, not slowing down your app.
Most likely the image is rendered during the scene's rendering loop. There is no event to indicate that an image has been rendered. However if you create the display object in the scene's create event handler or a button click handler, and register an enterFrame event handler, you can measure the time between that and the first frame event. I can't try this here but my guess is this will give you an estimate of the time to render the image. Dont use FPS. Larger image will probably give you a larger measurement. If you measure the time between enterFrame events you will probably find that it is much smaller than the time between create/click event and the first frame event, or between the first two frame events after the create/click event. Post a comment if you would like to see some example code.

How to get time in mm:ss format in App Inventor

I am making an app for myself in app inventor which calculates time. There are two buttons (start, stop) and a label to display the time.
Now my problem is that I get the resultant time which is (stop time - start time) in milliseconds but I want it in MM:SS format. I tried certain clock buttons like get instant from milliseconds and time format too, but still failed to resolve the issue.
see the screenshot how to do it
for a complete example of a countdown timer see here

Resources