ffmpeg

Leejaegun·2025년 4월 1일

Python & etc

목록 보기
20/27

✅ ffmpeg 명령어에서 사용된 약자(옵션들) 설명:

🎥 영상 다운로드용 명령어

ffmpeg -i "URL" -c copy output.mp4
  • -i: input
    → 입력 파일이나 URL을 지정할 때 사용

  • -c copy: codec copy
    → 비디오와 오디오 모두 재인코딩 없이 원본 그대로 복사해서 저장 (빠르고 화질 손실 없음)

🎧 오디오만 추출 (WAV)

ffmpeg -i "URL" -vn -acodec pcm_s16le -ar 44100 -ac 2 output.wav
  • -vn: video none
    → 비디오 스트림을 제외 (오디오만 추출)

  • -acodec pcm_s16le:
    pcm_s16leWAV 포맷에서 사용하는 무압축 16비트 리틀 엔디언 오디오 코덱
    (CD 음질과 동일)

  • -ar 44100: audio rate 44100Hz
    → 오디오 샘플링 레이트, 일반적인 CD 품질 오디오는 44.1kHz

  • -ac 2: audio channels = 2
    스테레오 (좌우 두 채널)

🎶 MP3로 추출하고 싶을 때

ffmpeg -i "URL" -vn -codec:a libmp3lame -qscale:a 2 output.mp3
  • -codec:a libmp3lame:
    MP3 인코딩을 위한 코덱libmp3lame 사용

  • -qscale:a 2:
    → MP3 음질 조절 (0~9 사이 숫자, 낮을수록 고음질)
    2는 일반적으로 고음질과 용량 균형이 좋은 값


✅ What is .m3u8?

📁 .m3u8 is a playlist file format used in streaming video, especially for HLS (HTTP Live Streaming).

🔤 What does "m3u8" stand for?

약자의미
MMPEG (Moving Picture Experts Group – video format)
3UComes from M3U: "MP3 URL" or "Moving Picture URL" (originally for audio playlists)
8Refers to UTF-8 encoding

📌 So, .m3u8 = an M3U playlist file encoded in UTF-8

📚 Background

  • Originally, .m3u was used for MP3 audio playlists
  • .m3u8 is the UTF-8 version, and it's now heavily used in HLS video streaming
  • It contains a list of media segment URLs (.ts files), not the actual video itself

🧠 Summary

  • .m3u8 is a playlist file for streaming video/audio
  • It tells the video player where to find video chunks
  • Common in adaptive bitrate streaming (adjusts video quality dynamically)

📦 Example .m3u8 Content

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXTINF:10,
chunk1.ts
#EXTINF:10,
chunk2.ts
...

Each chunk.ts is a small piece of the full video, and the player downloads them in order while streaming.

profile
Lee_AA

0개의 댓글