티스토리 뷰

IT

FFMPEG 옵션 Option

untitle4me 2015. 4. 14. 17:56

ffmpeg [input options] -i [input filename] -codec:v [video options] -codec:a [audio options] [output file options] [output filename]


Video options:(비디오 옵션)

-b                  set bitrate (in bits/s) (비트레이트 조정)
-vb                 set bitrate (in bits/s) (가변비트레이트 조정)
-vframes number     set the number of video frames to record
-r rate             set frame rate (Hz value, fraction or abbreviation)(프레임 레이트 조정)
-s size             set frame size (WxH or abbreviation)(프레임 사이즈 조정)
-aspect aspect      set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)(비율조정 4:3, 16:9)
-croptop size       set top crop band size (in pixels)(상단 잘라낼 사이즈 설정 - 단위 픽셀)
-cropbottom size    set bottom crop band size (in pixels)(하단 잘라낼 사이즈 설정- 단위 필셀)
-cropleft size      set left crop band size (in pixels)(왼쪽 잘라낼 사이즈 설정 - 단위 픽셀)
-cropright size     set right crop band size (in pixels)(오른쪽 잘라낼 사이즈 설정 - 단위 필셀)
-padtop size        set top pad band size (in pixels)
-padbottom size     set bottom pad band size (in pixels)
-padleft size       set left pad band size (in pixels)
-padright size      set right pad band size (in pixels)
-padcolor color     set color of pad bands (Hex 000000 thru FFFFFF)
-vn                 disable video (비디오 사용하지 않음)
-vcodec codec       force video codec ('copy' to copy stream)(강제적으로 비디오 코덱을 설정함 'copy'는 스트림을 복사해서 사용함)
-sameq              use same video quality as source (implies VBR)(소스와 같은 퀄리티를 사용함)
-pass n             select the pass number (1 or 2)(사용할 패스를 설정 1,2)
-passlogfile file   select two pass log file name(2패스 선택시 로그 파일의 이름을 설정)
-newvideo           add a new video stream to the current output stream

less..


Audio options:(오디오 옵션)

-ab                 set bitrate (in bits/s)(초당 비트레이트를 설정 ex)128, 192, 320 etc)
-aframes number     set the number of audio frames to record(녹음될 오디오 프레임들의 갯수를 설정함)
-aq quality         set audio quality (codec-specific)(오디오의 질을 설정함)
-ar rate            set audio sampling rate (in Hz)(오디오 샘플림을 설정함 32000,44000)
-ac channels        set number of audio channels(오디오 채널을 설정함 1-mono 2-stereo)
-an                 disable audio (오디오를 사용하지 않음)
-acodec codec       force audio codec ('copy' to copy stream)(음성 코덱을 설정함 'copy'는 복사)
-vol volume         change audio volume (256=normal)(볼륨을 설정함)
-newaudio           add a new audio stream to the current output stream(출력할 오디오 스트림을 현재 오디오 스트림에 추가함)
-alang code         set the ISO 639 language code (3 letters) of the current audio stream

Advanced options: (
-map file:stream[:syncfile:syncstream]  set input stream mapping
-map_meta_data outfile:infile  set meta data information of outfile from infile
-benchmark          add timings for benchmarking 
-dump               dump each input packet
-hex                when dumping packets, also dump the payload
-re                 read input at native frame rate
-loop_input         loop (current only works with images)
-loop_output        number of times to loop output in formats that support looping (0 loops forever)
-threads count      thread count (쓰레드의 수를 지정)
-vsync              video sync method(비디오 싱크 도구 ex) -vsync 1)
-async              audio sync method(오디오 싱크 도구 ex) -async 1)
-adrift_threshold   audio drift threshold
-vglobal            video global header storage type
-copyts             copy timestamps
-shortest           finish encoding within shortest input
-dts_delta_threshold   timestamp discontinuity delta threshold
-programid          desired program number
-muxdelay seconds   set the maximum demux-decode delay
-muxpreload seconds  set the initial demux-decode delay
-sbsf bitstream filter 


===========================================================================================


주: 기본 문법에 의하면 옵션들은 다음에 지정되는 파일에 적용이된다. 그렇기에 순서는 중요하고 같은 옵션을 여러 명령줄에 사용할 수 있다. 각 옵션들은 다음 입력 혹은 출력 파일에 적용된다.


주요 옵션

-L :                  라이센스 보여줌

-h : 도움말 보여줌.

-version:            버전 정보

-format : 사용가능한 포멧, 코덱, 프로토콜을 보여줌.

-f <string> : 파일 포멧을 지정. (나중에 포멧 목록 참조)

-i <string> : 입력되는 파일 이름. 

-y:                  출력 파일 덮어스기

-t <timecode> : 기록할 시간을 초 단위 또는 hh:mm:ss[.xxx] 형태로 설정.

-fs <정수값> : 최대 파일 크기를 설정(바이트 단위)

-ss <timecode> : 작업할 시작시간 오프셋(시작위치)을 초 단위 또는 hh:mm:ss[.xxx] 형태로 설정.

-itsoffset <time_off>:  설정 ts 오프셋(set the input ts offset)

-itsscale <stream:scale>:  입력 ts 스케일 설정(set the input ts scale)

-album <앨범명> : 앨범을 설정.

-author <저자명> : 저자를 설정.

-comment <주석> : 주석을 설정.

-copyright <저작권>: 저작권에 대한 설정.

-title <타이틀이름> : 타이틀을 설정.

-timestamp <시간> :  타임스탬프 설정.

-genre <장르명> : 장르를 설정.

-dframes 숫자 :     기록할 데이터 프레임 개수 설정

-v <숫자>:           로깅 레벨 설정

-target <타입>:  목표 파일 타입 지정 ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ...)

-xerror:             에러시 종료


추가 옵션

-map <file:stream>[:syncfile:syncstream] : 입력 스트림 매핑 설정. 

-map_meta_data outfile:infile :  입력파일에서 출력파일로 저장(?)될 메타 데이터 정보 설정.

-benchmark :          벤치마킹할 타이밍 추가.

-dump :               각 입력 패킷을 덤프함.

-hex :                패킷을 덤프할때 페이로드도 같이 덤프함.

-re :                 read input at native frame rate.

-loop_input :         루프 (현재 이미지하고만 작동이 됨).

-loop_output :        루핑을 지원하는 포멧에서 출력을 루프할 횟수 지정(0은 계속 루프함).

-threads 개수 :      쓰레드 개수.

-vsync :              비디오 싱크 방법.

-async :              오디오 싱크 방법.

-adrift_threshold 임계값 :  audio drift threshold.

-vglobal :            비디오 글로벌 해더 저장 형식.

-copyts :             타임스탬프 복사.

-shortest :           finish encoding within shortest input

-dts_delta_threshold 임계값 :  timestamp discontinuity delta threshold

-programid :          원하는 프로그램 개수(?)

-muxdelay seconds :   최대 디먹스-디코드 지연값 설정(?)

-muxpreload seconds :  초기 디먹스-디코드 지연값 설정(?)

 

비디오 옵션

-aspect <string or float> : 비율을 설정 ( 4:3, 16:9, 1.3333, 1.7777 ). 

-b <int> : 비디오 비트레이트를 bit/s단위로 설정 (기본=200k). 

-vb bitrate :        비디오 비트레이트 설정 (in bits/s)

-vframes number :     기록할 비디오 프레임 수 지정

-s size :             화면 크기 지정 (WxH 또는 비율)

-croptop size :       상단 잘라내는 밴드 크기 지정 (픽셀단위)

-cropbottom size :   하단 잘라내는 밴드 크기 지정 (픽셀단위)

-cropleft size :     외쪽 잘라내는 밴드 크기 지정 (픽셀단위)

-cropright size :    오른쪽 잘라내는 밴드 크기 지정 (픽셀단위)

-padtop size :       위쪽 패드 밴드 크기 지정 (픽셀단위)

-padbottom size :    하단 패드 밴드 크기 지정 (픽셀단위)

-padleft size :      왼쪽 패드 밴드 크기 지정 (픽셀단위)

-padright size :     오른쪽 패드 밴드 크기 지정 (픽셀단위)

-padcolor color " :   패드 밴드 색상 지정 (16진수 000000 ~ FFFFFF)

-vn :                비디오를 비활성화

-vcodec codec :      비디오 코텍를 강제로 지정 ('copy' 은 스트림을 복제)

-sameq :             소스와 같은 비디오 퀄리티를 사용 (implies VBR)

-pass n :            패스 번호를 선택 (1 또는 2)

-passlogfile prefix :  패스 로그 파일 이름앞에 붙일 접두사 선택

-newvideo :          새로운 비디오 스트림을 현재 출력 스트림으로 추가

 

추가 비디오 옵션


-pix_fmt format :    픽셀 포맷 설정. 'list'는 지원되는 모든 픽셀 포맷 보여줌

-intra :             인트라 프래임만 사용

-vdt n :             쓰레드홀드 취소

-qscale q :          고정된 비디오 양자화범위를 사용 (VBR)

-rc_override override : rate control override for specific intervals

-me_threshold threshold : motion estimaton threshold

-deinterlace :       deinterlace pictures

-psnr :              calculate PSNR of compressed frames

-vstats :            dump video coding statistics to file

-vstats_file file :  dump video coding statistics to file

-intra_matrix matrix : specify intra matrix coeffs

-inter_matrix matrix : specify inter matrix coeffs

-top :               top=1/bottom=0/auto=-1 field first

-dc precision :      intra_dc_precision

-vtag fourcc/tag :   force video tag/fourcc

-qphist :            show QP histogram

-force_fps :         force the selected framerate, disable the best supported framerate selection

-vbsf bitstream_filter  

-vpre preset :       set the video options to the indicated preset


 

오디오 옵션

-ab <int> : 오디오 비트레이드를 bit/s 단위로 설정. 값은 정수(기본 = 64k). 

-aframes number :    set the number of audio frames to record

-aq quality :        set audio quality (codec-specific)

-ar rate :           set audio sampling rate (in Hz)

-ac channels :       set number of audio channels

-an :                disable audio

-acodec codec :      force audio codec ('copy' to copy stream)

-vol volume :        change audio volume (256=normal)

-newaudio :          add a new audio stream to the current output stream

-alang code :        set the ISO 639 language code (3 letters) of the current audio stream

-acodec <string> : 사용할 오디오 코덱을 지정. 
    ac3 : AC3 ( Dolby Digital ) 
    copy : 원본 데이터를 그대로 복사. 
    libfaac : AAC-LC 
    mp2 : MPEG Audio Layer II 
    mp3 : MPEG Audio Layer III 
    pcm_s16le : 비압축 16-bit PCM Audio 

-an : 오디오를 사용하지 않음. 

-ar <int> : 오디오 샘플링율을 Hz단위로 설정 (기본 = 44100 Hz). 


-async <int> : 오디오 동기화 방법. 오디오를 타임스템프에 맞춰서 늘리거나 줄일 수 있다. 이 매개변수는 오디오 변화에 의한 초당 최대 샘플 개수를 말한다. -async 1은 특별한 경우로 지연 수정 없이 오디오 스트림 시작 위치가 정확한 경우에만 사용가능.


추가 오디오 옵션

-atag fourcc/tag :   force audio tag/fourcc

-sample_fmt format : set sample format, 'list' as argument shows all the sample formats supported

-absf bitstream_filter  

-apre preset :       set the audio options to the indicated preset


자막 옵션

-sn :                disable subtitle

-scodec codec :      force subtitle codec ('copy' to copy stream)

-newsubtitle :       add a new subtitle stream to the current output stream

-slang code :        set the ISO 639 language code (3 letters) of the current subtitle stream

-sbsf bitstream_filter  

-spre preset :       set the subtitle options to the indicated preset


오디오/비디오 획득 옵션

Audio/Video grab options:

-vc channel :        set video grab channel (DV1394 only)

-tvstd standard :    set television standard (NTSC, PAL (SECAM))

-isync :             sync read on input 

-bufsize <int> : 제어버퍼 크기를 설정 (비트단위). 

-cmp <string or int> : pel 모션 평가 비교 함수 사용 - Full pel motion estimation compare function. 
    sad ( 0 ) : 절대 차이 값의 합, 고속 (기본) 
    sse ( 1 ) : Squared errors 합. 
    satd ( 2 ) : Absolute Hadamard transformed differences 합. 
    dct ( 3 ) : Absolute DCT transformed differences 합. 
    psnr ( 4 ) : Squared quantization errors 합( 비추, 저품질). 
    bit ( 5 ) : 블럭에 필요한 비트 수 
    rd ( 6 ) : Rate distortion optimal, 느림.
    zero ( 7 ) : 0. 
    vsad ( 8 ) : Absolute vertical differences 합. 
    vsse ( 9 ) : Squared vertical differences 합. 
    nsse ( 10 ) : Noise preserving sum of squared differences. 
    w53 ( 11 ) : 5/3 wavelet ( Snow에서만 사용됨). 
    w97 ( 12 ) : 9/7 wavelet ( Snow에서만 사용됨). 
    dctmax ( 13 ) 
    chroma ( 14 ) 

-coder <string or int> : 
    vlc ( 0 ) : 가변 길이 코더 / 허프만 코더. 
    ac ( 1 ) : 산술연산 코더(Arithmetic coder). 
    raw ( 2 ) : 원본 ( 인코딩 없음). 
    rle ( 3 ) : Run-length coder. 
    deflate ( 4 ) : Deflate-based coder. 

-cropbottom <int> : 하단 잘려지는 화면 크기 설정(비트 단위). 

-cropleft <int> : 왼쪽 잘려지는 화면 크기 설정(비트 단위). 

-cropright <int> : 오른쪽 잘려지는 화면 크기 설정(비트 단위). 

-croptop <int> : 상단 잘려지는 화면 크기 설정(비트 단위). 

-deinterlace : 픽처를 디인터페이스 시킴(Deinterlace pictures). 

-dc <int> : Intra DC precision.

-flags <string> : 이부분은 패스.. 무슨 말인지.. ㅡ.ㅡㅋ
    aic : H.263 advanced intra coding / MPEG-4 ac prediction. 
    aiv : H.263 alternative inter VLC. 
    alt : Enable alternate scantable ( MPEG-2/MPEG-4 ). 
    bitexact : Use only bitexact stuff ( except (i)dct ). 
    cbp : Use rate distortion optimization for cbp. 
    cgop : Closed GOP. 
    gmc : Use global motion compensation. 
    gray : Only decode/encode grayscale. 
    ildct : Use interlaced DCT. 
    ilme : Interlaced motion estimation. 
    loop : Use loop filter. 
    low_delay : Force low delay. 
    mv0 : Always try a mb with mv=<0,0>. 
    mv4 : Use four motion vector by macroblock ( MPEG-4 ). 
    naq : Normalize adaptive quantization. 
    obmc : Use overlapped block motion compensation ( H.263+ ). 
    part : Use data partitioning. 
    psnr : Error variables will be set during encoding. 
    qpel : Use 1/4 pel motion compensation. 
    qprd : Use rate distortion optimization for qp selection. 
    scan_offset : Will reserve space for svcd scan offset user data. 
    slice 
    trell : Use trellis quantization. 
    umv : Use unlimited motion vectors. 

-flags2 <string> : 
    aud : Access unit delimiters ( H.264 ). 
    bpyramid : Allows B-frames to be used as references for predicting. 
    brdo : B-frame rate-distortion optimization. 
    dct8x8 : High profile 8x8 transform ( H.264 ). 
    drop_frame_timecode 
    fast : Allow non spec compliant speedup tricks. 
    fastpskip : Fast pskip ( H.264 ). 
    ivlc : Intra VLC table. 
    local_header : Place global headers at every keyframe instead of in extradata. 
    mixed_refs : One reference per partition, as opposed to one reference per macroblock. 
    non_linear_q : Use non linear quantizer. 
    noout : Skip bitstream encoding. 
    sgop : Strictly enforce GOP size. 
    skiprd : RD optimal macroblock level residual skipping. 
    wpred : Weighted biprediction for B-frames ( H.264 ). 

-formats : 가능한 포멧, 코덱, 프로토콜 등을 보여줌. 

-g <int> : Group of pictures ( GOP ) 크기 설정. 

-genpts <boolean> : PTS 생성( 0 = off / 1 = on ). 

-intra : Intra frames ( I-frames )만 사용. 

-loop_input : 반복 ( 정지 이미지에서만 사용 ). 



-maxrate <int> : 최대 비디오 비트레이트 허용치 설정( bit/s 단위). 

-me <string or int> : 모션 추출 방법 설정. 
    dia ( 1 ) : Diamond 검색, 반경 1 ( 고속). 
    hex ( 2 ) : Hexagonal 검색, 반경 2 ( 기본). 
    umh ( 3 ) : Uneven multi-hexagon 검색. 
    esa ( 4 ) : Exhaustive 검색 ( 저속). 

-mbd <string> : Macroblock decision 알고리즘 ( 고품질 모드). 
    simple : mbcmp 사용( 기본 ). 
    bits : fewest bits 사용. 
    rd : best rate distortion 사용. 

-minrate <int> : 최소 비디오 비트레이트 허용치 설정 ( bit/s 단위 ). 

-newaudio : 새로운 오디오 스트립을 현재 출력 스트림에 추가. 

-padbottom <int> : 하단 패드 밴드 크기설정 ( 픽셀 단위 ). - 역주: 하단 여백 크기을 말함

-padcolor <int> : 패드 밴드의 색상을 설정 ( 16진수 000000 ~ FFFFFF ). - 역주: 여백 색상을 말함

-padleft <int> : 왼쪽 패드 밴드 크기를 설정 ( 픽셀 단위 ). - 역주: 왼쪽 여백 크기를 말함

-padright <int> : 오른쪽 패드 밴드 크기를 설정 ( 픽셀 단위 ). - 역주: 오른쪽 여백 크기를 말함

-padtop <int> : 위쪽 패드 밴드 크기를 설정 ( 픽셀 단위 ). - 역주: 위쪽 여백 크기를 말함

-pass <int> : 패스 수 선택 ( 1 or 2 ). 비디오 통계치는 첫번째 패스에서 기록이되고 두번째 패스에서 비디오가 정확히 원하는 비트레이트로 생성이된다.

-pix_fmt <string> : 픽셀 포맷 설정. 
    yuv420p 
    yuv422p 
    yuv444p 
    yuv422 
    yuv410p 
    yuv411p 
    yuvj420p 
    yuvj422p 
    yuvj444p 
    rgb24 
    bgr24 
    rgba32 
    rgb565 
    rgb555 
    gray 
    monow 
    monob 
    pal8 

-ps <int> : 패킷 크기를 비트 단위로 설정. 

-qmax <int> : 최대 비디오 양자화(quantizer) 값 ( VBR ). - 역주: 가변 비트레이트에서 최대치

-qmin <int> : 최소 비디오 양자화(quantizer) 값 ( VBR ). - 역주: 가변 비트레이트에서 최소치

-qscale <int> : 고정 비디오 양자화(quantizer) 값 ( VBR ). - 역주: 고정 비트레이스 값

-r <int or string> : 프레임 율 설정 ( Hz 값, 비율 혹은 약호사용 ). 예: 25, 30000/1001, etc. 

-rc_init_occupancy <int> : 디코딩 시작 전에 rate control 버퍼에 로드되는 비트 개수. 

-s <string> : 프레임 크기 설정 ( 폭x높이 또는 약호). 

-subcmp <string or int> : Sub pel motion estimation compare function. 
    sad ( 0 ) : Sum of absolute differences, fast ( default ). 
    sse ( 1 ) : Sum of squared errors. 
    satd ( 2 ) : Sum of absolute Hadamard transformed differences. 
    dct ( 3 ) : Sum of absolute DCT transformed differences. 
    psnr ( 4 ) : Sum of squared quantization errors ( avoid, low quality ). 
    bit ( 5 ) : Number of bits needed for the block. 
    rd ( 6 ) : Rate distortion optimal, slow. 
    zero ( 7 ) : 0. 
    vsad ( 8 ) : Sum of absolute vertical differences. 
    vsse ( 9 ) : Sum of squared vertical differences. 
    nsse ( 10 ) : Noise preserving sum of squared differences. 
    w53 ( 11 ) : 5/3 wavelet ( only used in Snow ). 
    w97 ( 12 ) : 9/7 wavelet ( only used in Snow ). 
    dctmax ( 13 ) 
    chroma ( 14 ) 

-ss <timecode> : 작업할 시작시간 오프셋(시작위치)을 초 단위 또는 hh:mm:ss[.xxx] 형태로 설정.

-t <timecode> : 기록할 시간을 초 단위 또는 hh:mm:ss[.xxx] 형태로 설정.

-timecode_frame_start <int> : GOP 시작 타임코드 값을 프레임 개수로 설정( 예: 14:15:09:23 대신에 1282748사용 ). 프레임 드롭 모드에서는 지원하지 않음.

-top <int> : Field dominance ( top = 1 / bottom = 0 / auto = -1 ). 

-trellis <int> : Rate-distortion optimal quantization. 

-vbsf <string> : 비트스트림 필터. 
    dump_extra 
    imxdump 
    noise 
    remove_extra 

-vcodec <string> : 비디오 코덱 지정. 
    copy : 원본 데이터 그대로 복사. 
    dvvideo : DV Video 
    ffv1 : FFV1 lossless video codec 
    libx264 : H.264 
    mpeg2video : MPEG-2 Video 
    rawvideo : RAW Video 
    xvid : XviD ( MPEG-4 Part 2 ) (역주: 최근 버전에서는 libxvid로 사용)

-vframes <int> : 기록할 비디오 프레임 개수 설정. 

-vn : 비디오 사용하지 않음. 

-vol <int> : 오디오 볼륨 수정 ( 256=보통). 

-vsync <int> : 비디오 동기화 방법. 비디오를 타임스템프에 맞춰서 줄이거나 늘릴 수 있다. 이는 프레임을 복제하거나 버리는 방법을 사용한다. -map 옵션을 사용해서 타임스탬프로 사용할 스트림을 선택할 수 있다.  비디오나 오디오를 변경없이 내버려둘 수 있고 변경되지 않은 것에 동기화 시킬수 있다.

-vtag <string> : 비디오 FourCC/Tag 지정. 

'IT' 카테고리의 다른 글

[웹개발 보안] Secure Coding 방법론  (0) 2015.06.16
PCR, DTS, PTS (MPEG 시간정보)  (0) 2015.04.23
[FFMPEG] 옵션 OPTION  (0) 2015.04.13
[FFMPEG] H.264 Encoding 인코딩 트랜스코딩  (0) 2015.04.09
FTP Active Passive  (0) 2014.01.21
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함