ffmpeg, how to normalize / change rate from 48000 to 44100? (Solved)

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
Tippe
Posts: 137
Joined: Wed Feb 15, 2023 11:55 pm
Has thanked: 8 times
Been thanked: 21 times

ffmpeg, how to normalize / change rate from 48000 to 44100? (Solved)

Post by Tippe »

Hi.

Thanks to a forum member I got a script to extract audio tracks from video files.
But another two problems took place.

  1. To burn stuff to CD I need to change bit rate (?) of audio from 48000 to 44100.
  2. Lots of audio tracks are recorded above 0 db which will return clicks at 41000.

So, the title says it:

How to normalize audio via ffmpeg and how to change from 48000 to 44100?

I would like to add these steps to the script I already have,
or doing it afterwards extracting the audio files by another script.

I don't care how I do it.

Thanks

Bionic Puppy 64bit.
Won't use another one.

User avatar
Flash
Moderator
Posts: 972
Joined: Tue Dec 03, 2019 3:13 pm
Location: Arizona, U.S.
Has thanked: 50 times
Been thanked: 124 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100

Post by Flash »

If you open a console and enter ffmpeg --help, a whole bunch of options appear, one of which is ar rate set audio sampling rate (in Hz) Would that work for you?

Chaos coordinator :?
Tippe
Posts: 137
Joined: Wed Feb 15, 2023 11:55 pm
Has thanked: 8 times
Been thanked: 21 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100

Post by Tippe »

No, this is way too much and strange information for me.
My knowledge of English language is not that good,
to solve this by myself by using ffmpeg --help.

Thanks

Bionic Puppy 64bit.
Won't use another one.

User avatar
Flash
Moderator
Posts: 972
Joined: Tue Dec 03, 2019 3:13 pm
Location: Arizona, U.S.
Has thanked: 50 times
Been thanked: 124 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100

Post by Flash »

What language(s) would you like?

Chaos coordinator :?
User avatar
wiak
Posts: 4069
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1200 times
Contact:

Re: ffmpeg, how to normalize / change rate from 48000 to 44100

Post by wiak »

Tippe wrote: Mon Aug 07, 2023 3:36 am

No, this is way too much and strange information for me.
My knowledge of English language is not that good,
to solve this by myself by using ffmpeg --help.

Thanks

English is my first language, but not a chance I could use ffmpeg simply from the unexplained output from ffmpeg --help!!! (or yeah, let's be lazy helpers and just say run command: man ffmpeg... no chance).

Best to google search for tutorials regarding ffmeg practical usage or put in exactly what you want it to do (e.g. normalize audio) and look for the likes of stackoverflow results and similar:

https://www.maketecheasier.com/normaliz ... th-ffmpeg/

https://stackoverflow.com/questions/719 ... s-in-sound

https://onelinerhub.com/ffmpeg/how-to-n ... dio-volume

OR: google: puppy linux psearch, and use search terms like: ffmpeg normalize audio: https://www.forum.puppylinux.com/viewto ... a6a#p25956

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
gychang
Posts: 584
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 205 times
Been thanked: 63 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100

Post by gychang »

Tippe wrote: Mon Aug 07, 2023 12:43 am

Hi.

Thanks to a forum member I got a script to extract audio tracks from video files.
But another two problems took place.

1. To burn stuff to CD I need to change bit rate (?) of audio from 48000 to 44100.
2. Lots of audio tracks are recorded above 0 db which will return clicks at 41000.
Thanks

to change the sampling rate, u may want to try.
ffmpeg -i file1.mp3 -ar 44100 file1-enc.mp3

to normalize, I use
mp3gain -r -c *.mp3

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

Tippe
Posts: 137
Joined: Wed Feb 15, 2023 11:55 pm
Has thanked: 8 times
Been thanked: 21 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100?

Post by Tippe »

@Flash
German ;)
But that's not possible, I believe.

@wiak
Thanks for the links.
Check this later.

@gychang
Thanks.

Ok, when there's e.g. an extracted .opus or .m4a audio file recorded above 0db, everything above 0db is cut off when converting to e.g. .mp3. So, I need to normalize everything before converting to .mp3 and also before changing sample rate to 44100. That's why I want to use ffmpeg in a bash script for all the steps.

Perhaps I will find something useful by wiak's links.

Bionic Puppy 64bit.
Won't use another one.

User avatar
rockedge
Site Admin
Posts: 6481
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2692 times
Been thanked: 2592 times
Contact:

Re: ffmpeg, how to normalize / change rate from 48000 to 44100?

Post by rockedge »

German ;)
But that's not possible, I believe.

Ich spreche Deutsch.
this might help : https://www.forum.puppylinux.com/viewto ... 983#p25983

This might be more of what you need -> https://oldforum.puppylinux.com/viewtop ... 3d#p861023

These instructions are probably in German as well.In English ->https://www.maketecheasier.com/normaliz ... th-ffmpeg/

User avatar
wiak
Posts: 4069
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1200 times
Contact:

Re: ffmpeg, how to normalize / change rate from 48000 to 44100?

Post by wiak »

One thing to be careful with if planning to use ffmpeg... an old ffmpeg of five or more years ago can be very different from one of the last few years - ffmpeg gets constantly developed - best command parameters change. I'd advise looking at posts from after 2020 (at least, no more than five years ago) to have better chance of currently applicable commands to best use (you might be lucky with older post/tutorial, but safer to get tutorial/post as near to current day as possible - time does not stand still and what was once useful information becomes dated all too soon...).

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
mikewalsh
Moderator
Posts: 6115
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 779 times
Been thanked: 1952 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100?

Post by mikewalsh »

Most likely not the answer you want, but documentation for the Ffmpeg Project can be found here:-

https://ffmpeg.org/ffmpeg.html

Unfortunately, it's like the mPlayer Project; it's been going for many years, and the documentation is extensive, to say the least. It's another of those items that presumes you have a fair bit of experience with the command-line; it's essentially a tool for terminal use.....all software that uses it (and there's a lot) will be applying parts of this code somewhere in the background.

Perhaps contact Forum member plinej? I know they've built a number of Puppy-specific applications based on ffmpeg in recent years, so he/she has probably got more "current" experience than most.....

Just a thought, like.

Mike. ;)

User avatar
rockedge
Site Admin
Posts: 6481
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2692 times
Been thanked: 2592 times
Contact:

Re: ffmpeg, how to normalize / change rate from 48000 to 44100?

Post by rockedge »

I agree and add a link to a GUI for ffmpeg that @plinej has offered here on the forum ->
viewtopic.php?p=91403#p91403

Tippe
Posts: 137
Joined: Wed Feb 15, 2023 11:55 pm
Has thanked: 8 times
Been thanked: 21 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100?

Post by Tippe »

@rockedge

Thanks.

I will check this Yad tool.
I can read code, so maybe I will find something that I can use to do a little hack.

Bionic Puppy 64bit.
Won't use another one.

User avatar
Flash
Moderator
Posts: 972
Joined: Tue Dec 03, 2019 3:13 pm
Location: Arizona, U.S.
Has thanked: 50 times
Been thanked: 124 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100?

Post by Flash »

Puppy used to come with a very powerful audio recording program. EasyOS doesn't have it. I can't remember what it's called, but I think it might be an easy way for you to do what you want.

Chaos coordinator :?
geo_c
Posts: 2876
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 2193 times
Been thanked: 871 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100?

Post by geo_c »

Flash wrote: Thu Aug 10, 2023 2:50 am

Puppy used to come with a very powerful audio recording program. EasyOS doesn't have it. I can't remember what it's called, but I think it might be an easy way for you to do what you want.

You might be thinkinf of gwave edit, and it's built into F96_CE4.

I use it all the time.

geo_c
Old School Hipster, and Such

Tippe
Posts: 137
Joined: Wed Feb 15, 2023 11:55 pm
Has thanked: 8 times
Been thanked: 21 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100?

Post by Tippe »

Hi.

Today I got some time to examine all the above.
All these information and links above have been extremely helpful.
By now I have created a small drag 'n' drop script which seems to work great so far.

Code: Select all

#!/bin/sh
IN="$1"
ffmpeg -i "$IN" -af loudnorm=I=-14:LRA=11:TP=-0.4 -ar 44100 "$IN".mp3
exit 0

Thanks @All

I'm very happy with that. :thumbup:

Bionic Puppy 64bit.
Won't use another one.

User avatar
mikewalsh
Moderator
Posts: 6115
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 779 times
Been thanked: 1952 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100?

Post by mikewalsh »

@Tippe :-

Nice to see you're "diving-in" and getting your hands dirty..! :thumbup:

Ffmpeg looks incredibly complicated. But once you understand the order in which commands need to be written - and the extensive '-options' you can apply at every step - it's not so hard to start writing your own scripts.

(It's all very well saying that you'll search the web & see if you can find a script by somebody else that does exactly what you want.......but whoever writes a script that you find useful, even that person had to teach themselves at some point.

Much simpler to teach yourself in the first place, rather than relying on other people's expertise. Why shouldn't YOU be "the expert", hmm....?)

Mike. ;)

Tippe
Posts: 137
Joined: Wed Feb 15, 2023 11:55 pm
Has thanked: 8 times
Been thanked: 21 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100? (Solved)

Post by Tippe »

Oh, man.

Dependent on the file(?) it seems not to work all the time properly.
Perhaps there's something wrong with FFMPEG in Bionic64?

The problem is:

  • one time there is clipping, level is higher than 0.0 dB (Audacity marks this by red lines)
  • another time the normalized volume is around -10 dB which is much too low

I read somewhere that Puppy's FFMPEG is a reduced version.

Is that true?
Where do I get the full version, if so?
Is it possible to install full version into Bioic64?

Bionic Puppy 64bit.
Won't use another one.

User avatar
rockedge
Site Admin
Posts: 6481
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2692 times
Been thanked: 2592 times
Contact:

Re: ffmpeg, how to normalize / change rate from 48000 to 44100? (Solved)

Post by rockedge »

@Tippe I think Bionic has the FFMPEG avconv replacement and is not the full version. :geek:

I have had good results using a Static Build of FFMPEG that is a full version and works well. @mikewalsh is also familiar with the static ffmpeg builds and using them in Puppy Linux and might be able to give some tips. It should be easy to set up.

Here is the collection : https://johnvansickle.com/ffmpeg/ of the builds. Simply copy the files into executable locations (for example : /usr/bin, /root/my-applications/bin). Make sure to remove any symlinks to avconv if any exist. The point here is you want the static ffmpeg to be the primary.

See if that helps!

Tippe
Posts: 137
Joined: Wed Feb 15, 2023 11:55 pm
Has thanked: 8 times
Been thanked: 21 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100? (Solved)

Post by Tippe »

Thanks.
No, it's ffmpeg installed in /usr/bin.
I downloaded 6.1 release.
Where do I put directories MANPAGES and MODEL?

Bionic Puppy 64bit.
Won't use another one.

User avatar
rockedge
Site Admin
Posts: 6481
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2692 times
Been thanked: 2592 times
Contact:

Re: ffmpeg, how to normalize / change rate from 48000 to 44100? (Solved)

Post by rockedge »

Tippe wrote: Mon Dec 11, 2023 4:01 pm

Where do I put directories MANPAGES and MODEL?

place MODEL here -> /usr/local/share/model

the files in MANPAGES are in man pages in text format so you can reference them but do not need to be in any particular place. Store them where you like they are not needed for ffmpeg operation.

Make sure to disable the original ffmpeg!

User avatar
mikewalsh
Moderator
Posts: 6115
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 779 times
Been thanked: 1952 times

Re: ffmpeg, how to normalize / change rate from 48000 to 44100? (Solved)

Post by mikewalsh »

rockedge wrote: Mon Dec 11, 2023 3:34 pm

@Tippe I think Bionic has the FFMPEG avconv replacement and is not the full version. :geek:

I have had good results using a Static Build of FFMPEG that is a full version and works well. @mikewalsh is also familiar with the static ffmpeg builds and using them in Puppy Linux and might be able to give some tips. It should be easy to set up.

Here is the collection : https://johnvansickle.com/ffmpeg/ of the builds. Simply copy the files into executable locations (for example : /usr/bin, /root/my-applications/bin). Make sure to remove any symlinks to avconv if any exist. The point here is you want the static ffmpeg to be the primary.

See if that helps!

@rockedge :-

Nah, you're thinking of Tahrpup, Erik. Tahr is the only Puppy I know of that was tainted by the abortion known as avconv.....and the only reason for that is simple; because - God-above knows why - some bright spark on the Ubuntu dev team the year they were developing "Trusty Tahr" decided it might be rather fun to try out the forked version after the bust-up within the Ffmpeg team.

Thankfully, by the time "Xenial Xerus" came up for release that idea had been consigned to where it deservedly belonged.......the trash-bin of history!

Tahrpup was the first Puppy I used full-time, but i was never able to properly do anything media-related due to avconv. Videos simply wouldn't render properly. Audio wouldn't 'sync'. Crap like that... When JvS's static builds were discovered by one of our members a few years later, I retro-fitted a new install of Tahrpup with a static build of ffmpeg in place of Puppy's anaemic native version. At the same time, I deleted avconv, and set it up again as a sym-link to the static ffmpeg, following advice from somebody I knew from another forum I belonged to at that time. Anything that looked for avconv was thus redirected to ffmpeg itself, and guess what? All of a sudden, media-related stuff started behaving itself again..... :roll:

Bionic was never "blessed" with avconv, luckily. Good job, too! :o


As for tips? I wish I knew enough to be able to offer them! Despite having played about with it for a while now, I'm still the rawest neophyte when it comes to actually knowing what I'm doing with it. There is just SO much to get your head round, 'cos it's like mPlayer; the project has been going for enough years by now that the documentation resembles a small stack of Bibles. There's TONS of it!

I reckon that, for most people, you could spend a lifetime messing about with ffmpeg.....and STILL not learn everything there is to know about it.

Mike. ;)

User avatar
rockedge
Site Admin
Posts: 6481
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2692 times
Been thanked: 2592 times
Contact:

Re: ffmpeg, how to normalize / change rate from 48000 to 44100? (Solved)

Post by rockedge »

@mikewalsh That's right! I had found out about the static builds while working on Zoneminder in Tahr-6.0.5 from a tip and tried it out and it turns out worked great on Tahrpup's and Zoneminder and the other security camera package Shinobi both worked just as expected.

Post Reply

Return to “Beginners Help”