Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

How to scan audio codecs with ffmpeg

Featured Replies

  • Author
  • Localization

aluigi, posted Thu Aug 07, 2014 5:02 pm (29)


Sometimes you may have a file containing raw compressed audio.

Some audio codecs are easy to recognize because they use signatures (wma, mp3, ogg) and are supported by many programs.

But sometimes it may be difficult, moreover if it's an adpcm algorithm which is not the usual ima-adpcm.

The following is an helpful script for quickbms:
Code:
# adpcm_4xm
# adpcm_adx
# adpcm_afc
# adpcm_ct
# adpcm_dtk
# adpcm_ea
# adpcm_ea_maxis_xa
# adpcm_ea_r1
# adpcm_ea_r2
# adpcm_ea_r3
# adpcm_ea_xas
# adpcm_g722
# adpcm_g726
# adpcm_g726le
# adpcm_ima_amv
# adpcm_ima_apc
# adpcm_ima_dk3
# adpcm_ima_dk4
# adpcm_ima_ea_eacs
# adpcm_ima_ea_sead
# adpcm_ima_iss
# adpcm_ima_oki
# adpcm_ima_qt
# adpcm_ima_rad
# adpcm_ima_smjpeg
# adpcm_ima_wav
# adpcm_ima_ws
# adpcm_ms
# adpcm_sbpro_2
# adpcm_sbpro_3
# adpcm_sbpro_4
# adpcm_swf
# adpcm_thp
# adpcm_vima
# adpcm_xa
# adpcm_yamaha

set MAX_OUTPUT_SECONDS long 3
set INPUT string "%1"
for
    get CODEC line
    if CODEC & "#"
        string CODEC R= "#" ""
        string CODEC R= " " ""
        print "ffmpeg -acodec %CODEC% -ac 2 -vn -f data -i %INPUT% -t %MAX_OUTPUT_SECONDS% %CODEC%.wav"
    else
        cleanexit
    endif
next

Now try to launch the script with quickbms from command-line dumping its content in a bat file:
Code:
quickbms script.bms script.bms > scan.bat

And then launch the bat:
Code:
scan.bat myfile.adpcm

It will create a bat file that automatically launch ffmpeg to convert the input file in a 16bit pcm file.

Unfortunately it's not possible to force the number of channels with ffmpeg if the input file has an header, while instead it's possible with ffplay.

Anyway if you want to force a certain number of channels you must add the -ac option, for example "-ac 1" for mono.

Technically the script is quite interesting, basically it reads its comments and use them to create the necessary command.

*edit* added "-ac 2 -vn -f data"
  • Author
  • Localization

raykingnihong, posted Wed Dec 24, 2014 10:25 am (2280)


Hi aluigi my good friend, very good tutorial and script, thanks for sharing
  • Author
  • Localization

aluigi, posted Tue Jul 21, 2015 9:29 pm (6519)


Just an update.
I guess that the current version of ffmpeg no longer works with that command-line and even adding other options doesn't change the situation.
I'm really disappointed by ffmpeg that is impossible to configure.
  • Author
  • Localization

AnonBaiter, posted Sun Sep 11, 2016 11:28 pm (17423)


"Output file #0 does not contain any stream"
What should I do if ffmpeg doesn't support audio files that doesn't have any headers?
  • Author
  • Localization

aluigi, posted Thu Sep 15, 2016 7:26 am (17455)


The "-f data" option forces ffmpeg to work on raw data.
I guess that error is caused by a codec that requires some specific headers (even in raw mode?) or specific options to set some parameters.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.