Programming2019. 8. 21. 05:37

몇일동안 FFMPEG option을 찾아봤더니, FFMPEG front end tools들이 많더란.

Github link 가 있는 QWinFF를 소스를 받아 compile해봄. C++, QT4를 사용하는데 아주 간단하면서 아주 빠름. 여기서 조금 고쳐서 쓰면 되겠네. 비디오 붙이기랑 title넣기 몇가지만 더 있으면 그냥 settle하는건데.

 

그런데 FFMPEG은 option이 직관적이지 않아 아주 골치. 그량 transcoding하면 quality가 너무 안좋아짐. 뭐지...

QWinFF에 보면 Copy Audio/Copy Video (Do not re-encode) 라는 옵션을 체크하면 시간만 자르거나 할때 진짜 빠르고 퀄리티가꼭 같은데 그냥 default로 하면 완정 망한 비디오됨

Same Quantizer as Source라는 option이 있는데 FFMPEG option으로 -crf 23 이라고 나오는데, 현재 내 버전에서 인식을 못함. 아 된장.

 

video1          +    video 2 + video 3 = output.mp4  이게 안되나...

overlay. png +

------------------------------------------

QWinFF: http://qwinff.github.io/
AVANTI - FFmpeg/AviSynth GUI: http://avanti.arrozcru.com/
WinFF: http://winff.org/html_new/
FFmpegx (mac): http://www.FFmpegx.com/
Handbrake: http://handbrake.fr/
Mpeg streamclip: http://www.squared5.com/
FFmpegYAG (Windows / Linux): https://sourceforge.net/projects/ffmpegyag/

MAC에서는 FFworks https://www.ffworks.net/

 

https://github.com/amiaopensource/ffmpeg-amia-wiki/wiki/3)-Graphical-User-Interface-Applications-using-FFmpeg

 

amiaopensource/ffmpeg-amia-wiki

AMIA/DLF Hack day FFmpeg documentation, scripts and recipes geared toward archivists. - amiaopensource/ffmpeg-amia-wiki

github.com

------------------------------------------

Video 자르기 (codec copy no transcoding)


ffmpeg -y -i ./20190811_in.mp4 -strict experimental -vcodec copy -acodec copy -ss START -t END ./20190811_OUT.mp4

 

Video re-encoding이 필요할때는 원본화질을 보전하기 위해서 원본파일의 codec과 bitrate를 확인합니다. 아래 경우 video는 AVC, 24000k(23942kbps). Audio는 AAC, 156kbps. 원본보다 약간 roundup하는것이 좋을것 같음.

 


ffprobe ./INPUT.mp4

  Duration: 00:00:24.05, start: 0.000000, bitrate: 24233 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 23942 kb/s, SAR 1:1 DAR 16:9, 60.01 fps, 60 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2019-08-11T18:44:41.000000Z
      handler_name    : VideoHandle
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 156 kb/s (default)
    Metadata:
      creation_time   : 2019-08-11T18:44:41.000000Z
      handler_name    : SoundHandle

 

Overlay Title


ffmpeg -i ./INPUT.mp4 -i data/watermark.png -c:v nvenc -c:a aac -b:v 24000k -b:a 160k -filter_complex "[0:v][1:v]overlay=main_w-overlay_w:main_h-overlay_h" watermarked.mp4

 

Video 붙이기


ffmpeg -f concat -i mylist.txt -c copy output.mp4

https://orunson.tistory.com/entry/FFMPEG%EC%9C%BC%EB%A1%9C-%EB%B9%84%EB%94%94%EC%98%A4-%EB%B6%99%EC%9D%B4%EA%B8%B0

 

FFMPEG으로 비디오 붙이기

아래 두가지 방법이 가장 간단한듯. 아래글중 10초씩 자르는것과 붙이는 것, 앞에 Title자동으로 넣는것까지 3가지만 있으면 될듯. *concat demuxer $ cat mylist.txt file '/path/to/file1' file '/path/to/file2..

orunson.tistory.com

Posted by 쁘레드