Как кодировать аудио-кодека Opus?

Аудио кодек Opus выглядит как лучшее, что когда-либо для сжатия звука. Недавно он стал поддерживаться в последних ffmpeg и VLC плеерах. Тем не менее, нет документации, которую я могу найти о том, как на самом деле кодировать носители с ним. Может ли кто-нибудь направить меня к указанным документам, предпочтительно со спецификой флагов ffmpeg и использования? У меня есть много аудиокниг, которые занимают слишком много места, и Opus выглядит как идеальный формат для их хранения.

19
задан MrDrMcCoy
05.11.2022 0:27 Количество просмотров материала 2771
Распечатать страницу

2 ответа

ffmpeg -i input -acodec libopus -b:a bitrate -vbr on -compression_level 10 output

документация ffmpeg есть список опций и описаний для libopus.

убедитесь, что вы скомпилировали ffmpeg с --enable-libopus!

26
отвечен Adam Chance 2022-11-06 08:15
  1. скачать Opus-tools

  2. кодирование:

    opusenc --bitrate 64 What_A_Feeling.wav What_A_Feeling_64.opus

  3. декодировать: (для воспроизведения в любом медиаплеере, полезно, если ваш медиаплеер еще не поддерживает opus):

    opusdec What_A_Feeling_64.opus What_A_Feeling_opus64.wav

(What_A_Feeling-это название песни)

подробные параметры, отображаемые при запуске opusenc от себя:

Usage: opusenc [options] input_file output_file.opus

Encodes input_file using Opus.
It can read the WAV, AIFF, FLAC, Ogg/FLAC, or raw files.

General options:
 -h, --help         This help
 -V, --version      Version information
 --quiet            Quiet mode

input_file can be:
  filename.wav      file
  -                 stdin

output_file can be:
  filename.opus     compressed file
  -                 stdout

Encoding options:
 --bitrate n.nnn    Target bitrate in kbit/sec (6-256/channel)
 --vbr              Use variable bitrate encoding (default)
 --cvbr             Use constrained variable bitrate encoding
 --hard-cbr         Use hard constant bitrate encoding
 --comp n           Encoding complexity (0-10, default: 10 (slowest))
 --framesize n      Maximum frame size in milliseconds
                      (2.5, 5, 10, 20, 40, 60, default: 20)
 --expect-loss      Percentage packet loss to expect (default: 0)
 --downmix-mono     Downmix to mono
 --downmix-stereo   Downmix to stereo (if >2 channels)
 --max-delay n      Maximum container delay in milliseconds
                      (0-1000, default: 1000)

Diagnostic options:
 --serial n         Forces a specific stream serial number
 --save-range file  Saves check values for every frame to a file
 --set-ctl-int x=y  Pass the encoder control x with value y (advanced)
                      Preface with s: to direct the ctl to multistream s
                      This may be used multiple times

Metadata options:
 --comment          Add the given string as an extra comment
                      This may be used multiple times
 --artist           Author of this track
 --title            Title for this track
 --album            Album or collection this track belongs to
 --date             Date for this track
 --genre            Genre for this track
 --picture          Album art for this track
                      More than one --picture option can be specified.
                      Either a FILENAME for the picture file or a more
                      complete SPECIFICATION form can be used. The
                      SPECIFICATION is a string whose parts are
                      separated by | (pipe) characters. Some parts may
                      be left empty to invoke default values. A
                      FILENAME is just shorthand for "||||FILENAME".
                      The format of SPECIFICATION is

                      [TYPE]|[MIME-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHT
                      xDEPTH[/COLORS]]|FILENAME

                      TYPE is an optional number from one of:
                      0: Other
                      1: 32x32 pixel 'file icon' (PNG only)
                      2: Other file icon
                      3: Cover (front)
                      4: Cover (back)
                      5: Leaflet page
                      6: Media (e.g., label side of a CD)
                      7: Lead artist/lead performer/soloist
                      8: Artist/performer
                      9: Conductor
                      10: Band/Orchestra
                      11: Composer
                      12: Lyricist/text writer
                      13: Recording location
                      14: During recording
                      15: During performance
                      16: Movie/video screen capture
                      17: A bright colored fish
                      18: Illustration
                      19: Band/artist logotype
                      20: Publisher/studio logotype

                      The default is 3 (front cover). There may only be
                      one picture each of type 1 and 2 in a file.

                      MIME-TYPE is optional. If left blank, it will be
                      detected from the file. For best compatibility
                      with players, use pictures with a MIME-TYPE of
                      image/jpeg or image/png. The MIME-TYPE can also
                      be --> to mean that FILENAME is actually a URL to
                      an image, though this use is discouraged. The
                      file at the URL will not be fetched. The URL
                      itself is stored in the metadata.

                      DESCRIPTION is optional. The default is an empty
                      string.

                      The next part specifies the resolution and color
                      information. If the MIME-TYPE is image/jpeg,
                      image/png, or image/gif, you can usually leave
                      this empty and they can be detected from the
                      file. Otherwise, you must specify the width in
                      pixels, height in pixels, and color depth in
                      bits-per-pixel. If the image has indexed colors
                      you should also specify the number of colors
                      used. If possible, these are checked against the
                      file for accuracy.

                      FILENAME is the path to the picture file to be
                      imported, or the URL if the MIME-TYPE is -->.
 --padding n        Extra bytes to reserve for metadata (default: 512)
 --discard-comments Don't keep metadata when transcoding
 --discard-pictures Don't keep pictures when transcoding

Input options:
 --raw              Raw input
 --raw-bits n       Set bits/sample for raw input (default: 16)
 --raw-rate n       Set sampling rate for raw input (default: 48000)
 --raw-chan n       Set number of channels for raw input (default: 2)
 --raw-endianness n 1 for bigendian, 0 for little (defaults to 0)
 --ignorelength     Always ignore the datalength in Wave headers
13
отвечен Alexey Eromenko 2022-11-06 10:32

Постоянная ссылка на данную страницу: [ Скопировать ссылку | Сгенерировать QR-код ]

Ваш ответ

Опубликуйте как Гость или авторизуйтесь

Имя
Вверх