HamoniKR 7.0
  • 하모니카 사용자 가이드
  • 목차
  • 설치하기
    • 하모니카 6.0에서 7.0으로 업그레이드
    • 하모니카에서 부팅 USB 제작
      • Ventoy 부팅 USB만들기
      • USB 이미지 라이터로 부팅 USB 만들기
    • 하모니카 설치
    • 윈도우와 하모니카 멀티부팅 설치
    • 기타 설치 관련 정보
  • 추천!! (Recommendation)
    • 한글문서 편집하기 (LibreofficeHWP)
    • Barrier
    • 애플릿(Sync)
    • 손쉬운 Git 관리.
      • RabbitVCS Git (Git 클라이언트)
      • BFG Repo-Cleaner
    • 기기간 파일 전송 프로그램(warpinator)
    • Albert (데스크탑 검색 및 런처 )
    • 미디어 다운로더(mediaDownloader)
    • Asbru-cm (SSH-client)
    • 나만의 ISO 만들기(Systemback)
    • 시스템 및 서비스 관리(Stacer)
    • 프린터 연결
      • 하모니카 프린터 설정 가이드
    • 커널 업그레이드 도구 mainline
  • AI로 나만의 이미지 생성
    • Upscayl (AI 이미지)
    • Stable-diffusion
      • 스테이블 디퓨전 학습 모델 추가하기
    • Microsoft Edge & Bing AI
  • Ubuntu에서 하모니카(Hamonikr)로 업그레이드
    • 업그레이드 방법
  • 주요 기능(Main Functions)
    • "환영합니다" 애플리케이션
      • 카카오톡(kakaotalk)
    • 바탕화면 주요 기능 및 도구(Desktop)
      • 데스크톱 사용 환경을 선택할 수 있는 스타일 전환 기능(Desktop_Theme)
      • 모니터링 도구 Conky
      • 마우스 제스처를 지원하는 스마트 패널 기능
      • 하단 메뉴바(dock) Plank
      • HiDPI 디스플레이 설정
    • 파일 및 폴더 관리
      • 동영상 파일을 gif 이미지로 변환
      • 즐겨찾기 및 책갈피, 핀(bookmark)
      • 네트워크 드라이브 연결하기
      • ISO 파일 - 체크섬
      • ISO 파일 - 마운트하기
      • 폴더 및 파일 비교
      • 유용한 이미지 관리
        • Convert-svg
      • 폴더 공유
      • 인코딩 깨진 파일명 복구
      • 파일 상세 검색
        • 마우스에서 상세검색
        • 파일 탐색기 창에서 상세 검색하기.
        • 여러개의 파일이름을 변경할때
    • 시스템 백업 및 복구 도구
      • fsarchive (GUI 사용법) - 메뉴얼 재작성
      • fsarchiver (터미널 사용법) - 메뉴얼 제작성
    • 부팅 USB 제작 도구
      • BalenaEcther - 부팅 USB 제작 도구
      • Ventoy - 부팅 USB 제작 도구
      • 쓰기 가능한 부팅 USB 제작 Live USB Creator
    • HamoniKR TUI(터미널)
      • hamonikr-ff (fzf and bat features)
      • 기본 터미널 Zsh 적용
      • Hamonikr-cli-tools
      • ncdu (disk usage analysis)
      • systemd-tui (systemd service management tui)
    • Game
      • 리그오브레전드(LOL) 설치
      • 배틀넷(battleNet) 설치
    • 부팅 메뉴 선택기 프로그램
      • 부팅 메뉴 선택기 boot-select
    • 백신(Ahnlab-v3lite)
      • 하모니카 OS 사용가능한 백신들
      • 하모니카에서 바이러스 백신 사용하기
  • 다양한 하모니카 활용팁
    • 하모니카 그래픽 드라이버 재설치하기
    • 하모니카 CLI tools
      • icdiff (color diff)
      • jq (json parser)
      • D2Coding Regular font (Korean font)
      • remote-share-cli (easy file share to remote)
      • speedtest-cli (network speed benchmark)
      • w3m (terminal web browser)
      • mtr (traceroute)
      • network-manager nmtui (network setting tui)
      • mc (terminal file manager)
      • tldr (manual for command)
      • starship (mordern prompt for shell)
      • htop (process viewer)
      • glances (system monitoring tool)
      • lazydocker (TUI for both docker and docker-compose)
      • tmux (terminal multiplexer)
      • ttyd (Share terminal over the web)
      • aria2 (download utility - HTTP/HTTPS, FTP, SFTP, BitTorrent, Metalink)
      • asciinema (Record and share terminal sessions)
      • neofetch (show system infomation)
      • s-search (web-search-cli)
    • 하모니카 호환 SW 및 플랫폼
    • 하모니카 OS 포터블 리눅스 제작하는 법
    • 하모니카 리눅스 Teamviewer 원격관리
    • 하모니카 리눅스 텔레그램 메신져
    • 윈도우 PC 원격데스크톱 접속하기
    • 하모니카 PC 크롬 원격 데스크톱 접속 기능 사용하기
    • 하모니카 리눅스에서 게임하기
    • 하모니카 리눅스에서 flatpak 으로 프로그램 설치 하는 방법
    • 하모니카 리눅스 VPN 사용
    • 하모니카 PC 에서 네트워크 스캐너 사용하기
    • 속도 최적화 및 디스크 정리
    • VirtualBox 사용하기
    • 하모니카 커널 변경 방법
    • 하모니카 리눅스 원격 데스크탑 접속
    • 하모니카에서 폴더 암호화 사용
    • 하모니카에서 전자칠판 사용하기
    • 서버 모니터링 프로그램 bashtop
    • ffmpeg 사용법 - 동영상에서 음성추출하기, 동영상 변환
    • 동영상에서 자동으로 자막추출 Vrew
    • 음성파일 자르기 audacity
    • 클립보드 매니저 CopyQ
    • /target/에 'grub-efi-amd64-signed' 패키지를 설치하는 데 실패했습니다
    • USB에 설치된 하모니카로 크롬북처럼 사용하기
    • Github CLI 사용법
    • 하모니카에서 주민등록등본, 4대보험가입증명서 출력하기
    • 하모니카로 홈시어터를 구축하는 방법
    • 구글 크롬 설치
    • 유튜브, Vimeo 동영상 파일 저장하기 - ClipGrab
    • FTP 클라이언트 프로그램 설치 및 사용 - FileZilla
    • 음악 플레이어 - Audacious (오데이셔스)
    • 토렌트 프로그램 추천 - qbittorrent
    • 스티커 메모 프로그램 Xpad
    • 여러개 ISO 파일을 담는 부팅 USB 제작 프로그램 Ventoy
    • 안드로이드 에뮬레이터 Genymotion
    • 데스크톱 원문 검색 프로그램 recoll
    • 음악 플레이어 Lollypop
    • 시스템 사용시간 모니터링 ActivityWatch
    • 로컬 네트워크 서비스 탐색 도구 avahi
    • 자막 편집 프로그램 Subtitld
    • 파일명 일괄변경 프로그램 GPRename
    • z shell 매뉴얼
    • Motrix 매뉴얼
    • 로그 기록 프로그램 gnome-log(기록)
    • 문자 표
    • 웹 앱 (webapp-manager)
    • 가상 키보드 & 온보드(OnBoard)
    • Duck DNS 사용하기 (동적 DNS)
    • 개발 도움말
    • Poedit
    • BleachBit 불필요한 데이터 제거
    • 국내 오픈소스 개발자(@kuroehanako) 님의 아이콘 적용
    • 국내 오픈소스 개발자(@orioncactus) 님의 글꼴 적용
    • 한글 가사를 지원하는 뮤직 플레이어 롤리팝 제공
  • 시작 메뉴
    • 개발
      • Meld
      • Visual Studio Code
      • 글레이드
    • 게임
      • 고전게임(dosbox)
    • 보조 프로그램
      • balenaEtcher
      • Conky 설정도구, 온/오프
      • Shutter
      • SSH Client
      • USB 이미지 쓰기
      • USB 포맷
      • Ventoy 부팅 USB 제작
      • Vim
      • 가상 키보드(OnBoard)
      • 계산기
      • 기기간 파일전송 (Warpinator)
      • 글꼴
      • 노트
      • 문자 표
      • 부팅 메뉴 선택기(boot-select)
      • 스크린샷
      • 시계
      • 알집
      • 스티커 메모
      • 암호 및 키 관리
      • 압축 관리자
      • 터미널
      • 텍스트 편집기 (xed)
      • 파일
    • 오피스
      • LibreOffice
      • LibreOffice Base
      • LibreOffice Calc
      • LibreOffice Draw
      • LibreOffice impress
      • LibreOffice Math
      • LibreOffice Writer
      • MS 오피스
      • PDF 뷰어
      • 달력
      • 라이브러리
    • 음악과 비디오
      • IPTV 보기
      • Kazam
      • Kodi (코디)
      • OBS Studio
      • VLC 미디어 플레이어
      • 멀티미디어 코덱 설치
      • 뮤직 플레이어 롤리팝
      • 미디어 플레이어 (Celluloid)
    • 인터넷
      • Filezilla
      • Google Chrome
      • Naver Whale
      • Remmina
      • Slack
      • Thunderbird 메일
      • Zoom
      • 토렌트 클라이언트
      • 하모니카 드라이브
    • 관리
      • Htop
      • VirtualBox
      • 드라이버 매니저
      • 디스크
      • 디스크 사용량 분석
      • 로그 보기
      • 로그인 화면 설정
      • 백업 도구
      • 사용자와 그룹
      • 소프트웨어 매니저
      • 시냅틱 패키지 관리자
      • 시스템 모니터링
      • 시스템 및 서비스 관리 (Stacer)
      • 시스템 보고서
      • 시스템 스냅샷 (Timeshift)
      • 업데이트 매니저
      • 저장소 및 키 관리
      • 커널 업그레이드
      • 프린터
      • 하드웨어 정보
      • 하모니카 도움말
      • 환영합니다
    • 기본 설정
      • Plank Dock 설정
      • 글꼴 선택
      • 기본 프로그램
      • 날짜 & 시간
      • 네트워크
      • 님프 설정
      • 데스크릿
      • 디스플레이
      • 마우스 휠 속도 설정
      • 마우스와 터치패드
      • 바탕화면
      • 방화벽 설정
      • 배경화면
      • 블루투스
      • 사용자 정보
      • 색상 관리
      • 소리
      • 시스템 설정
      • 시스템 정보
      • 시작 프로그램
      • 알림
      • 애플릿
      • 언어
      • 외부 서비스 연동
      • 일반
      • 입력기 설정
      • 작업 공간
      • 전원 관리
      • 창 배치
      • 창 설정
      • 키보드
      • 태블릿
      • 테마
      • 패널
      • 편리한 기능
      • 핫코너
      • 화면 보호기
      • 확장 프로그램
      • 효과
      • 히스토리
    • 그래픽
      • 그누 이미지 처리 프로그램 (gimp)
      • 그림판 (drawing)
      • 이미지 뷰어 (Pix)
      • 잉크스케이프
  • 유용한 단축키
Powered by GitBook
On this page
  • Converting Audio into Different Formats / Sample Rates
  • Extract Audio
  • Replace Audio on a Video without re-encoding.
  • Extract Single Image from a Video at Specified Frame
  • Merge Multiple Videos
  • Split a Video into Images
  • Convert Images into a Video
  • Convert Single Image into a Video
  • Convert non-sequentially named Images in a directory
  • Convert .mov (JPEG-A or other codec) to H264 .mp4
  • Convert mp4 to webm
  • Simple FLAC convert
  • Mix Stereo to Mono
  • Trim End of file (mp3)
  • To Encode or Re-encode ?
  • Convert MKV to MP4
  • Add Watermark overlay (png) to the center of a video
  1. 다양한 하모니카 활용팁

ffmpeg 사용법 - 동영상에서 음성추출하기, 동영상 변환

Previous서버 모니터링 프로그램 bashtopNext동영상에서 자동으로 자막추출 Vrew

Last updated 1 year ago

하모니카에서는 기본으로 제공되는 ffmpeg 를 이용하여 아래와 같이 다양한 미디어 편집작업이 가능합니다.

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA: ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with: ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz: ffmpeg -i input.wav -ac 1 -ab 64000 -ar 22050 output.mp3

Convert any MP3 file to WAV 16khz mono 16bit: ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 16000 out.wav

Convert any MP3 file to WAV 20khz mono 16bit for ADDAC WAV Player: ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 22050 out.wav cd into dir for batch process: for i in *.mp3; do ffmpeg -i "$i" -acodec pcm_s16le -ac 1 -ar 22050 "${i%.mp3}-encoded.wav"; done

Picking the 30 seconds fragment at an offset of 1 minute: In seconds ffmpeg -i input.mp3 -ss 60 -t 30 output.wav

In HH:MM:SS format ffmpeg -i input.mp3 -ss 0:01:00 -t 0:00:30 output.wav

Split an audio stream at specified segment rate (e.g. 3 seconds) ffmpeg -i somefile.mp3 -f segment -segment_time 3 -c copy out%03d.mp3

Extract Audio

ffmpeg -i input-video.avi -vn -acodec copy output-audio.aac

vn is no video. acodec copy says use the same audio stream that's already in there.

ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn music.mp3

The -i option in the above command is simple: it is the path to the input file. The second option -f mp3 tells ffmpeg that the ouput is in mp3 format. The third option i.e -ab 192000 tells ffmpeg that we want the output to be encoded at 192Kbps and -vn tells ffmpeg that we dont want video. The last param is the name of the output file.

Replace Audio on a Video without re-encoding.

strip audio stream away from video ffmpeg -i INPUT.mp4 -codec copy -an OUTPUT.mp4

combine the two streams together (new audio with originally exisiting video) ffmpeg -i 36.MOV -i 36.wav -map 0:v -map 1:a -c copy -y 36-encoded.mov or add an offset to audio ffmpeg -i 36.MOV -itsoffset -0.25 -i 36.wav -map 0:v -map 1:a -c copy -y 36-encoded.mov or ffmpeg -i INPUT.mp4 -i AUDIO.wav -shortest -c:v copy -c:a aac -b:a 256k OUTPUT.mp4

You say you want to "extract audio from them (mp3 or ogg)". But what if the audio in the mp4 file is not one of those? you'd have to transcode anyway. So why not leave the audio format detection up to ffmpeg?

To convert one file:

ffmpeg -i videofile.mp4 -vn -acodec libvorbis audiofile.ogg

To convert many files:

for vid in *.mp4; do ffmpeg -i "$vid" -vn -acodec libvorbis "${vid%.mp4}.ogg"; done

You can of course select any ffmpeg parameters for audio encoding that you like, to set things like bitrate and so on.

Use -acodec libmp3lame and change the extension from .ogg to .mp3 for mp3 encoding.

If what you want is to really extract the audio, you can simply "copy" the audio track to a file using -acodec copy. Of course, the main difference is that transcoding is slow and cpu-intensive, while copying is really quick as you're just moving bytes from one file to another. Here's how to copy just the audio track (assuming it's in mp3 format):

ffmpeg -i videofile.mp4 -vn -acodec copy audiofile.mp3

Note that in this case, the audiofile format has to be consistent with what the container has (i.e. if the audio is AAC format, you have to say audiofile.aac). You can use the ffprobe command to see which formats you have, this may provide some information:

for file in *; do ffprobe $file 2>&1 |grep Audio; done

A possible way to automatically parse the audio codec and name the audio file accordingly would be:

for file in *mp4 *avi; do ffmpeg -i "$file" -vn -acodec copy "$file".ffprobe "$file" 2>&1 |sed -rn 's/.Audio: (...), ./\1/p'; done

Note that this command uses sed to parse output from ffprobe for each file, it assumes a 3-letter audio codec name (e.g. mp3, ogg, aac) and will break with anything different.

Encoding multiple files

You can use a Bash "for loop" to encode all files in a directory:

$ mkdir newfiles $ for f in *.m4a; do ffmpeg -i "$f" -codec:v copy -codec:a libmp3lame -q:a 2 newfiles/"${f%.m4a}.mp3"; done

ffmpeg -i input.m4a -acodec libmp3lame -ab 128k output.mp3 m4a to mp3 conversion with ffmpeg and lame

A batch file version of the same command would be: for f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -ab 256k "${f%.m4a}.mp3"; done

Extract Single Image from a Video at Specified Frame

$ vf [ss][filename][outputFileName] where vf is a custom bash script as follows: $ ffmpeg -ss $1 -i $2 -qmin 1 -q:v 1 -qscale:v 2 -frames:v 1 -huffman optimal $3.jpg ss offset = frame number divided by FPS of video = the decimal (in milliseconds) ffmpeg needs i.e. 130.5

Merge Multiple Videos

file names in folder, if they contain spaces, must be properly escaped ls * | perl -ne 'print "file $_"' | ffmpeg -f concat -i - -c copy merged.mp4

Split a Video into Images

$ ffmpeg -i video.flv image%d.jpg

Convert Images into a Video

$ ffmpeg -f image2 -i image%d.jpg imagestovideo.mp4 $ ffmpeg -i image-%03d.png -c:v libx264 -pix_fmt yuv420p test.mp4 $ ffmpeg -r 1/5 -i image-%03d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p test.mp4

Convert Single Image into a Video

$ ffmpeg -loop 1 -i image.png -c:v libx264 -t 60 -pix_fmt yuv420p -vf scale=1920:1080 out.mp4

Convert non-sequentially named Images in a directory

$ ffmpeg -framerate 30 -pattern_type glob -i '*.jpeg' -c:v libx264 -pix_fmt yuv420p gan-1.mov

Convert .mov (JPEG-A or other codec) to H264 .mp4

ffmpeg -i input.mov -vcodec libx264 -pix_fmt yuv420p output.mp4

Convert mp4 to webm

Simple FLAC convert

ffmpeg -i audio.xxx -c:a flac audio.flac

Mix Stereo to Mono

You can modify a video file directly without having to re-encode the video stream. However the audio stream will have to be re-encoded. Left channel to mono: ffmpeg -i video.mp4 -map_channel 0.1.0 -c:v copy mono.mp4 Left channel to stereo: ffmpeg -i video.mp4 -map_channel 0.1.0 -map_channel 0.1.0 -c:v copy stereo.mp4 If you want to use the right channel, write 0.1.1 instead of 0.1.0.

Trim End of file (mp3)

Here's a command line that will slice to 30 seconds without transcoding: ffmpeg -t 30 -i inputfile.mp3 -acodec copy outputfile.mp3

To Encode or Re-encode ?

Do you need to cut video with re-encoding or without re-encoding mode? You can try to following below command. Synopsis: ffmpeg -i [input_file] -ss [start_seconds] -t [duration_seconds] [output_file]

use ffmpeg cut mp4 video without re-encoding

Example: ffmpeg -i source.mp4 -ss 00:00:05 -t 00:00:10 -c copy cut_video.mp4

use ffmpeg cut mp4 video with re-encoding

Example: ffmpeg -i source.mp4 -ss 00:00:05 -t 00:00:10 -async 1 -strict -2 cut_video.mp4

If you want to cut off section from the beginning, simply drop -t 00:00:10 from the command

reduce filesize

Example: ffmpeg -i input.mov -vcodec libx264 -crf 24 output.mp4 It reduced a 100mb video to 9mb.. Very little change in video quality.

Example: ffmpeg -i video.mov -vf eq=saturation=0 -s 640x480 -c:v libx264 -crf 24 output.mp4 make a grayscale version and scale to 640x480

Convert MKV to MP4

ffmpeg -i file.mkv check for streams that you want (video/audio). be sure to convert/specify DTS 6 channel audio stream ffmpeg -i input.mkv -strict experimental -map 0:0 -map 0:1 -c:v copy -c:a:1 libmp3lame -b:a 192k -ac 6 output.mp4

Add Watermark overlay (png) to the center of a video

ffmpeg -i source.mov -i watermark.png -filter_complex "overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2" output.mp4

$ ffmpeg -i example.mp4 -f webm -c:v libvpx -b:v 1M -acodec libvorbis example.webm -hide_banner

more commands

more info
http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
Converting Audio into Different Formats / Sample Rates
Extract Audio
Replace Audio on a Video without re-encoding.
Extract Single Image from a Video at Specified Frame
Merge Multiple Videos
Split a Video into Images
Convert Images into a Video
Convert Single Image into a Video
Convert non-sequentially named Images in a directory
Convert .mov (JPEG-A or other codec) to H264 .mp4
Convert mp4 to webm
Simple FLAC convert
Mix Stereo to Mono
Trim End of file (mp3)
To Encode or Re-encode ?
use ffmpeg cut mp4 video without re-encoding
use ffmpeg cut mp4 video with re-encoding
reduce filesize
Convert MKV to MP4
Add Watermark overlay (png) to the center of a video