duration

How to get video duration from mp4, wmv, flv, mov videos

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 08:19:11
Alright. Actually i need mostly the mp4 format. But if it is possible to get for other types as well that would be nice. I just need to read the duration of the file. How can i do that with C# 4.0 ? So the thing i need is like this video is like : 13 minutes 12 seconds I can use 3 third party exes too. Like they save the information about the file to a text file. I can parse that text file. Thank you. Roman R. You can use DirectShow API MediaDet object, through DirectShow.NET wrapper library. See Getting length of video for code sample, get_StreamLength gets you the duration in seconds. This

What is the duration of a Toast LENGTH_LONG and LENGTH_SHORT

▼魔方 西西 提交于 2019-11-27 08:10:11
I need the exact duration of LENGTH_LONG and LENGTH_SHORT in milliseconds (ms). Also I need to know if the duration of Toast message with LENGTH_LONG will have the same duration in any phone and with any API version. Does someone know where is the duration defined ?, I mean defined in ms . I know that LENGTH_LONG is some int const with value 1. But I could not find where is the actual duration defined. Lars Answered here . Like you mentioned Toast.LENGTH_SHORT and Toast.LENGTH_LONG are not in ms but 0 or 1. The actual durations are: private static final int LONG_DELAY = 3500; // 3.5 seconds

Find weekly periods (starting on a Monday) for a month

旧城冷巷雨未停 提交于 2019-11-27 03:00:33
问题 I'm trying to find the weekly periods for a given month and year. Dates should start on a Monday and end on a Sunday. If the 1st of the month is a Sunday (Ex May 2011), it should be the first element. May 2011 May 1 (Sunday) May 2 - May 8 (Monday - Sunday) May 9 - May 15 (Monday - Sunday) May 17 - Ma6y 22 (Monday - Sunday) May 23 - May 29 (Monday - Sunday) May 30 - May 31 (Monday - Tuesday) September 2012 September 1 - September 2 September 3 - September 9 September 10 - September 16

Formatting a Duration in Java 8 / jsr310

↘锁芯ラ 提交于 2019-11-27 02:03:27
I am transitioning a project from Joda-Time to java8's native time libraries, and I have run into a snag. I have been unable to find a formatter for Duration. I would like to have a custom String format of, for instance, HHH+MM , where a Duration of 75 hours and 15 minutes would format as "75+15" . This was easy to do with Joda-Time by converting to period, and using a PeriodFormatter, but I have been unable to find this type of class in Java8. Am I missing something? There is no period/duration-formatter in jsr-310, different from JodaTime. Not every feature of JodaTime was ported to JSR-310

MySQL storing duration time - datatype?

a 夏天 提交于 2019-11-27 01:46:52
问题 I need to calculate the time a user spends on site. It is difference between logout time and login time to give me something like "Mr X spent 4 hours and 43 minutes online". So to store the4 hours and 43 minutes i declared it like this: duration time NOT NULL Is this valid or a better way to store this? I need to store in the DB because I have other calculations I need to use this for + other use cases. 回答1: Storing it as an integer number of seconds will be the best way to go. The UPDATE

current/duration time of html5 video?

风格不统一 提交于 2019-11-27 00:56:11
I need a way of getting the total time length of the video and the current time with jquery and displaying it in a couple of <div> tags. <div id="current">0:00</div> <div id="duration">0:00</div> I've been searching all day and I know how to get them I just can't display them. #jquerynoob Thomas Bratt HTML: <video id="video-active" class="video-active" width="640" height="390" controls="controls"> <source src="myvideo.mp4" type="video/mp4"> </video> <div id="current">0:00</div> <div id="duration">0:00</div> JavaScript: $(document).ready(function(){ $("#video-active").on( "timeupdate", function

How to get the precision of high_resolution_clock?

為{幸葍}努か 提交于 2019-11-26 23:01:06
问题 C++11 defines high_resolution_clock and it has the member types period and rep . But I can not figure out how I can get the precision of that clock. Or, if I may not get to the precision, can I somehow at least get a count in nanoseconds of the minimum representable time duration between ticks? probably using period ? #include <iostream> #include <chrono> void printPrec() { std::chrono::high_resolution_clock::rep x = 1; // this is not the correct way to initialize 'period': //high_resolution

Is there a name for date/time interval format like “1h10m”

匆匆过客 提交于 2019-11-26 21:57:29
问题 It's commonplace even outside of software to communicate time or date intervals in a truncated manner. For example: 1h10m translates to "One hour and ten minutes." This could be abstracted to a set of rules. For instance: A date interval is represented as a combination of _h , _m , (and so on), where _ characters represent non-negative integers or floats, which are summed into one date interval object. Mixing days, hours, minutes are allowed. For example, 0.5d1h60m would be a synonym for 14h

Measuring elapsed time in python

无人久伴 提交于 2019-11-26 19:08:10
问题 Is there a simple way / module to correctly measure the elapsed time in python? I know that I can simply call time.time() twice and take the difference, but that will yield wrong results if the system time is changed. Granted, that doesn't happen very often, but it does indicate that I'm measuring the wrong thing. Using time.time() to measure durations is incredibly roundabout when you think about it. You take the difference of two absolute time measurements which are in turn constructed from

PHP: add seconds to a date

可紊 提交于 2019-11-26 18:34:26
问题 I have $adate; which contains: Tue Jan 4 07:59:59 2011 I want to add to this date the following: $duration=674165; // in seconds Once the seconds are added I need the result back into date format. I don't know what I'm doing, but I am getting odd results. Note: both variables are dynamic. Now they are equal to the values given, but next query they will have different values. 回答1: If you are using php 5.3+ you can use a new way to do it. <?php $date = new DateTime(); echo $date->getTimestamp()