duration

How to get Duration of audio and video files in Qt without using QMediaPlayer

别等时光非礼了梦想. 提交于 2019-12-23 19:23:17
问题 I have been working on an application where I can traverse the system drives using QDirIterator and look for audio/video files, grab the details using QStandardItemModel and display it on QTreeview. I have been successful in displaying file name, type, size, date-modified but DURATION is something which I am not able to do. Here is the code: // Displays Files in Detail View on Clicking Drive void DetailView::on_DriveView_clicked(const QModelIndex &index) { int m_count_row = 0;

php addition of multiple durations to get total duration

*爱你&永不变心* 提交于 2019-12-23 15:48:09
问题 start time and end time in a database table using php and I am calculating the difference between the start time and end time to get the total duration total of a task. I am using the following method: foreach ($task->timers as $time ) { $start_date = new DateTime($time->date.' '.$time->start_time); $end_date = new DateTime($time->date.' '.$time->end_time); $times[] = date_diff($end_date, $start_date); } I then loop through the array above as follows; foreach ($times as $timer) { $minutes =

User-defined overloaded operator * with std::chrono::duration

£可爱£侵袭症+ 提交于 2019-12-23 15:14:21
问题 I've created a Frequency class template intended to work in conjunction with std::chrono::duration. A Frequency object stores a number of cycles per unit duration (both using template parameters for their types). The idea is that multiplying a Frequency by a duration produces an object of type Rep. Here's the class definition. I've omitted all but the relevant members. #include <ratio> #include <chrono> using namespace std::chrono; template <typename Rep, typename Period = std::ratio<1>>

Spring boot 2 Converting Duration java 8 application.properties

自闭症网瘾萝莉.ら 提交于 2019-12-23 10:53:18
问题 I need to define Duration value (spring.redis.timeout) by application.properties. I was trying to use one point defined in Spring boot documentation : Spring Boot has dedicated support for expressing durations . If you expose a java.time.Duration property, the following formats in application properties are available: A regular long representation (using milliseconds as the default unit unless a @DurationUnit has been specified) The standard ISO-8601 format used by java.util.Duration A more

Qt seconds to DD HH SS

拜拜、爱过 提交于 2019-12-22 20:00:11
问题 using Qt 4.8 how can I print the time in the format DD HH SS? I have the seconds and I want to get back a string in that format. 回答1: QDateTime::fromTime_t(seconds).toString("ss hh DD"); see http://qt-project.org/doc/qt-5.0/qdatetime.html#toString If you want a duration ( your question was really unclear) try something like : QString seconds_to_DHMS(quint32 duration) { QString res; int seconds = (int) (duration % 60); duration /= 60; int minutes = (int) (duration % 60); duration /= 60; int

Given a URL to a movie, how can retrieve it's info?

假如想象 提交于 2019-12-22 17:47:13
问题 Under iOS, I need to get the codec used to make the move (H.264, MJPEG and so on), the movies' width and height, the file size, and the number of frames in the movie. I tried using AVAsset for the movie duration and such but the duration was always zero. Same for the width/height. I also tried using a movie player controller but that did not work either (see code below). The docs are a bit confusing and with multiple ways of getting to the same place you can't seem to get to the same spot.

Time span calculation for hours and minutes in C#

拜拜、爱过 提交于 2019-12-22 10:53:09
问题 The final result should display the user the time span between the start hour and the end hour.(e.g. start work at 06:30 AM and finished at 18:30 PM, the result to display should be 12 hours). Now, I have to DateTime parameters; fromTime and toTime Each DateTime parameter have an hour in 24 hour format, and also might have a minutes value of 30 min. What I willing to do is to get the time span between those DateTime parameters. For the hours I used this method: Public TimeSpan GetHourSpan

How do you calculate an end time based on start time and duration?

妖精的绣舞 提交于 2019-12-22 10:35:15
问题 I'm building a event calendar and pass a start time to PHP, in the format of 2009-09-25 15:00:00. A duration gets passed as well, that might be in the format of 60 minutes or 3 hours. Converting from hours to minutes isn't the problem. How do you add a length of time to an established starting point to correctly format the end time? 回答1: Using strtotime() you can convert the current time (2009-09-25 15:00:00) to a timestamp and then add (60 * 60 * 3 = 3hrs) to the timestamp. Finally just

How to get video duration in seconds? [duplicate]

ε祈祈猫儿з 提交于 2019-12-21 02:26:08
问题 This question already has answers here : How to extract duration time from ffmpeg output? (13 answers) Closed 3 years ago . How can I get video duration in seconds? what I've tried: ffmpeg -i file.flv 2>&1 | grep "Duration" Duration: 00:39:43.08, start: 0.040000, bitrate: 386 kb/s mediainfo file.flv | grep Duration Duration : 39mn 43s this what close, but it's not so accurate, 2383 is 39.71 minutes ffmpeg -i file.flv 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,// | sed 's@\..*@@g' | awk

How to get the real, actual duration of an MP3 file (VBR or CBR) server-side

那年仲夏 提交于 2019-12-20 12:06:18
问题 I used to calculate the duration of MP3 files server-side using ffmpeg - which seemed to work fine. Today i discovered that some of the calculations were wrong. Somehow, for some reason, ffmpeg will miscalculate the duration and it seems to happen with variable bit rate mp3 files only. When testing this locally, i noticed that ffmpeg printed two extra lines in green. Command used: ffmpeg -i song_9747c077aef8.mp3 ffmpeg says: [mp3 @ 0x102052600] max_analyze_duration 5000000 reached at 5015510