TL;DR version
use
Code: Select all
ffmpeg -v error -i INFILE -b:a 128K -vn OUTFILE.mp3
Use
Code: Select all
ffprobe -hide_banner INFILE
Know that "-v error" suppresses all output that are not errors (like the banner) - when you want to see all that omit "-v error" e.g. by using simply
Code: Select all
ffmpeg -i INFILE -b:a 128K -vn OUTFILE.mp3
Long version with the weirdness that is mp3con.sh:
I found a script that does that and it needs only ffmpeg and lame - both are already installed on your Port 4.* or 5.0 system.
Get the script via
Code: Select all
wget https://raw.githubusercontent.com/jmutai/dotfiles/master/scripts/mp3con.sh
The website describing it is this: https://computingforgeeks.com/how-to-co ... -on-linux/
What I dislike with mp3con.sh: it asks for the folder to convert, and then converts all mp4/mpv/WebM in that folder, but maybe you only want to convert a certain file, or you already have mp3 versions of some mp4/mpv/WebM files in that directory, mp3con.sh would again convert all the mp4/mpv/WebM files from that folder into mp3.
So, realizing that I created a "mp3con.sh.CONVERT/" folder and only copied one file - a webm - into that I wanted converted - I wanted to see how mp3con.sh does its work prior examining its code and possibly using some snippet for a conversion script - to create one that can be run e.g. as
Code: Select all
mp3convert 1.webm 2.mpv
Code: Select all
mp3convert .
Code: Select all
mp3convert /path/
EDIT
While mp3con.sh definitely did convert something, the target file is not to be found. Look for yourself:
Code: Select all
guest@porteus:/mysound/WhiteNoise/mp3con.sh.CONVERT$ ls -l
total 56976
-rw-r--r-- 1 guest users 58278950 Feb 15 2022 Vintage\ 70s\ Hoover\ Convertible\ ASMR\ _\ Retro\ White\ Noise\ for\ Sleeping,\ Focus\ _\ 1\ HOUR-gWWCInm-SDw.c1.webm
guest@porteus:/mysound/WhiteNoise/mp3con.sh.CONVERT$ mp3con.sh
1: Current directory
2: Provide directory
Selection : 1
Okay..
Current dir is /mysound/WhiteNoise/mp3con.sh.CONVERT
ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11.2.0 (GCC)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/doc/-4.4.1/html --mandir=/usr/man --disable-debug --enable-shared --disable-static --enable-gpl --enable-libaom --enable-version3 --enable-avresample --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gnutls --enable-libbluray --enable-libcdio --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libmp3lame --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libpulse --enable-libsmbclient --enable-pthreads --enable-postproc --enable-swscale --enable-avfilter --enable-libopus --enable-libspeex --enable-openal --enable-libass --enable-libx264 --enable-libx265 --enable-libgsm --enable-libxvid --enable-libtwolame --enable-libopencore-amrnb --'mp3con.sh.CONVERT-mp3/./Vintage 70s Hoover Convertible ASMR _ Retro White Noise for Sleeping, Focus _ 1 HOUR-gWWCInm-SDw.c1.webm.mp3'enable-libopencore-amrwb --enable-libgsm --enable-nvdec --enable-librtmp
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Input #0, matroska,webm, from './Vintage 70s Hoover Convertible ASMR _ Retro White Noise for Sleeping, Focus _ 1 HOUR-gWWCInm-SDw.c1.webm':
Metadata:
ENCODER : Lavf58.76.100
Duration: 01:03:39.42, start: -0.006000, bitrate: 122 kb/s
Stream #0:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Metadata:
DURATION : 01:03:39.421000000
Stream mapping:
Stream #0:0 -> #0:0 (opus (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to 'mp3con.sh.CONVERT-mp3/./Vintage 70s Hoover Convertible ASMR _ Retro White Noise for Sleeping, Focus _ 1 HOUR-gWWCInm-SDw.c1.webm.mp3':
Metadata:
TSSE : Lavf58.76.100
Stream #0:0(eng): Audio: mp3, 48000 Hz, stereo, fltp, 320 kb/s (default)
Metadata:
DURATION : 01:03:39.421000000 'mp3con.sh.CONVERT-mp3/./Vintage 70s Hoover Convertible ASMR _ Retro White Noise for Sleeping, Focus _ 1 HOUR-gWWCInm-SDw.c1.webm.mp3'
encoder : Lavc58.134.100 libmp3lame'mp3con.sh.CONVERT-mp3/./Vintage 70s Hoover Convertible ASMR _ Retro White Noise for Sleeping, Focus _ 1 HOUR-gWWCInm-SDw.c1.webm.mp3'
size= 149198kB time=01:03:39.41 bitrate= 320.0kbits/s speed= 25x
video:0kB audio:149198kB subtitle:0kB other streams:0kB glob'mp3con.sh.CONVERT-mp3/./Vintage 70s Hoover Convertible ASMR _ Retro White Noise for Sleeping, Focus _ 1 HOUR-gWWCInm-SDw.c1.webm.mp3'al headers:0kB muxing overhead: 0.000658%
All files converted successfully
guest@porteus:/mysound/WhiteNoise/mp3con.sh.CONVERT$ ls -oa
total 56984
drwxr-xr-x 2 guest 4096 2022-09-14 00:32 .
drwxr-xr-x 3 guest 4096 2022-09-14 00:29 ..
-rw-r--r-- 1 guest 58278950 2022-02-15 11:34 Vintage\ 70s\ Hoover\ Convertible\ ASMR\ _\ Retro\ White\ Noise\ for\ Sleeping,\ Focus\ _\ 1\ HOUR-gWWCInm-SDw.c1.webm

Seems lazy butt me cannot simple run mp3con.sh and have the file I wanted converted, well, converted, when the target file is not to be found.

Added in 17 minutes 29 seconds:
Update 2
Looking into its code, I found where it put the file - it put it into ~/Music/mp3con.sh.CONVERT-mp3/ without telling the user about that.
Code: Select all
# Move audio directory to ~/Music
if [[ ! -d ~/Music ]]; then
mkdir ~/Music
fi
cd ..
mv "$base_name"-mp3 ~/Music/
Having to read a script's source code to find the resulting converted files is in my book a no-no.
What do you folks think?
Added in 8 minutes :
And another thing I dislike about how mp3con.sh handles things - it converts all files using 320K bitrates - which creates a quite large target file, but in my case the source file only has
Code: Select all
Duration: 01:03:39.42, start: -0.006000, bitrate: 122 kb/s
Stream #0:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
For now, I first use my own "Multimedia File Info" Thunar add-on to give me the bitrate details of the source file and adjust the conversion line manually, e.g. from what mp3con.sh uses
Code: Select all
ffmpeg -i INFILE -b:a 320K -vn OUTFILE.mp3
Code: Select all
ffmpeg -i INFILE -b:a 128K -vn OUTFILE.mp3