Skip to main content

Topic: ABR different filesize for each execution (Read 3963 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • webpower
  • [*][*]
ABR different filesize for each execution
hi all, i have an issue: i'm using "avidemux" which is a video encodind software that includes obviously an audio encoder (LAME): when I encode a video, i get a different size output file (few bytes), this not happens if I do use CBR encoding.

Somebody knows why of this?

thank you

  • [JAZ]
  • [*][*][*][*][*]
ABR different filesize for each execution
Reply #1
If I don't miss any detail, LAME is a deterministic encoder, which means the same input (audio and settings and machine) necessarily produce the same output.

Since you say you have a slightly different output in something that is supposed to cause variability (ABR), I need to assume that the audio is really not the same. What might be happening in your back by avidemux is that the audio might get dither applied, so there might be small differences in the quiet parts. ( the loud parts wouldn't get affected at all, because the change would be under the threshold).

  • webpower
  • [*][*]
ABR different filesize for each execution
Reply #2
ok, thank you, but there is some way to know if dithering is the cause of this? if it is so, why do it affects only ABR and not CBR?

  • pdq
  • [*][*][*][*][*]
ABR different filesize for each execution
Reply #3
Dithering does not take place during encoding, only during decoding.

  • DVDdoug
  • [*][*][*][*][*]
ABR different filesize for each execution
Reply #4
Quote
hi all, i have an issue: i'm using "avidemux" which is a video encodind software that includes obviously an audio encoder (LAME): when I encode a video, i get a different size output file (few bytes),
Different from what?

A few byes could be a different header or a tag (metadata).

  • webpower
  • [*][*]
ABR different filesize for each execution
Reply #5


here it is a "diff" between two encoded files.
  • Last Edit: 09 April, 2014, 06:59:38 PM by webpower

  • saratoga
  • [*][*][*][*][*]
ABR different filesize for each execution
Reply #6
If I understand that picture right, theres a little bit different at the front, and then the contents of one file are similar but shifted relative to the other.  My guess is that the PCM audio isn't quite the same length between the two encodings.

Perhaps one has some more silence padded?

  • webpower
  • [*][*]
ABR different filesize for each execution
Reply #7
I don't know, the only thing I know is that for every encoding execution on the same OS, with the same software and the same parameter on the seame PC, produces a strightly different output file size

  • webpower
  • [*][*]
ABR different filesize for each execution
Reply #8
so? any other suggestion? I if you need more detailed information, ask me!

  • webpower
  • [*][*]
ABR different filesize for each execution
Reply #9

  • ktf
  • [*][*][*][*][*]
ABR different filesize for each execution
Reply #10
ok, thank you, but there is some way to know if dithering is the cause of this?

I'd say, try avidemux but encode to WAV or a lossless codec and check the output files for differences

Quote
if it is so, why do it affects only ABR and not CBR?

Because if the length doesn't change (or only a little bit) CBR produces the same file size. However, with ABR, there is a part of the encoder that tries to decide which blocksize should be used, and that algorithm could be influenced by dither. It might choose a higher or lower bitrate for one or a few blocks.
Music: sounds arranged such that they construct feelings.

  • webpower
  • [*][*]
ABR different filesize for each execution
Reply #11
ok, thank you, but there is some way to know if dithering is the cause of this?

I'd say, try avidemux but encode to WAV or a lossless codec and check the output files for differences

Quote
if it is so, why do it affects only ABR and not CBR?

Because if the length doesn't change (or only a little bit) CBR produces the same file size. However, with ABR, there is a part of the encoder that tries to decide which blocksize should be used, and that algorithm could be influenced by dither. It might choose a higher or lower bitrate for one or a few blocks.


yes, but i haven't undertood why it changes for every execution with all unchanged, no one thing i have changed.

  • webpower
  • [*][*]
ABR different filesize for each execution
Reply #12
ok, I've encoded to PCM, and in this case i get the same filesize for every encoding. so, the problem is ONLY with ABR LAME. I also tried using lame standalone with -V field, and in this case there is not the isseue. I'm very confused

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
ABR different filesize for each execution
Reply #13
yes, but i haven't undertood why it changes for every execution with all unchanged, no one thing i have changed.
You haven’t answered whether or not you are applying dither. If yes, as said above, dither is random and therefore will not be consistent (assuming a competent algorithm).
  • Last Edit: 12 April, 2014, 11:16:09 AM by db1989

  • webpower
  • [*][*]
ABR different filesize for each execution
Reply #14
yes, but i haven't undertood why it changes for every execution with all unchanged, no one thing i have changed.
You haven’t answered whether or not you are applying dither. If yes, as said above, dither is random and therefore will not be consistent (assuming a competent algorithm).


ok, now the problem is how to know if dither is applied, can be understood from the log i've already pasted here?

  • saratoga
  • [*][*][*][*][*]
ABR different filesize for each execution
Reply #15
Decode the output to wav, then do it again and see if the samples are identical or not.

  • webpower
  • [*][*]
ABR different filesize for each execution
Reply #16
Decode the output to wav, then do it again and see if the samples are identical or not.


"decode" ? maybe you would say "encode"

master input video source ---> output video source with mp3 abr ---> ...

please, continue the chain to explain better what I need to do, thank you

  • webpower
  • [*][*]
ABR different filesize for each execution
Reply #17
ok, i've encoded into wave file both the different output mp3 file, and will get 2 identical file.

so?, what does it mean?

  • saratoga
  • [*][*][*][*][*]
ABR different filesize for each execution
Reply #18
What tool did you use to check that they were identical ?

And I did mean decode. Wav is uncompressed pcm.

  • webpower
  • [*][*]
ABR different filesize for each execution
Reply #19
What tool did you use to check that they were identical ?

And I did mean decode. Wav is uncompressed pcm.


no, sorry, they are not identical I just made a diff between two output file, they only have the same size again, but not identical.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
ABR different filesize for each execution
Reply #20
Again, everything is pointing towards dither.

Even CBR would not produce identical audio under that condition – only size. Did you ever bit-compare the actual audio of the CBR ones?

  • webpower
  • [*][*]
ABR different filesize for each execution
Reply #21
ooh, i'm just stating that also with LAME CBR they get different output file for every execution, but they have only the same size, WTF

  • saratoga
  • [*][*][*][*][*]
ABR different filesize for each execution
Reply #22
Probably some step is applying dither.

Edit: just because two files are the same size does not mean they are identical.
  • Last Edit: 12 April, 2014, 12:35:19 PM by saratoga

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
ABR different filesize for each execution
Reply #23
Again, everything is pointing towards dither.

Even CBR would not produce identical audio under that condition – only size. Did you ever bit-compare the actual audio of the CBR ones?
ooh, i'm just stating that also with LAME CBR they get different output file for every execution, but they have only the same size, WTF


I suspect there’s no reason to be mystified. Check what settings are actually being used throughout the processing chain. If dither is active, that explains absolutely everything you’ve observed.
  • Last Edit: 12 April, 2014, 12:37:13 PM by db1989

  • [JAZ]
  • [*][*][*][*][*]
ABR different filesize for each execution
Reply #24
if you have foobar2000, there is a component named  foo_bitcompare

You would select the two wavs generated by two consecutive executions and under right-click mouse popup, utilities, Bit compare tracks.

You could also try with windiff, as you did with mp3. In that case, there would be dither if there are differences everywhere in the file (not necessarily all bytes, or consecutive bytes). If there are no, or just a few differences, then probably there isn't dither applied.

When I suggested dither as a possible cause, it was with the idea that the software might be working in floating point and then requiring a conversion when encoding that audio. Else, dither would not be needed.
It might also be the case that the software does stretching of the audio to accommodate for the video framerate, but then it should still produce the same output (because it would do the same changes).

I don't see anything special in the log. Just that it works at 48Khz and scales at 0.95, but probably both things are to be expected.


BTW: A wave file of the same length will always have the same size, (excluding cases where it could have different headers or tags).