Vargol / ffmpeg-apple-arm64-build

Build script for ffmpeg targeting the latest open source video codecs running on macOS using Apple's M1 processor.
221 stars 38 forks source link

How I add support for flac codec? #2

Closed zjns closed 2 years ago

zjns commented 2 years ago

I want to add flac codec, how I should do?

Vargol commented 2 years ago

It should be already in there as part of libavcodec.

build-ffmpeg % out/bin/ffmpeg -encoders 2>/dev/null | grep flac
 A..... flac                 FLAC (Free Lossless Audio Codec)
build-ffmpeg % out/bin/ffmpeg -i test-opus.opus -c:a flac output.flac
Stream mapping:
  Stream #0:0 -> #0:0 (opus (native) -> flac (native))
Press [q] to stop, [?] for help
[flac @ 0x12f879200] encoding as 24 bits-per-sample
Output #0, flac, to 'output.flac':
  Metadata:
    encoder         : Lavf58.76.100
    WAVEFORMATEXTENSIBLE_CHANNEL_MASK: 0x3f
  Stream #0:0(ger): Audio: flac, 48000 Hz, 5.1, s32 (24 bit), 128 kb/s
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      compatible_brands: isomiso2avc1mp41
      major_brand     : isom
      minor_version   : 512
      encoder         : Lavc58.134.100 flac
size=    1691kB time=00:00:04.88 bitrate=2835.3kbits/s speed=  81x    
video:0kB audio:1683kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.483429%
build-ffmpeg % file output.flac 
output.flac: FLAC audio bitstream data, 24 bit, 6 channels, 48 kHz, 234496 samples
zjns commented 2 years ago

It should be already in there as part of libavcodec.

build-ffmpeg % out/bin/ffmpeg -encoders 2>/dev/null | grep flac
 A..... flac                 FLAC (Free Lossless Audio Codec)
build-ffmpeg % out/bin/ffmpeg -i test-opus.opus -c:a flac output.flac
Stream mapping:
  Stream #0:0 -> #0:0 (opus (native) -> flac (native))
Press [q] to stop, [?] for help
[flac @ 0x12f879200] encoding as 24 bits-per-sample
Output #0, flac, to 'output.flac':
  Metadata:
    encoder         : Lavf58.76.100
    WAVEFORMATEXTENSIBLE_CHANNEL_MASK: 0x3f
  Stream #0:0(ger): Audio: flac, 48000 Hz, 5.1, s32 (24 bit), 128 kb/s
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      compatible_brands: isomiso2avc1mp41
      major_brand     : isom
      minor_version   : 512
      encoder         : Lavc58.134.100 flac
size=    1691kB time=00:00:04.88 bitrate=2835.3kbits/s speed=  81x    
video:0kB audio:1683kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.483429%
build-ffmpeg % file output.flac 
output.flac: FLAC audio bitstream data, 24 bit, 6 channels, 48 kHz, 234496 samples

Thank you for your reminder. I just looked at the readme document and didn't notice this.