Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash: Adjust ffmpeg code to avconv format #357

Closed
jeff1evesque opened this issue Jul 27, 2014 · 2 comments
Closed

Bash: Adjust ffmpeg code to avconv format #357

jeff1evesque opened this issue Jul 27, 2014 · 2 comments

Comments

@jeff1evesque
Copy link
Owner

@jeff1evesque jeff1evesque commented Jul 27, 2014

Since we are now using avconv, we will need to adjust converter_wav_rate to use the avconv syntax rather than the current ffmpeg command:

ffmpeg -i ../audio/recording/"$file" -acodec pcm_s16le -ac 1 -ar 16000 -y ../audio/recording_converted/"$filename"
@jeff1evesque
Copy link
Owner Author

@jeff1evesque jeff1evesque commented Jul 29, 2014

The ffmpeg command can be replaced with avconv, along with the appropriate flags, which is almost identical:

IRC #ubuntu (07/29/14 ~ 9:20pm EST):

jeffreylevesque: i keep finding that everyone uses ffmpeg - https://www.google.com/?gws_rd=ssl#q=libav+convert+wav+to+16+bit+mono+16+kHz
jeffreylevesque: why did ubuntu switch to libav?

Pici: jeffreylevesque: because debian switched to libav.

k1l_: jeffreylevesque: because debian did.

IRC #libav (07/29/14 ~ 9:20pm EST):

jeffreylevesque: I updated my Ubuntu 11.04 to Ubuntu 14.04. I couldn't install ffmpeg as the system suggested me to install avconv
jeffreylevesque: could someone assist me with the equivalent code in 'avconv' - #357

koda: jeffreylevesque: umh it works as is with ffmpeg replaced with avconv

jeffreylevesque: koda, will avconv -i ../audio/recording/"$file" -acodec pcm_s16le -ac 1 -ar 16000 -y ../audio/recording_converted/"$filename" work?

koda: it works here :)

@jeff1evesque
Copy link
Owner Author

@jeff1evesque jeff1evesque commented Jul 29, 2014

The output of the conversion parameter needs an extension. The following example demonstrates this need:

$ avconv -i pocketsphinx/audio/sample.wav -acodec pcm_s16le -ac 1 -ar 16000 -y delete
avconv version 9.14-6:9.14-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Jul 15 2014 13:57:40 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
[wav @ 0x197ffe0] max_analyze_duration reached
Guessed Channel Layout for  Input Stream #0.0 : mono
Input #0, wav, from 'pocketsphinx/audio/sample.wav':
  Duration: 00:00:11.49, bitrate: 256 kb/s
    Stream #0.0: Audio: pcm_s16le, 16000 Hz, mono, s16, 256 kb/s
Unable to find a suitable output format for 'delete'

However, if include the extension, it works:

$ avconv -i pocketsphinx/audio/sample.wav -acodec pcm_s16le -ac 1 -ar 16000 -y delete.wav
avconv version 9.14-6:9.14-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Jul 15 2014 13:57:40 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
[wav @ 0x684020] max_analyze_duration reached
Guessed Channel Layout for  Input Stream #0.0 : mono
Input #0, wav, from 'pocketsphinx/audio/sample.wav':
  Duration: 00:00:11.49, bitrate: 256 kb/s
    Stream #0.0: Audio: pcm_s16le, 16000 Hz, mono, s16, 256 kb/s
Output #0, wav, to 'delete.wav':
  Metadata:
    ISFT            : Lavf54.20.4
    Stream #0.0: Audio: pcm_s16le, 16000 Hz, mono, s16, 256 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le -> pcm_s16le)
Press ctrl-c to stop encoding
size=     359kB time=11.50 bitrate= 256.1kbits/s    
video:0kB audio:359kB global headers:0kB muxing overhead 0.021203%

Note: sample.wav is already properly configured to 16 bit, 16 kHz, mono.

acc119d: We adjust converter_wav_rate such that the audio file properly reconfigures, and is saved without a file extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant