aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: [1] 2

Author Topic: download pre-last chunk if the last is small  (Read 9980 times)

Morse

  • Full Member
  • ***
  • Karma: 6
  • Offline Offline
  • Posts: 105
download pre-last chunk if the last is small
« on: October 21, 2009, 09:48:51 PM »

and one more time i can't preview the file i'm downloading with the error "avi: can't find index" till the very end. i have "download first and last" checked, and according to the graph amule did download something in the end of file.
So the question is: can it be that the problem is in the last chunk being too small for the index?
If yes then the request is to increase priority not only of the last chunk, but also of the pre-last if the last is small (what is small - i don't know, but the index surely have to have some average size)
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: download pre-last chunk if the last is small
« Reply #1 on: October 21, 2009, 10:35:03 PM »

Did you try VLC? It can preview AVIs without the index, so I think the feature is pretty obsolete.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: download pre-last chunk if the last is small
« Reply #2 on: October 22, 2009, 12:00:37 AM »

Code: (src/PartFile.cpp) [Select]
// Criterion 2. Parts used for preview
// Remark: - We need to download the first part and the last part(s).
//        - When the last part is very small, it's necessary to
//          download the two last parts.
bool critPreview = false;
if(isPreviewEnable == true) {
if(cur_chunk.part == 0) {
critPreview = true; // First chunk
} else if(cur_chunk.part == partCount-1) {
critPreview = true; // Last chunk
} else if(cur_chunk.part == partCount-2) {
// Last chunk - 1 (only if last chunk is too small)
const uint32 sizeOfLastChunk = GetFileSize() - uEnd;
if(sizeOfLastChunk < PARTSIZE/3) {
critPreview = true; // Last chunk - 1
}
}
}
I.e. if the last part is smaller than 3242666 bytes (~3MB) we assign high priority to the penultimate part, too.
Logged
concordia cum veritate

Morse

  • Full Member
  • ***
  • Karma: 6
  • Offline Offline
  • Posts: 105
Re: download pre-last chunk if the last is small
« Reply #3 on: October 22, 2009, 11:00:58 AM »

hmm...

then it must be badly muxed avi or something...
Logged

zagar

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: download pre-last chunk if the last is small
« Reply #4 on: December 28, 2009, 01:18:11 AM »

No, it isn't . Without an AVI index, you can just play the beginning, but no seek  and maybe no FF / REW . Unfortunately, you cannot guess the index size unless analyzing the muxed stream, which is obviously outside amule's scope. The current approach, shown by GonoszTopi, is a good compromise indeed.

It was good compromise when most files were not bigger than 700MB.
With larger files, more chunks are needed.

For example, 2 or even 3 last chunks are needed for 1.5 GB files.
Logged

Morse

  • Full Member
  • ***
  • Karma: 6
  • Offline Offline
  • Posts: 105
Re: download pre-last chunk if the last is small
« Reply #5 on: December 28, 2009, 11:32:13 AM »


It was good compromise when most files were not bigger than 700MB.
With larger files, more chunks are needed.

For example, 2 or even 3 last chunks are needed for 1.5 GB files.


very probable this is the case. sometimes i download video files of the size 3+ GB, and very often only beginning is available for preview till the very end. And i don't think that bad muxing is the only problem, because most of that files are "mkv", and i really doubt that there is such a thing as "badly muxed mkv".
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: download pre-last chunk if the last is small
« Reply #6 on: December 28, 2009, 01:35:08 PM »

Does MKV even have an index at the end like AVI?
Oh, and I think you can mux anything badly.  :D
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Vollstrecker

  • Administrator
  • Hero Member
  • *****
  • Karma: 67
  • Offline Offline
  • Posts: 1549
  • Unofficial Debian Packager
    • http://vollstreckernet.de
Re: download pre-last chunk if the last is small
« Reply #7 on: December 28, 2009, 01:50:35 PM »

Maybe we can change that to something like "one chunk at the at (without conting anything below 50% of the chunk) per 500MB filesize".
Logged
Homefucking is killing prostitution

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: download pre-last chunk if the last is small
« Reply #8 on: December 28, 2009, 04:28:52 PM »

Maybe we can change that to something like "one chunk at the at (without conting anything below 50% of the chunk) per 500MB filesize".
Hmm, that would mean 2% of the file are not evenly distributed, which is bad for sharing. Even worse, while trying to get the indexes first the actual preview data (beginning of the video) is neglected.

Is preview really so important? Looking at the filenames usually is enough for me to weed out fakes.
And I think the main question is if the codec is able to skip blank (all-zero) parts and resync afterwards in finite time.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

zagar

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: download pre-last chunk if the last is small
« Reply #9 on: December 28, 2009, 07:31:53 PM »

Hmm, that would mean 2% of the file are not evenly distributed, which is bad for sharing.
Probably less, because the option is disabled by default.

Even worse, while trying to get the indexes first the actual preview data (beginning of the video) is neglected.
What about adding a separate option for indexing?
« Last Edit: December 28, 2009, 07:36:30 PM by zagar »
Logged

Vollstrecker

  • Administrator
  • Hero Member
  • *****
  • Karma: 67
  • Offline Offline
  • Posts: 1549
  • Unofficial Debian Packager
    • http://vollstreckernet.de
Re: download pre-last chunk if the last is small
« Reply #10 on: December 28, 2009, 07:44:34 PM »

Is preview really so important? Looking at the filenames usually is enough for me to weed out fakes.
And I think the main question is if the codec is able to skip blank (all-zero) parts and resync afterwards in finite time.

MPEG is able to jump over zeros or garbage, but resync isn't really needed. If I see naked people or hear spanish dialogs, I can be sure it's not what I wanted, regardles if it's syncronized or not.
Logged
Homefucking is killing prostitution

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: download pre-last chunk if the last is small
« Reply #11 on: December 28, 2009, 08:24:43 PM »

If you point a codec at a random point in a file it won't be able to show neither naked people nor Spanish dialogs until it finds a point to resync and recognize the start of a key frame or an audio sample within the gibberish. And depending on the encoding this may be easy, hard or even impossible.

What about adding a separate option for indexing?
Which should do what?
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: download pre-last chunk if the last is small
« Reply #12 on: December 28, 2009, 11:02:07 PM »

I'm Spanish AND naked.
Logged

Vollstrecker

  • Administrator
  • Hero Member
  • *****
  • Karma: 67
  • Offline Offline
  • Posts: 1549
  • Unofficial Debian Packager
    • http://vollstreckernet.de
Re: download pre-last chunk if the last is small
« Reply #13 on: December 28, 2009, 11:06:01 PM »

And I AM damned sure that I DON'T want to see that.
Logged
Homefucking is killing prostitution

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: download pre-last chunk if the last is small
« Reply #14 on: December 28, 2009, 11:24:27 PM »

Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon
Pages: [1] 2