Skip to content

Instantly share code, notes, and snippets.

@Sarjuuk Sarjuuk/convert.sh
Last active Mar 26, 2018

Embed
What would you like to do?
[*NIX] audio file conversion using ffmpeg - deletes after conversion
#!/bin/bash
find -name "*.wav" | xargs -I % sh -c 'ffmpeg -hide_banner -y -i "%" -acodec libvorbis -f ogg "%_"; rm "%";' && find -name "*.mp3" | xargs -I % sh -c 'ffmpeg -hide_banner -y -i "%" -acodec libmp3lame -f mp3 "%_"; rm "%";'
@Playon24

This comment has been minimized.

Copy link

Playon24 commented May 8, 2017

...-hide_banner -y -i "%" -f mp3 -acodec libmp3lame... i think you missed the -f flag

@Sarjuuk

This comment has been minimized.

Copy link
Owner Author

Sarjuuk commented May 8, 2017

indeed... ~.~

@Dainara82

This comment has been minimized.

Copy link

Dainara82 commented Oct 22, 2017

it doesn't work i allways get this messages

Guessed Channel Layout for Input Stream #0.0 : mono Input #0, wav, from './sound/emitters/emitter_dalaran_petstore_puppy_01.wav': Duration: 00:00:01.71, bitrate: 353 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s [NULL @ 0x558684d7e960] Unable to find a suitable output format for './sound/emitters/emitter_dalaran_petstore_puppy_01.wav_' ./sound/emitters/emitter_dalaran_petstore_puppy_01.wav_: Invalid argument

Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, wav, from './sound/emitters/emitter_icecrownraidtowers.wav': Duration: 00:01:05.71, bitrate: 705 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, stereo, s16, 705 kb/s [NULL @ 0x55eccbd9eb60] Unable to find a suitable output format for './sound/emitters/emitter_icecrownraidtowers.wav_' ./sound/emitters/emitter_icecrownraidtowers.wav_: Invalid argument

@Sarjuuk

This comment has been minimized.

Copy link
Owner Author

Sarjuuk commented Mar 26, 2018

yeah, command was missing a -f ogg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.