File increases in size when exporting to same format

Help for Audacity on GNU/Linux.
Forum rules
ImageThis forum is for Audacity on GNU/Linux.
Please state:
  • which version of Linux you are using,
  • the exact three-section version number of Audacity from Help menu > About Audacity,
  • whether you installed your distribution's release, PPA version, or compiled Audacity from source code.

Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade (see https://www.audacityteam.org/download/).
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
darknesscrysis
Posts: 10
Joined: Wed Dec 19, 2018 9:44 pm
Operating System: Linux *buntu

File increases in size when exporting to same format

Post by darknesscrysis » Thu Dec 20, 2018 7:56 am

I'm using audacity in Linux Mint 19 and when I export to m4a the file increases in size from around 20 it goes to 60mb. It didn't happen when I used audacity before in Linux Mint 18.3. I don't know which version of audacity I used before, now I use v2.2.1.

kozikowski
Forum Staff
Posts: 68938
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: File increases in size when exporting to same format

Post by kozikowski » Thu Dec 20, 2018 10:12 am

viewtopic.php?p=360326#p360326

What happens if you do that?

Koz

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: File increases in size when exporting to same format

Post by steve » Thu Dec 20, 2018 12:17 pm

darknesscrysis wrote:
Thu Dec 20, 2018 7:56 am
when I export to m4a
That's an unusual format for audio, it's more commonly used for video. Why do you need m4a audio files?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

DVDdoug
Forum Crew
Posts: 9287
Joined: Fri Sep 10, 2010 11:30 pm
Operating System: Windows 10

Re: File increases in size when exporting to same format

Post by DVDdoug » Thu Dec 20, 2018 11:15 pm

I'm not a Linux user and I rarely use M4A/AAC...

File size is directly related to bitrate. Bitrate in kbps is kilobits per second. So if you know there are 8 bits in a byte, and you know the bitrate and the playing-time you can calculate file size. This works for any audio or video format. (With the exception that embedded artwork or other metadata increases file size without affecting the audio/video bitrate... Embedded artwork can throw-off your calculations.)

So a higher bitrate gives you a bigger file and it can give you better quality (since less information is thrown-sway). But of course, you can't improve the quality by re-encoding to a higher bitrate.*

Depending on the encoder you can select the desired bitrate** or there may be a "quality" setting and the encoder will choose the required bitrate. With variable bitrate, the bitrate is adjusted moment-by-moment so file size is related to the average bitrate.




* Whenever you re-encode (lossy-to-lossy) you are doing additional "damage". But re-encoding to a higher bitrate may minimize the additional damage. (AAC/MA4 is supposed to be less-damaged re-encoding than MP3.)

** I forget the details but there's a bug in one of the FFMPEG AAC or M4A encoders so you may have difficulty selecting/changing the bitrate with Audacity.

darknesscrysis
Posts: 10
Joined: Wed Dec 19, 2018 9:44 pm
Operating System: Linux *buntu

Re: File increases in size when exporting to same format

Post by darknesscrysis » Sat Dec 29, 2018 1:29 pm

kozikowski wrote:
Thu Dec 20, 2018 10:12 am
viewtopic.php?p=360326#p360326

What happens if you do that?

Koz
I've gone to Edit -> Preferences -> Quality and I've selected:
Default Sample Format: 16-bit
Real-time Conversion
Sample Rate Conversion: Low Quality
Dither: None

High-quality Conversion
Sample Rate Conversion: Low Quality
Dither: None

After that I exported with format options -> quality=80 and it gave 162 mb for an originally 20 mb file of 1 hour 25 minutes.
steve wrote:
Thu Dec 20, 2018 12:17 pm
darknesscrysis wrote:
Thu Dec 20, 2018 7:56 am
when I export to m4a
That's an unusual format for audio, it's more commonly used for video. Why do you need m4a audio files?
DVDdoug wrote:
Thu Dec 20, 2018 11:15 pm
I'm not a Linux user and I rarely use M4A/AAC...

File size is directly related to bitrate. Bitrate in kbps is kilobits per second. So if you know there are 8 bits in a byte, and you know the bitrate and the playing-time you can calculate file size. This works for any audio or video format. (With the exception that embedded artwork or other metadata increases file size without affecting the audio/video bitrate... Embedded artwork can throw-off your calculations.)

So a higher bitrate gives you a bigger file and it can give you better quality (since less information is thrown-sway). But of course, you can't improve the quality by re-encoding to a higher bitrate.*

Depending on the encoder you can select the desired bitrate** or there may be a "quality" setting and the encoder will choose the required bitrate. With variable bitrate, the bitrate is adjusted moment-by-moment so file size is related to the average bitrate.




* Whenever you re-encode (lossy-to-lossy) you are doing additional "damage". But re-encoding to a higher bitrate may minimize the additional damage. (AAC/MA4 is supposed to be less-damaged re-encoding than MP3.)

** I forget the details but there's a bug in one of the FFMPEG AAC or M4A encoders so you may have difficulty selecting/changing the bitrate with Audacity.
I don't actually want to re-encode the audio I just opened it in audacity, cut some parts. I took it from 1 hour 45 minutes to 1 hour 25 minutes, then I export it to the same format. It shouldn't be modifying the bitrate although it obviously is or else it would have a lower size than at the start. I don't think I'm doing anything differently is something from audacity. Maybe I should download an older version so I can use it as before without this problem?

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: File increases in size when exporting to same format

Post by steve » Sat Dec 29, 2018 2:36 pm

darknesscrysis wrote:
Sat Dec 29, 2018 1:29 pm
I don't actually want to re-encode the audio
Then Audacity is not the right application. In order to perform all the editing and processing features that Audacity provides, it is necessary for the audio to be uncompressed. Therefore Audacity always decodes audio on import. This cannot be avoided with Audacity.

To avoid quality loss, you need to export from Audacity in a lossless format, such as WAV, AIFF or FLAC, but these all give very big files.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

darknesscrysis
Posts: 10
Joined: Wed Dec 19, 2018 9:44 pm
Operating System: Linux *buntu

Re: File increases in size when exporting to same format

Post by darknesscrysis » Sat Dec 29, 2018 3:02 pm

steve wrote:
Sat Dec 29, 2018 2:36 pm
darknesscrysis wrote:
Sat Dec 29, 2018 1:29 pm
I don't actually want to re-encode the audio
Then Audacity is not the right application. In order to perform all the editing and processing features that Audacity provides, it is necessary for the audio to be uncompressed. Therefore Audacity always decodes audio on import. This cannot be avoided with Audacity.

To avoid quality loss, you need to export from Audacity in a lossless format, such as WAV, AIFF or FLAC, but these all give very big files.
Then I do want to re-encode the audio and I don't mind the quality loss, I just want it to have a similar or lower file size when editing a m4a file and I do not care what the final file type is, it can be mp3 or whatever, but I don't want it to triple in size.

darknesscrysis
Posts: 10
Joined: Wed Dec 19, 2018 9:44 pm
Operating System: Linux *buntu

Re: File increases in size when exporting to same format

Post by darknesscrysis » Sat Dec 29, 2018 3:03 pm

I got this info from the original file:

mediainfo my-audio.m4a
General
Complete name : my-audio.m4a
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (isom/mp42)
File size : 17.7 MiB
Duration : 1 h 41 min
Overall bit rate mode : Constant
Overall bit rate : 24.5 kb/s
Encoded date : UTC 2017-10-23 17:15:45
Tagged date : UTC 2017-10-23 17:15:45
com.android.version : 7.0

Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : mp4a-40-2
Duration : 1 h 41 min
Bit rate mode : Constant
Bit rate : 24.0 kb/s
Channel(s) : 1 channel
Channel positions : Front: C
Sampling rate : 16.0 kHz
Frame rate : 15.625 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 17.4 MiB (98%)
Title : SoundHandle
Language : English
Encoded date : UTC 2017-10-23 17:15:45
Tagged date : UTC 2017-10-23 17:15:45

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: File increases in size when exporting to same format

Post by steve » Sat Dec 29, 2018 3:35 pm

darknesscrysis wrote:
Sat Dec 29, 2018 3:03 pm
I got this info from the original file:
That is very useful - I was about to ask you for that ;-)
darknesscrysis wrote:
Sat Dec 29, 2018 3:03 pm
Overall bit rate : 24.5 kb/s
That is an extremely low bit rate (very low quality, very high compression, very small file size).
darknesscrysis wrote:
Sat Dec 29, 2018 3:02 pm
Then I do want to re-encode the audio and I don't mind the quality loss, I just want it to have a similar or lower file size when editing a m4a file and I do not care what the final file type is, it can be mp3 or whatever, but I don't want it to triple in size.
That's also very helpful. I think your best option will be to export as MP3.

First, let's fix your Preference settings:

Preferences > Quality:
Set them the same as shown here: https://manual.audacityteam.org/man/qua ... ences.html

Before exporting, set the "Project Rate" to 16000 (lower left corner of the main Audacity window).

Export as MP3 and select:
Bit rate mode = constant
Quality = 24 kbps
(Channel mode is irrelevant for mono projects - I assume that your tracks are mono).

Do expect some loss of sound quality - 24 kbps is a very low bit rate.
("Opus" format would be better for sound quality, but is unfortunately not yet supported by Audacity)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

darknesscrysis
Posts: 10
Joined: Wed Dec 19, 2018 9:44 pm
Operating System: Linux *buntu

Re: File increases in size when exporting to same format

Post by darknesscrysis » Sat Dec 29, 2018 4:03 pm

Thanks a lot I was finally able to export it like that, it gave me the following error:
The project sample rate (44100) and bit rate (24 kbps) combination is not supported by the MP3 file format. You may resample to one of the rates below. I chose 2400 and it exported correctly.

Although I could export like this I still would like to know if I could do something to export to m4a as before so I have all the files with the same format.

Post Reply