HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - Tech => Topic started by: HelghastG75 on 2021-04-17 02:34:15

Title: How to convert a whole directory with various formats to OGG through ffmpeg.
Post by: HelghastG75 on 2021-04-17 02:34:15
How to convert a whole directory with various formats to OGG 192kbps through ffmpeg? I tried all solutions in internet but they didnt worked for me or i dont understand them. I would like to make a batch file for that. Any suggestions? For any help i'll be grateful.
Title: Re: How to convert a whole directory with various formats to OGG through ffmpeg.
Post by: Markuza97 on 2021-04-17 20:56:20
for /r %a in (*.*) do ffmpeg -i "%a" -acodec libvorbis -q:a 6 -f oga "%~pna.ogg"

Use '%%a' instead of '%a' in batch file.
Add '-y' switch if you want to overwrite existing ogg files.
Add '& del "%a"' if you want to delete original files.
Title: Re: How to convert a whole directory with various formats to OGG through ffmpeg.
Post by: HelghastG75 on 2021-04-17 23:31:48
I created a batch file with as explained above but it doesn't seem to work when i click on it. Where i have to place that batch file? That's what exist in that file: for /r %%a in (*.*) do ffmpeg -i "%%a" -acodec libvorbis -q:a 6 -f oga "%~pna.ogg"
Title: Re: How to convert a whole directory with various formats to OGG through ffmpeg.
Post by: Porcus on 2021-04-18 09:56:29
The last percent sign needs to be doubled too.
Title: Re: How to convert a whole directory with various formats to OGG through ffmpeg.
Post by: jaybeee on 2021-04-18 11:56:18
plus ffmpeg will need to be in your path, otherwise you'll need to set it's location in the batch script and reference it accordingly.
Title: Re: How to convert a whole directory with various formats to OGG through ffmpeg.
Post by: HelghastG75 on 2021-04-19 13:43:09
OMG Thanks it helped.
Title: Re: How to convert a whole directory with various formats to OGG through ffmpeg.
Post by: HelghastG75 on 2021-04-19 22:22:43
But i got another question, how to convert using CBR and bitrate 192kbps?
Title: Re: How to convert a whole directory with various formats to OGG through ffmpeg.
Post by: jaybeee on 2021-04-19 23:35:14
https://ffmpeg.org/ffmpeg-codecs.html#libvorbis

so presumably something like: -b:a 192
Title: Re: How to convert a whole directory with various formats to OGG through ffmpeg.
Post by: HelghastG75 on 2021-04-20 10:09:37
I want constant 192kbps this method it gives various bitrate.
Title: Re: How to convert a whole directory with various formats to OGG through ffmpeg.
Post by: jaybeee on 2021-04-20 12:26:00
A constant bitrate with Vorbis is not possible.

"Vorbis is a free-form variable bit rate (VBR) codec and packets have no minimum size, maximum size, or fixed/expected size." source: Vorbis specification (https://www.xiph.org/vorbis/doc/Vorbis_I_spec.html)
SimplePortal 1.0.0 RC1 © 2008-2021