no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revisionLast revision | |||
— | appwiki:ffmpeg [2021/12/08 20:16] – [Common Convertion] ying | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== FFmpeg - the core command app of open source transcoder ====== | ||
+ | |||
+ | * free and available as command line software for windows, mac, linux | ||
+ | * download: http:// | ||
+ | * input video format: 3GP, AVI, FLV, Matroska, MP4, MPEG-PS, Ogg, QuickTime, SVCD, TS, TOD, VCD, WMV | ||
+ | * output video format: 3GP, AVI, Blu-ray, DVD, FLV, MKV, MP4, MPEG-PS, Ogg, mov, super VCD, TS, VCD, Webm, WMV | ||
+ | |||
+ | * Doc: https:// | ||
+ | |||
+ | ====== Common Convertion ====== | ||
+ | |||
+ | * disable ffmpeg feedback by adding in 1st flag <code bash> | ||
+ | |||
+ | * MTS 50i interlaced video to progress video 50p (ref: [[http:// | ||
+ | |||
+ | * image sequence to mp4 in cmd (25fps, FHD size, pic.0001.png naming, H264, quality 15-25)< | ||
+ | |||
+ | * **image sequence to MOV** with start frame detection (e.g h264 mov, prores 422) | ||
+ | * h264 mov <code python> | ||
+ | import os, | ||
+ | imgSeqPath = ' | ||
+ | movPath = ' | ||
+ | |||
+ | file_list = glob.glob( os.path.join(os.path.dirname(imgSeqPath), | ||
+ | if len(file_list) == 0: | ||
+ | return | ||
+ | prefix, ext = os.path.splitext(os.path.basename(file_list[0])) | ||
+ | start_number = re.findall(' | ||
+ | enc = ' | ||
+ | subprocess.Popen(shlex.split(enc), | ||
+ | </ | ||
+ | * proRes422 <code python> | ||
+ | # profile: 0 proxy, 1 LT, 2 SQ, 3 HQ | ||
+ | # pix format: yuv422p10le , for 444, use yuva444p10le | ||
+ | # -qscale:v 11: best 0-32 worst | ||
+ | # ref: https:// | ||
+ | enc = ' | ||
+ | </ | ||
+ | |||
+ | * image conversion and resize (width 320px) < | ||
+ | ffmpeg -i input.jpg -vf scale=320: | ||
+ | </ | ||
+ | |||
+ | * convert mov with alpha to webm with alpha < | ||
+ | ffmpeg.exe -i transparent_video_audio.mov -c:v libvpx-vp9 -pix_fmt yuva420p -b:v 2000k out.webm | ||
+ | </ | ||
+ | |||
+ | * convert mpg to mov h264 < | ||
+ | ffmpeg.exe -i " | ||
+ | </ | ||
+ | |||
+ | * copy portion of video < | ||
+ | # about -ss before -i and after -i difference, which can make cut video works or not works | ||
+ | # ref: https:// | ||
+ | |||
+ | ffmpeg.exe -i video.mp4 -c copy -ss 00:00:09 -to 00:00:21 video_cut.mp4 | ||
+ | |||
+ | # -ss in front means: start time (from 9s), duration time (21s) | ||
+ | ffmpeg.exe -ss 00:00:09 -i video.mp4 -c copy -to 00:00:21 video_cut.mp4 | ||
+ | </ | ||
+ | * combine list of videos into 1 video | ||
+ | * ref: https:// | ||
+ | |||
+ | * gif maker < | ||
+ | ffmpeg -i input.mp4 -vf " | ||
+ | </ | ||
+ | |||
+ | * 2x2 stack < | ||
+ | #ref: https:// | ||
+ | ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -i input3.mp4 -filter_complex " | ||
+ | </ | ||
+ | |||
+ | * image to square size (like convert image to texture size format) < | ||
+ | ffmpeg -i image.jpg -vf " | ||
+ | |||
+ | # longest side, so basically original size with padding to square | ||
+ | ffmpeg -i image.jpg -vf " | ||
+ | </ |