473,809 Members | 2,695 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

detect video length in seconds

Is there a way to get the length of a video clip (divix/xvid) in
seconds?
oh this is on linux. I first tryed to see if mplayer would tell me then
I could wrap the call in a popen object and be done but it does not
appear to output the length.
Now I am looking at pymedia .It would be nice if there was some actual
docmentation for it.

May 3 '06 #1
1 3659
"ga*******@gmai l.com" <ga*******@gmai l.com> wrote:

Is there a way to get the length of a video clip (divix/xvid) in
seconds?


This is non-trivial. MPEG files do not have an index, so the only way to
figure this out is to scan from the front of the file until you find a
timestamp, then scan backwards from the end of the file until you find a
timestamp, and subtract.

You can also try to extract the bitrate from an early header and use
arithmetic to get a good estimate.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
May 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
13619
by: Mat | last post by:
How can I detect when a link has been clicked but the new page is still in the process of loading? The document.location.href property still displays the current location (understandably) not the one that's about to load. I have a page that reloads every 30 seconds in order to access live data. If a user clicks on a link just prior to the page reloading the reload takes precedence over the link click and this is annoying for the users....
1
2914
by: Mamatha | last post by:
Hi, I have a video capturing with motion detection application in C#.NET.In that application i detected all resources i.e video source and audion source thourgh motion detection,now i want to capture that live video into wmv file.Now i want help from you in the case of how can we detect the video from control like a picture,i used Videopanel control. If a method detect video from control without from webcam,i will be safe.Please give me...
2
3048
by: FE | last post by:
Hi, I need to create a program that will connect a media stream (a server on the internet - Windows Media format) and then generate an error when : * The stream is ok but there is no sound (for example when someone disconnected the mic) * The stream is ok but there is no more images In these to cases, I imagine the encoding server is still working fine but
8
3681
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
8
2700
by: Karl Groves | last post by:
Does anyone out there know of a way to capture a frame (at random, if possible) of a movie file with PHP? TIA -- Karl Groves www.karlcore.com
0
1047
by: =?Utf-8?B?Q29kZVJhem9y?= | last post by:
This is driving me nuts. I really need to watch a video on MSDN spotlight (http://www.microsoft.com/emea/msdn/spotlight/) but every video just stops working every 5 seconds. I've browsed online and it seems this is a problem for other people, yet there doesnt seems to be a solution available. I am running it on IE7 and I have Silverlight installed. I have also tried viewing an MSDN spotlight video via FoxPro and still no luck.
3
689
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
Note: My apologies for repeating this post from last week, but my nospam alias and profile account were incorrect. I think I have fixed this, so hopefully this post will trigger MS into a response per their MSDN policy. -------------------- I have a web site under .NET 2.0 that renders videos using the Silverlight media player. The web page looks like this: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="video2.aspx.cs"
13
4029
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
This is a follow-up to my post "Silverlight video doesn't work when file is streamed from handler in ASP.net" at http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.dotnet.framework.aspnet&mid=e9a38d03-83a8-41fc-8950-5ee60d2a18a5. I have a web site under .NET 2.0 that renders videos using the Silverlight media player. When I stream the video file (.wmv) to the browser via a hard-coded link to the file,...
0
5015
by: kronus | last post by:
Hi everyone, Yes, I need to use you guys as a sounding board once more :-) I have a button that has two listeners one for mouse up and the other for mouse down and they point to the same function. $btnRewind.addEventListener(MouseEvent.MOUSE_DOWN,onBtnBack); $btnRewind.addEventListener(MouseEvent.MOUSE_UP,onBtnBack);
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9602
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10639
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7661
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.