How to get the a half downloaded file's duration

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get the a half downloaded file's duration

Mine-2
Hi All,
    I have an application that downloads a file from the net and at the same
time I'm using ffmpeg to decode it and play it.
    When playing it, user should be able to do seek within the area that the
data has been downloaded. Now I meet a problem that I need to prevent the
user from seeking to a position that the data is not downloaded, but I don't
know how to get the duration of a half downloaded file. For example, I have
a file with 30MB and 3 min. If the file is downloaded 15MB, how to get the
duration of this 15MB file? (I know I can calculate it with the original
file's size and say the duration is 1.5 min, but it's a rough value)
    Is there a way to get the duration of such file?
--
Mine
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: How to get the a half downloaded file's duration

Michel Bardiaux-2
Mine a écrit :

> Hi All,
>     I have an application that downloads a file from the net and at the same
> time I'm using ffmpeg to decode it and play it.
>     When playing it, user should be able to do seek within the area that the
> data has been downloaded. Now I meet a problem that I need to prevent the
> user from seeking to a position that the data is not downloaded, but I don't
> know how to get the duration of a half downloaded file. For example, I have
> a file with 30MB and 3 min. If the file is downloaded 15MB, how to get the
> duration of this 15MB file? (I know I can calculate it with the original
> file's size and say the duration is 1.5 min, but it's a rough value)
>     Is there a way to get the duration of such file?

It alll depends on the container used for the download, and on what
exactly you mean by "using ffmpeg to decode it and play it". Does it
mean you use ffmpeg (the CLI) to transcode to another file, which is
given to some player before being complete; or that a home-written
application using ffmpeg (the API) is involved?

--
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:[hidden email]

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: How to get the a half downloaded file's duration

Mine-2
It is streamable MP4 file. And I write my player application to play the
file. The player is using ffmpeg's APIs to decode.
Actually it's not related to player, right? I just want to know how to get
the half downloaded file's duration.

On Dec 17, 2007 6:39 PM, Michel Bardiaux <[hidden email]> wrote:

> Mine a écrit :
> > Hi All,
> >     I have an application that downloads a file from the net and at the
> same
> > time I'm using ffmpeg to decode it and play it.
> >     When playing it, user should be able to do seek within the area that
> the
> > data has been downloaded. Now I meet a problem that I need to prevent
> the
> > user from seeking to a position that the data is not downloaded, but I
> don't
> > know how to get the duration of a half downloaded file. For example, I
> have
> > a file with 30MB and 3 min. If the file is downloaded 15MB, how to get
> the
> > duration of this 15MB file? (I know I can calculate it with the original
> > file's size and say the duration is 1.5 min, but it's a rough value)
> >     Is there a way to get the duration of such file?
>
> It alll depends on the container used for the download, and on what
> exactly you mean by "using ffmpeg to decode it and play it". Does it
> mean you use ffmpeg (the CLI) to transcode to another file, which is
> given to some player before being complete; or that a home-written
> application using ffmpeg (the API) is involved?
>
> --
> Michel Bardiaux
> R&D Director
> T +32 [0] 2 790 29 41
> F +32 [0] 2 790 29 02
> E mailto:[hidden email]
>
> Mediaxim NV/SA
> Vorstlaan 191 Boulevard du Souverain
> Brussel 1160 Bruxelles
> http://www.mediaxim.com/
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
>


--
俺たちが�\った列�は途中下�はできないんだ!

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: How to get the a half downloaded file's duration

Michel Bardiaux-2
Mine a écrit :
>

Please dont top-post.

 >
> It is streamable MP4 file. And I write my player application to play the
> file. The player is using ffmpeg's APIs to decode.
> Actually it's not related to player, right? I just want to know how to get
> the half downloaded file's duration.

How do you stream? http?

>
> On Dec 17, 2007 6:39 PM, Michel Bardiaux <[hidden email]> wrote:
>
>> Mine a écrit :
>>> Hi All,
>>>     I have an application that downloads a file from the net and at the
>> same
>>> time I'm using ffmpeg to decode it and play it.
>>>     When playing it, user should be able to do seek within the area that
>> the
>>> data has been downloaded. Now I meet a problem that I need to prevent
>> the
>>> user from seeking to a position that the data is not downloaded, but I
>> don't
>>> know how to get the duration of a half downloaded file. For example, I
>> have
>>> a file with 30MB and 3 min. If the file is downloaded 15MB, how to get
>> the
>>> duration of this 15MB file? (I know I can calculate it with the original
>>> file's size and say the duration is 1.5 min, but it's a rough value)
>>>     Is there a way to get the duration of such file?
>> It alll depends on the container used for the download, and on what
>> exactly you mean by "using ffmpeg to decode it and play it". Does it
>> mean you use ffmpeg (the CLI) to transcode to another file, which is
>> given to some player before being complete; or that a home-written
>> application using ffmpeg (the API) is involved?

--
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:[hidden email]

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: How to get the a half downloaded file's duration

Mine-2
On Dec 18, 2007 12:08 AM, Michel Bardiaux <[hidden email]> wrote:

> Mine a écrit :
> >
>
> Please dont top-post.
>
>  >
> > It is streamable MP4 file. And I write my player application to play the
> > file. The player is using ffmpeg's APIs to decode.
> > Actually it's not related to player, right? I just want to know how to
> get
> > the half downloaded file's duration.
>
> How do you stream? http?
No, I use my protocol to download the file and write the data to a local
file, meanwhile when there's enough buffer for playing I use ffmpeg to open
and decode the half downloaded file.

>
>
> >
> > On Dec 17, 2007 6:39 PM, Michel Bardiaux <[hidden email]> wrote:
> >
> >> Mine a écrit :
> >>> Hi All,
> >>>     I have an application that downloads a file from the net and at
> the
> >> same
> >>> time I'm using ffmpeg to decode it and play it.
> >>>     When playing it, user should be able to do seek within the area
> that
> >> the
> >>> data has been downloaded. Now I meet a problem that I need to prevent
> >> the
> >>> user from seeking to a position that the data is not downloaded, but I
> >> don't
> >>> know how to get the duration of a half downloaded file. For example, I
> >> have
> >>> a file with 30MB and 3 min. If the file is downloaded 15MB, how to get
> >> the
> >>> duration of this 15MB file? (I know I can calculate it with the
> original
> >>> file's size and say the duration is 1.5 min, but it's a rough value)
> >>>     Is there a way to get the duration of such file?
> >> It alll depends on the container used for the download, and on what
> >> exactly you mean by "using ffmpeg to decode it and play it". Does it
> >> mean you use ffmpeg (the CLI) to transcode to another file, which is
> >> given to some player before being complete; or that a home-written
> >> application using ffmpeg (the API) is involved?
>
> --
> Michel Bardiaux
> R&D Director
> T +32 [0] 2 790 29 41
> F +32 [0] 2 790 29 02
> E mailto:[hidden email]
>
> Mediaxim NV/SA
> Vorstlaan 191 Boulevard du Souverain
> Brussel 1160 Bruxelles
> http://www.mediaxim.com/
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
>


--
俺たちが�\った列�は途中下�はできないんだ!

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: How to get the a half downloaded file's duration

Michel Bardiaux-2
Mine a écrit :

> On Dec 18, 2007 12:08 AM, Michel Bardiaux <[hidden email]> wrote:
>
>> Mine a écrit :
>> Please dont top-post.
>>
>>  >
>>> It is streamable MP4 file. And I write my player application to play the
>>> file. The player is using ffmpeg's APIs to decode.
>>> Actually it's not related to player, right? I just want to know how to
>> get
>>> the half downloaded file's duration.
>> How do you stream? http?
>
> No, I use my protocol to download the file and write the data to a local
> file, meanwhile when there's enough buffer for playing I use ffmpeg to open
> and decode the half downloaded file.

Try ffmpeg -i on the half-downloaded file.

>
>>
>>> On Dec 17, 2007 6:39 PM, Michel Bardiaux <[hidden email]> wrote:
>>>
>>>> Mine a écrit :
>>>>> Hi All,
>>>>>     I have an application that downloads a file from the net and at
>> the
>>>> same
>>>>> time I'm using ffmpeg to decode it and play it.
>>>>>     When playing it, user should be able to do seek within the area
>> that
>>>> the
>>>>> data has been downloaded. Now I meet a problem that I need to prevent
>>>> the
>>>>> user from seeking to a position that the data is not downloaded, but I
>>>> don't
>>>>> know how to get the duration of a half downloaded file. For example, I
>>>> have
>>>>> a file with 30MB and 3 min. If the file is downloaded 15MB, how to get
>>>> the
>>>>> duration of this 15MB file? (I know I can calculate it with the
>> original
>>>>> file's size and say the duration is 1.5 min, but it's a rough value)
>>>>>     Is there a way to get the duration of such file?
>>>> It alll depends on the container used for the download, and on what
>>>> exactly you mean by "using ffmpeg to decode it and play it". Does it
>>>> mean you use ffmpeg (the CLI) to transcode to another file, which is
>>>> given to some player before being complete; or that a home-written
>>>> application using ffmpeg (the API) is involved?

--
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:[hidden email]

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user