Tag: Video

  • How to Use FFmpeg to Extract Audio from Video File Without Re-encoding

    Try -c copy:

    $ ffmpeg -i video.mp4 -c copy audio.aac
    

    How ever you have to know the original audio format to extract audio without re-encoding, for example:

    $ ffmpeg -i video.mp4
    ...
      Metadata:
        major_brand     : isom
        minor_version   : 1
        compatible_brands: isomavc1
        creation_time   : 2015-01-17 20:39:33
      Duration: 00:23:59.94, start: 0.000000, bitrate: 1983 kb/s
        Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1787 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
        Metadata:
          creation_time   : 2015-01-17 20:39:33
          handler_name    : 264:[email protected]
        Stream #0:1(jpn): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s (default)
        Metadata:
          creation_time   : 2015-01-17 15:55:11
          handler_name    : Sound Media Handler
    ...
    

    Then you should know what format and which track to extract.

  • 从 MKV 封装中 Demux FLAC 音频备忘

    MKV 封装的文件中 FLAC 音轨无法用 mkvextract 的 GUI 直接提取,提取时会提示无法提取此类文件,但在官方 doc 中这样提到:

    –no-ogg: Only valid for FLAC tracks. Normally FLAC tracks are embedded in an Ogg transport stream. With this switch they are extracted to raw FLAC files instead.

    于是:

    mkvextract.exe tracks track.mkv --no-ogg 2:output.flac