Search Results

Search found 1354 results on 55 pages for 'duration'.

Page 1/55 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

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

    - by Cummander Checkov
    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 [mp3 @ 0x102052600] Estimating duration from bitrate, this may be inaccurate After a nice, warm google session, i found some posts on this, but no solution was found. I then tried to increase the maximum duration: ffmpeg -analyzeduration 999999999 -i song_9747c077aef8.mp3 After this, ffmpeg returned only the second line: [mp3 @ 0x102052600] Estimating duration from bitrate, this may be inaccurate But in either case, the calculated duration was just plain wrong. Comparing it to VLC i noticed that here the duration is correct. After more research i stumbled over mp3info - which i installed and used. mp3info -p "%S" song_9747c077aef8.mp3 mp3info then returned the CORRECT duration, but only as an integer, which i cannot use as i need a more accurate number here. The reason for this was explained in a comment below, by user blahdiblah - mp3info is simply pulling ID3 info from the file and not actually performing any calculations. I also tried using mplayer to retrieve the duration, but just as ffmpeg, mplayer is returning the wrong value. Now i ran out of options. If somebody knows how to get around this, any hints, tips, guides or corrections are welcome! Thank You!

    Read the article

  • Secret of SQL Trace Duration Column

    - by Dan Guzman
    Why would a trace of long-running queries not show all queries that exceeded the specified duration filter?  We have a server-side SQL Trace that includes RPC:Completed and SQL:BatchCompleted events with a filter on Duration >= 100000.  Nearly all of the queries on this busy OLTP server run in under this 100 millisecond threshold so any that appear in the trace are candidates for root cause analysis and/or performance tuning opportunities. After an application experienced query timeouts, the DBA looked at the trace data to corroborate the problem.  Surprisingly, he found no long-running queries in the trace from the application that experienced the timeouts even though the application’s error log clearly showed detail of the problem (query text, duration, start time, etc.).  The trace did show, however, that there were hundreds of other long-running queries from different applications during the problem timeframe.  We later determined those queries were blocked by a large UPDATE query against a critical table that was inadvertently run during this busy period. So why didn’t the trace include all of the long-running queries?  The reason is because the SQL Trace event duration doesn’t include the time a request was queued while awaiting a worker thread.  Remember that the server was under considerable stress at the time due to the severe blocking episode.  Most of the worker threads were in use by blocked queries and new requests were queued awaiting a worker to free up (a DMV query on the DAC connection will show this queuing: “SELECT scheduler_id, work_queue_count FROM sys.dm_os_schedulers;”).  Technically, those queued requests had not started.  As worker threads became available, queries were dequeued and completed quickly.  These weren’t included in the trace because the duration was under the 100ms duration filter.  The duration reflected the time it took to actually run the query but didn’t include the time queued waiting for a worker thread. The important point here is that duration is not end-to-end response time.  Duration of RPC:Completed and SQL:BatchCompleted events doesn’t include time before a worker thread is assigned nor does it include the time required to return the last result buffer to the client.  In other words, duration only includes time after the worker thread is assigned until the last buffer is filled.  But be aware that duration does include the time need to return intermediate result set buffers back to the client, which is a factor when large query results are returned.  Clients that are slow in consuming results sets can increase the duration value reported by the trace “completed” events.

    Read the article

  • Opsview Notifications, how to report event duration

    - by dotwaffle
    At present, Opsview reports recoveries in the following format: RECOVERY: Internal Alarm is OK on host Ellie: SNMP OK - 0 Service: Internal Alarm Host: Ellie Alias: Ellie Address: 1.2.3.4 State: OK Comment: () Date/Time: Mon Oct 5 14:57:53 BST 2009 Additional Info: SNMP OK - 0 What I would ideally like to do is add a "duration" field, so that you can tell without scrolling back on a Blackberry how long the event has been at fault for. Is there an easy solution to this?

    Read the article

  • using Applescript to retrieve movie file duration via Finder properties

    - by Matt
    When using Get Info on movie files in the Finder, I've noticed that many movie files have an accessible "Duration" property under the More Info tab. Is there an easy way to access this data using Applescript? I've tried lines like "set theTime to (duration of aFile)", but it doesn't seem to be as simple as that. Ideally I'd like to access the movie duration via the Finder properties without having to actually open the file in QuickTime. Is this possible? Edit: I seem to have figured this out... you need to use the "System Events" application, specifically the Movie File Suite of commands (and, importantly, you need to set the movie variable as a string, rather than an alias): set theMovie to (choose file with prompt "Select a movie file:") as string tell application "System Events" set theName to name of movie file theMovie set theDuration to (duration of contents of movie file theMovie) / (time scale of contents of movie file theMovie) end tell

    Read the article

  • Perl: how to pretty-print time duration

    - by sds
    How do I pretty print time duration in perl? The only thing I could come up with so far is my $interval = 1351521657387 - 1351515910623; # milliseconds my $duration = DateTime::Duration->new( seconds => POSIX::floor($interval/1000) , nanoseconds => 1000000 * ($interval % 1000), ); my $df = DateTime::Format::Duration->new( pattern => '%Y years, %m months, %e days, ' . '%H hours, %M minutes, %S seconds, %N nanoseconds', normalize => 1, ); print $df->format_duration($duration); which results in 0 years, 00 months, 0 days, 01 hours, 35 minutes, 46 seconds, 764000000 nanoseconds This is no good for me for the following reasons: I don't want to see "0 years" (space waste) &c and I don't want to remove "%Y years" from the pattern (what if I do need years next time?) I know in advance that my precision is only milliseconds, I don't want to see the 6 zeros in the nanoseconds part. I care about prettiness/compactness/human readability much more than about precision/machine readability. I.e., I want to see something like "1.2 years" or "3.22 months" or "7.88 days" or "5.7 hours" or "75.5 minutes" (or "1.26 hours, whatever looks better to you) or "24.7 seconds" or "133.7 milliseconds" &c (similar to how R prints difftime)

    Read the article

  • Actual note duration from MIDI duration

    - by Anthony Labarre
    I'm currently implementing an application to perform some tasks on MIDI files, and my current problem is to output the notes I've read to a LilyPond file. I've merged note_on and note_off events to single notes object with absolute start and absolute duration, but I don't really see how to convert that duration to actual music notation. I've guessed that a duration of 376 is a quarter note in the file I'm reading because I know the song, and obviously 188 is an eighth note, but this certainly does not generalise to all MIDI files. Any ideas?

    Read the article

  • How use asp.net get video duration

    - by mhmt
    using Microsoft.DirectX.AudioVideoPlayback; Video vvideo = new Video(FileUpload.FileName.ToString()); StringBuilder sb = new StringBuilder(); sb.Append(duration.toString()); error message; “Installed an access attempt was made to the application domain.” “vvideo” instance is created error msj :// But down found cods I found a working code in c #. but asp.net does not work string file1 = "c://ds.mpeg" IMediaPosition m_objMediaPosition = null; FilgraphManager m_objFilterGraph = new FilgraphManager(); m_objFilterGraph.RenderFile(filename); m_objMediaPosition = m_objFilterGraph as IMediaPosition; int s = (int)m_objMediaPosition.Duration; int h = s / 3600; int m = (s - (h * 3600)) / 60; s = s - (h * 3600 + m * 60); I DON'T TAKE VIDEO DURATION BOYS :/

    Read the article

  • How to map Duration type with JPA

    - by HDave
    I have a property field in a class that is of type javax.xml.datatype.Duration. It basically represents a time span (e.g. 4 hours and 34 minutes). JPA is telling me it is an invalid type, which doesn't shock me. Whats a good solution this? I could implement my own Duration class, but I don't know how to get JPA to "accept" it as a datatype.

    Read the article

  • php date list for specified duration

    - by user301584
    hi is there any php classes or functions, which will gives us all the days from specific duration? for example, if i want a list of dates from 25/03/2010 (25th march 2010) to 15/05/2010 (15th May 2010), it will give me: 25/03/2010 26/03/2010 26/03/2010 .... .... .... 14/05/2010 15/05/2010 thanks a lot for any help!

    Read the article

  • JFormattedTextField : input time duration value

    - by bguiz
    I want to use a JFormattedTextField to allow the user to input time duration values into a form. Sample valid values are: 2h 30m 72h 15m 6h 0h However I am having limited success with this. Can some one please suggest how this can be accomplished? I am OK if this result can be achieved using a JTextField as well. Thanks! If it is worth anything, here's my current attempt: mFormattedText.setFormatterFactory( new DefaultFormatterFactory( new DateFormatter( new SimpleDateFormat("H mm")))); This sorta works except that: I cannot get h and m to appear as plain text (I tried escaping) * The number of hours has a max *: See @nanda's answer

    Read the article

  • Relation between HTTP Keep Alive duration and TCP timeout duration

    - by Suresh Kumar
    I am trying to understand the relation between TCP/IP and HTTP timeout values. Are these two timeout values different or same? Most Web servers allow users to set the HTTP Keep Alive timeout value through some configuration. How is this value used by the Web servers? is this value just set on the underlying TCP/IP socket i.e is the HTTP Keep Alive timeout and TCP/IP Keep Alive Timeout same? or are they treated differently? My understanding is (maybe incorrect): The Web server uses the default timeout on the underlying TCP socket (i.e. indefinite) regardless of the configured HTTP Keep Alive timeout and creates a Worker thread that counts down the specified HTTP timeout interval. When the Worker thread hits zero, it closes the connection. EDIT: My question is about the relation or difference between the two timeout durations i.e. what will happen when HTTP keep-alive timeout duration and the timeout on the Socket (SO_TIMEOUT) which the Web server uses is different? should I even worry about these two being same or not?

    Read the article

  • android get duration from maps.google.com directions

    - by urobo
    At the moment I am using this code to inquire google maps for directions from an address to another one, then I simply draw it on a mapview from its GeometryCollection. But yet this isn't enough I need also to extract the total expected duration from the kml. can someone give a little sample code to help me? thanks StringBuilder urlString = new StringBuilder(); urlString.append("http://maps.google.com/maps?f=d&hl=en"); urlString.append("&saddr=");//from urlString.append( Double.toString((double)src.getLatitudeE6()/1.0E6 )); urlString.append(","); urlString.append( Double.toString((double)src.getLongitudeE6()/1.0E6 )); urlString.append("&daddr=");//to urlString.append( Double.toString((double)dest.getLatitudeE6()/1.0E6 )); urlString.append(","); urlString.append( Double.toString((double)dest.getLongitudeE6()/1.0E6 )); urlString.append("&ie=UTF8&0&om=0&output=kml"); //Log.d("xxx","URL="+urlString.toString()); // get the kml (XML) doc. And parse it to get the coordinates(direction route). Document doc = null; HttpURLConnection urlConnection= null; URL url = null; try { url = new URL(urlString.toString()); urlConnection=(HttpURLConnection)url.openConnection(); urlConnection.setRequestMethod("GET"); urlConnection.setDoOutput(true); urlConnection.setDoInput(true); urlConnection.connect(); dbf = DocumentBuilderFactory.newInstance(); db = dbf.newDocumentBuilder(); doc = db.parse(urlConnection.getInputStream()); if(doc.getElementsByTagName("GeometryCollection").getLength()>0) { //String path = doc.getElementsByTagName("GeometryCollection").item(0).getFirstChild().getFirstChild().getNodeName(); String path = doc.getElementsByTagName("GeometryCollection").item(0).getFirstChild().getFirstChild().getFirstChild().getNodeValue() ; //Log.d("xxx","path="+ path); String[] pairs = path.split(" "); String[] lngLat = pairs[0].split(","); // lngLat[0]=longitude lngLat[1]=latitude lngLat[2]=height // src GeoPoint startGP = new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6)); mMapView01.getOverlays().add(new MyOverLay(startGP,startGP,1)); GeoPoint gp1; GeoPoint gp2 = startGP; for(int i=1;i<pairs.length;i++) // the last one would be crash { lngLat = pairs[i].split(","); gp1 = gp2; // watch out! For GeoPoint, first:latitude, second:longitude gp2 = new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6)); mMapView01.getOverlays().add(new MyOverLay(gp1,gp2,2,color)); //Log.d("xxx","pair:" + pairs[i]); } mMapView01.getOverlays().add(new MyOverLay(dest,dest, 3)); // use the default color } }catch (MalformedURLException e){ e.printStackTrace(); }catch (IOException e){ e.printStackTrace(); }catch (SAXException e){ e.printStackTrace(); } catch (ParserConfigurationException e) { e.printStackTrace(); } }

    Read the article

  • Problem retrieving HTML5 video duration

    - by drebabels
    UPDATE: Ok so although I haven't solved this problem exactly, but I did figure out a work around that handles my biggest concern... the user experience. First the video doesn't begin loading until after the viewer hits the play button, so I am assuming that the duration information wasn't available to be pulled (I don't know how to fix this particular issue... although I assume that it would involve just loading the video metadata separately from the video, but I don't even know if that is possible). So to get around the fact that there is no duration data, I decided to hide the duration info (and actually the entire control) completely until you hit play. I know... its cheating. But for now it makes me happy :) That said... if anyone knows how to load the video metadata separately from the video file... please share. I think that should completely solve this problem. I am working on building a HTML5 video player with a custom interface, but I am having some problems getting the video duration information to display. My HTML is real simple (see below) <video id="video" poster="image.jpg" controls> <source src="video_path.mp4" type="video/mp4" /> <source src="video_path.ogv" type="video/ogg" /> </video> <ul class="controls"> <li class="time"><p><span id="timer">0</span> of <span id="duration">0</span></p></li> </ul> And the javascript I am using to get and insert the duration is var duration = $('#duration').get(0); var vid_duration = Math.round(video.duration); duration.firstChild.nodeValue = vid_duration; The problem is nothing happens. I know the video file has the duration data because if I just use the default controls, it displays fine. But the real strange thing is if I put alert(duration) in my code like so alert(duration); var vid_duration = Math.round(video.duration); duration.firstChild.nodeValue = vid_duration; then is works fine (minus the annoying alert that pops up). Any ideas what is happening here or how I can fix it?

    Read the article

  • What is the best way to get an audio file duration in Android?

    - by Gilead
    Hi! I'm using a SoundPool [ 1 ] to play audio clips in my app. All is fine but I need to know when the clip playback has finished. At the moment I track it in my app by obtaining the duration of each clip using a MediaPlayer [ 2 ] instance. That works fine but it looks wasteful to load each file twice, just to get the duration. I could roughly calculate the duration myself knowing the length of the file (available from the AssetFileDescriptor [ 3 ]) but I'd still need to know the sample rate and the number of channels. I see two potential solutions to that problem: Figuring out when a clip has finished playing (doesn't seem to be possible with SoundClip). Having a class which could load just the header of an audio file and give me the sample rate/number of channels (and, ideally, the sample count to get the exact duration). Any suggestions? Thanks, Max The code I'm using at the moment (works fine but is rather heavy for the purpose): String[] fileNames = ... MediaPlayer mp = new MediaPlayer(); for (String fileName : fileNames) { AssetFileDescriptor d = context.getAssets().openFd(fileName); mp.reset(); mp.setDataSource(d.getFileDescriptor(), d.getStartOffset(), d.getLength()); mp.prepare(); int duration = mp.getDuration(); // ... } On a side note, this question has already been asked [ 4 ] but got no answers.

    Read the article

  • How to play the sound of an object sliding on another object for a variable duration

    - by Antoine
    I would like to add sound effects to a basic 2D game. For example, a stone sphere is rolling on wood surface. Let's say I have a 2 second audio recording of this. How could I use the sample to add sound for an arbitrary duration ? So far I have two solutions in mind: a/ record the sound for an amount of time that is greater than the maximum expected duration, and play only a part of it; b/ extract a small portion of the sample and play it in a loop for the duration of the move; however I'm not sure if it makes sense with an audio wave.

    Read the article

  • Perl module for parsing natural language time duration specifications (similar to the "at" command)?

    - by Ryan Thompson
    I'm writing a perl script that takes a "duration" option, and I'd like to be able to specify this duration in a fairly flexible manner, as opposed to only taking a single unit (e.g. number of seconds). The UNIX at command implements this kind of behavior, by allowing specifications such as "now + 3 hours + 2 days". For my program, the "now" part is implied, so I just want to parse the stuff after the plus sign. (Note: the at command also parses exact date specifications, but I only want to parse durations.) Is there a perl module for parsing duration specifications like this? I don't need the exact syntax accepted by at, just any reasonable syntax for specifying time durations. Edit: Basically, I want something like DateTime::Format::Flexible for durations instead of dates.

    Read the article

  • taglib# returns wrong duration

    - by J. Pablo Fernández
    I'm getting the duration of an MP3 file in this way: TagLib.File file = TagLib.File.Create(fileName); var duration = file.Properties.Duration; and it is consistently giving me a duration between 68 and 75% of the real duration. Windows File Manager, VLC and just playing the MP3 and measuring with a stopwatch agree on the other duration. Any ideas what's wrong here?

    Read the article

  • Avg. Visit Duration 00:00:00 conclusion

    - by user1592845
    What can I predict when I see in Google Analytics that total visits by search for some day are 93 visits while 70 visits of them have the value 00:00:00 for Avg. Visit Duration? Did those visits made by robots? or How could they regarded as visits while they don't spend any time on the website? Or this is dysfunction of the Google's Analytics script by which it does not able to count the visit time?

    Read the article

  • Time/duration handling in strategic game

    - by borg
    I'm considering developing a space opera game, having already done some game design. Technically, though, I'm coming from a business applications background. Hence I don't really know how I should handle time and duration. Let's state the matter clearly: what if something is bound to happen in 5 hours and on which other events depend. For example the arrival of some space ship in some system where some defense systems are present, hence a fight would start. Should I use some kind of scheduler (like Quartz in my java land) to trigger the corresponding event when due (I plan to use events for communication)? Something else?

    Read the article

  • How can i use a duration setting on .animate if it is inside the callback from a .fadeOut effect?

    - by Jannis
    I am trying to just fade the content of section#secondary out and once the content has been faded out, the parent (section#secondary) should animate 'shut' in a slider animation. All this is working however the durations are not and I cannot figure out why. Here is my code: HTML <section id="secondary"> <a href="#" class="slide_button">&laquo;</a> <!-- slide in/back button --> <article> <h1>photos</h1> <div class="album_nav"><a href="#">photo 1 of 6</a> | <a href="#">create an album</a></div> <div class="bar"> <p class="section_title">current image title</p> </div> <section class="image"> <div class="links"> <a class="_back album_link" href="#">« from the album: james new toy</a> <nav> <a href="#" class="_back small_button">back</a> <a href="#" class="_next small_button">next</a> </nav> </div> <img src="http://localhost/~jannis/3781_doggie_wonderland/www/preview/static/images/sample-image-enlarged.jpg" width="418" height="280" alt="" /> </section> </article> <footer> <embed src="http://localhost/~jannis/3781_doggie_wonderland/www/preview/static/flash/secondary-footer.swf" wmode="transparent" width="495" height="115" type="application/x-shockwave-flash" /> </footer> </section> <!-- close secondary --> jQuery // ============================= // = Close button (slide away) = // ============================= $('a.slide_button').click(function() { $(this).closest('section#secondary').children('*').fadeOut('slow', function() { $('section#secondary').animate({'width':'0'}, 3000); }); }); Because the content of section#secondary is variable I use the * selector. What happens is that the fadeOut uses the appropriate slow speed but as soon as the callback fires (once the content is faded out) the section#secondary animates to width: 0 within a couple of milliseconds and not the 3000 ms ( 3 sec ) I set the animation duration to. Any ideas would be appreciated. PS: I cannot post an example at this point but since this is more a matter of theory of jQuery I don't think an example is necessary here. Correct me if I am wrong..

    Read the article

  • Showing Egde Shaped Event Duration in StreamInsight using Debugger

    Whilst writing some courseware I wanted to be able to see the start and end times of Edge shaped events from within the debugger.  A quick recap on Edge events At the start of the event you do not know the end time and most probably cannot work it out or you should be using one of the other shapes. You enqueue an event (Start Edge) with the start time and payload of the event.  The end time of the event is set to infinity When you see the end edge come through, you enqueue another event (End Edge) with the previous start time and payload and restate the event’s end time.  This is the Retract Event All seems simple enough.  The problem is the debugger is a little shy about showing you what you need but you can get it to show you everything by also reading this article Here’s what I mean. Here is what the Event Debugger looks like by default when viewing 2 complete edge events.  Notice how all the end times are set to infinity   The above does not tell you for how long an event was valid.  I then add the “NewEndTime” column to the debugger output and there I can now see the duration of events.  You will see the Retract events (End Edge) have the same start time and payload as their respective start events (Start Edge)   You can follow the exact same logic when looking at Interval shape events.  They look a little different on the output adapter but using this article you can easily see what is happening.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >