UJP - ffmpegをいれてYoutubeからダウンロードしたMP4をMP3に変換する

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

  • カテゴリ ハウツー の最新配信
  • RSS
  • RDF
  • ATOM

ブログ - ffmpegをいれてYoutubeからダウンロードしたMP4をMP3に変換する

ffmpegをいれてYoutubeからダウンロードしたMP4をMP3に変換する

カテゴリ : 
ハウツー
ブロガー : 
ujpblog 2018/5/25 0:36
 ffmpegとは動画や音声を変換するツールのスタンダーなやつ.これもbrewで用意されているので入れてみる.まずは情報確認.
MBP2017:Documents ujpadmin$ brew info ffmpeg🆑
ffmpeg: stable 4.0 (bottled), HEAD
Play, record, convert, and stream audio and video
https://ffmpeg.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ffmpeg.rb
==> Dependencies
Build: nasm ✘, pkg-config ✔, texi2html ✘
Recommended: lame ✘, x264 ✘, xvid ✘
Optional: chromaprint ✘, fdk-aac ✘, fontconfig ✔, freetype ✔, frei0r ✘, game-music-emu
 ✘, libass ✘, libbluray ✘, libbs2b ✘, libcaca ✘, libgsm ✘, libmodplug ✘, librsvg ✘, libsoxr ✘, 
libssh ✘, libvidstab ✘, libvorbis ✘, libvpx ✘, opencore-amr ✘, openh264 ✘, openjpeg ✔, 
openssl ✔, opus ✘, rtmpdump ✘, rubberband ✘, sdl2 ✔, snappy ✘, speex ✘, tesseract ✘,
 theora ✘, two-lame ✘, wavpack ✘, webp ✘, x265 ✘, xz ✔, zeromq ✘, zimg ✘
==> Options
--with-chromaprint
	Enable the Chromaprint audio fingerprinting library
--with-fdk-aac
	Enable the Fraunhofer FDK AAC library
--with-fontconfig
	Build with fontconfig support
--with-freetype
	Build with freetype support
--with-frei0r
	Build with frei0r support
--with-game-music-emu
	Build with game-music-emu support
--with-libass
	Enable ASS/SSA subtitle format
--with-libbluray
	Build with libbluray support
--with-libbs2b
	Build with libbs2b support
--with-libcaca
	Build with libcaca support
--with-libgsm
	Build with libgsm support
--with-libmodplug
	Build with libmodplug support
--with-librsvg
	Enable SVG files as inputs via librsvg
--with-libsoxr
	Enable the soxr resample library
--with-libssh
	Enable SFTP protocol via libssh
--with-libvidstab
	Enable vid.stab support for video stabilization
--with-libvorbis
	Build with libvorbis support
--with-libvpx
	Build with libvpx support
--with-opencore-amr
	Enable Opencore AMR NR/WB audio format
--with-openh264
	Enable OpenH264 library
--with-openjpeg
	Enable JPEG 2000 image format
--with-openssl
	Enable SSL support
--with-opus
	Build with opus support
--with-rtmpdump
	Enable RTMP protocol
--with-rubberband
	Enable rubberband library
--with-sdl2
	Enable FFplay media player
--with-snappy
	Enable Snappy library
--with-speex
	Build with speex support
--with-tesseract
	Enable the tesseract OCR engine
--with-theora
	Build with theora support
--with-tools
	Enable additional FFmpeg tools
--with-two-lame
	Build with two-lame support
--with-wavpack
	Build with wavpack support
--with-webp
	Enable using libwebp to encode WEBP images
--with-x265
	Enable x265 encoder
--with-xz
	Enable decoding of LZMA-compressed TIFF files
--with-zeromq
	Enable using libzeromq to receive commands sent through a libzeromq client
--with-zimg
	Enable z.lib zimg library
--without-gpl
	Disable building GPL licensed parts of FFmpeg
--without-lame
	Disable MP3 encoder
--without-qtkit
	Disable deprecated QuickTime framework
--without-securetransport
	Disable use of SecureTransport
--without-x264
	Disable H.264 encoder
--without-xvid
	Disable Xvid MPEG-4 video encoder
--HEAD
	Install HEAD version
MBP2017:Documents ujpadmin$
 やはりモノがモノだけに,関連パッケージもコンパイルオプションもたくさん.何も指定せずにダウンロード.
MBP2017:Documents ujpadmin$ brew install ffmpeg🆑
==> Installing dependencies for ffmpeg: lame, x264, xvid
==> Installing ffmpeg dependency: lame
==> Downloading https://homebrew.bintray.com/bottles/lame-3.100.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring lame-3.100.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/lame/3.100: 27 files, 2.1MB
==> Installing ffmpeg dependency: x264
==> Downloading https://homebrew.bintray.com/bottles/x264-r2854.high_sierra.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring x264-r2854.high_sierra.bottle.1.tar.gz
🍺  /usr/local/Cellar/x264/r2854: 11 files, 3.4MB
==> Installing ffmpeg dependency: xvid
==> Downloading https://homebrew.bintray.com/bottles/xvid-1.3.5.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring xvid-1.3.5.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/xvid/1.3.5: 10 files, 1.2MB
==> Installing ffmpeg
==> Downloading https://homebrew.bintray.com/bottles/ffmpeg-4.0.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring ffmpeg-4.0.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/ffmpeg/4.0: 246 files, 49.6MB
MBP2017:Documents ujpadmin$
 先ほどダウンロードしたMP4ファイルから,MP3データを取り出す.
MBP2017:Documents ujpadmin$ ffmpeg -i *.mp4 -f mp3 BlueSkyBlue.mp3🆑
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads
 --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang
 --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264
 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '西城秀樹  ブルースカイ ブルー-9L3LJqhyfFY.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2018-05-17T06:26:47.000000Z
  Duration: 00:04:38.43, start: 0.000000, bitrate: 964 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 946x720
 [SAR 1:1 DAR 473:360], 834 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2018-05-17T06:26:47.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 05/16/2018.
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      creation_time   : 2018-05-17T06:26:47.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 05/16/2018.
Stream mapping:
  Stream #0:1 -> #0:0 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to 'BlueSkyBlue.mp3':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    TSSE            : Lavf58.12.100
    Stream #0:0(und): Audio: mp3 (libmp3lame), 44100 Hz, stereo, fltp (default)
    Metadata:
      creation_time   : 2018-05-17T06:26:47.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 05/16/2018.
      encoder         : Lavc58.18.100 libmp3lame
size=    4351kB time=00:04:38.44 bitrate= 128.0kbits/s speed=51.2x
video:0kB audio:4351kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.007766%
MBP2017:Documents nob
 変換完了.変換時間は,コンピュータの性能によるかな.

トラックバック


広告スペース
Google