IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
ABR different filesize for each execution, [moved from General Audio]
webpower
post Apr 9 2014, 22:24
Post #1





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998



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
Go to the top of the page
+Quote Post
[JAZ]
post Apr 9 2014, 23:07
Post #2





Group: Members
Posts: 1751
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



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).
Go to the top of the page
+Quote Post
webpower
post Apr 9 2014, 23:37
Post #3





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998



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?
Go to the top of the page
+Quote Post
pdq
post Apr 9 2014, 23:54
Post #4





Group: Members
Posts: 3372
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



Dithering does not take place during encoding, only during decoding.
Go to the top of the page
+Quote Post
DVDdoug
post Apr 9 2014, 23:54
Post #5





Group: Members
Posts: 2534
Joined: 24-August 07
From: Silicon Valley
Member No.: 46454



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).
Go to the top of the page
+Quote Post
webpower
post Apr 9 2014, 23:58
Post #6





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998





here it is a "diff" between two encoded files.

This post has been edited by webpower: Apr 9 2014, 23:59
Go to the top of the page
+Quote Post
saratoga
post Apr 10 2014, 01:25
Post #7





Group: Members
Posts: 4847
Joined: 2-September 02
Member No.: 3264



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?
Go to the top of the page
+Quote Post
webpower
post Apr 10 2014, 10:24
Post #8





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998



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
Go to the top of the page
+Quote Post
webpower
post Apr 10 2014, 20:51
Post #9





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998



so? any other suggestion? I if you need more detailed information, ask me!
Go to the top of the page
+Quote Post
webpower
post Apr 12 2014, 15:30
Post #10





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998



http://nopaste.info/2ef25e9f5d.html

here it is a log
Go to the top of the page
+Quote Post
ktf
post Apr 12 2014, 15:40
Post #11





Group: Members
Posts: 333
Joined: 22-March 09
From: The Netherlands
Member No.: 68263



QUOTE (webpower @ Apr 10 2014, 00:37) *
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.
Go to the top of the page
+Quote Post
webpower
post Apr 12 2014, 15:46
Post #12





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998



QUOTE (ktf @ Apr 12 2014, 16:40) *
QUOTE (webpower @ Apr 10 2014, 00:37) *
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.
Go to the top of the page
+Quote Post
webpower
post Apr 12 2014, 15:53
Post #13





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998



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
Go to the top of the page
+Quote Post
db1989
post Apr 12 2014, 16:14
Post #14





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (webpower @ Apr 12 2014, 15:46) *
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).

This post has been edited by db1989: Apr 12 2014, 16:16
Go to the top of the page
+Quote Post
webpower
post Apr 12 2014, 16:19
Post #15





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998



QUOTE (db1989 @ Apr 12 2014, 17:14) *
QUOTE (webpower @ Apr 12 2014, 15:46) *
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?
Go to the top of the page
+Quote Post
saratoga
post Apr 12 2014, 16:24
Post #16





Group: Members
Posts: 4847
Joined: 2-September 02
Member No.: 3264



Decode the output to wav, then do it again and see if the samples are identical or not.
Go to the top of the page
+Quote Post
webpower
post Apr 12 2014, 16:31
Post #17





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998



QUOTE (saratoga @ Apr 12 2014, 17:24) *
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
Go to the top of the page
+Quote Post
webpower
post Apr 12 2014, 17:15
Post #18





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998



ok, i've encoded into wave file both the different output mp3 file, and will get 2 identical file.

so?, what does it mean?
Go to the top of the page
+Quote Post
saratoga
post Apr 12 2014, 17:19
Post #19





Group: Members
Posts: 4847
Joined: 2-September 02
Member No.: 3264



What tool did you use to check that they were identical ?

And I did mean decode. Wav is uncompressed pcm.
Go to the top of the page
+Quote Post
webpower
post Apr 12 2014, 17:29
Post #20





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998



QUOTE (saratoga @ Apr 12 2014, 18: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.
Go to the top of the page
+Quote Post
db1989
post Apr 12 2014, 17:32
Post #21





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



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?
Go to the top of the page
+Quote Post
webpower
post Apr 12 2014, 17:32
Post #22





Group: Members
Posts: 51
Joined: 7-December 13
Member No.: 112998



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
Go to the top of the page
+Quote Post
saratoga
post Apr 12 2014, 17:34
Post #23





Group: Members
Posts: 4847
Joined: 2-September 02
Member No.: 3264



Probably some step is applying dither.

Edit: just because two files are the same size does not mean they are identical.

This post has been edited by saratoga: Apr 12 2014, 17:35
Go to the top of the page
+Quote Post
db1989
post Apr 12 2014, 17:34
Post #24





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (db1989 @ Apr 12 2014, 17:32) *
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?
QUOTE (webpower @ Apr 12 2014, 17:32) *
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

wink.gif

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.

This post has been edited by db1989: Apr 12 2014, 17:37
Go to the top of the page
+Quote Post
[JAZ]
post Apr 12 2014, 17:36
Post #25





Group: Members
Posts: 1751
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



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).
Go to the top of the page
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th July 2014 - 09:45