Sideway
output.to from Sideway
Draft for Information Only

Content

Command Samples
 Source and Reference

Command Samples

  1. Convert mp4 to swf 13Oct2011
    ffmpeg.exe -i in.mp4 -loop 0 -ar 22050 out.swf 
  2. Extract mpg to jpeg 13Oct2011)
    ffmpeg.exe -i in.mpg -r 0.08 -f image2 out%03d.jpeg
    09Dec2011
    ffmpeg.exe -i in.mpg -r 2.4 -f image2 out%03d.jpeg
  3. Convert 3gp to mp4 13Nov2011
    ffmpeg.exe -i "in.3gp" -sameq -ab 64k -ar 44100 out.mp4
  4. Convert vob to mp4 15Jan2012
    ffmpeg.exe -i "in.vob" -target vcd out.mp4
  5. Convert dat to mp4 15Jan2012
    ffmpeg.exe -i "in.dat" -target vcd out.mp4
  6. Convert mp4 to mp4 (phone)03/04/2012)
    ffmpeg.exe -i "in.mp4" -vtag xvid out.mp4
  7. Convert wmv to mp4 06May2016
    ffmpeg.exe -i "in.wmv" -c:v libx264 -crf 19 -preset slow -c:a aac -strict experimental -b:a 192k -ac 2 out.mp4
  8. Convert mov to mp4 by default h264 04Jan2020
    ffmpeg -i in.mov out.mp4
  9. Convert mov to mp4 with more control04Jan2020
    ffmpeg -i in.mov -c:v libx264 -crf 20 -preset slow -profile:v high -level 4.0 -color_primaries 1 -color_trc 1 -colorspace 1 -movflags +faststart -c:a aac -b:a 128k out.mp4
  10. Convert .mov to .mp4 with resize04Jan2020
    ffmpeg -i in.mov -vf "scale=1280:-2" out.mp4
  11. Convert .mov to .mp4 with padding 04Jan2020
    ffmpeg -i in.mov -vf "scale=720:720:force_original_aspect_ratio=decrease,pad=720:720:(ow-iw)/2:(oh-ih)/2:black" out.mp4
  12. Convert .mov to .mp4 with cropping 04Jan2020
    ffmpeg -i in.mov -vf "crop='min(iw,1*ih)':'min(iw/1,ih)',scale=720:720" out.mp4
  13. Convert .mov to .mp4 with blurred background04Jan2020
    ffmpeg -i in.mov -filter_complex "[0:v]scale=720:720,boxblur=luma_radius=min(h\,w)/20:luma_power=1:chroma_radius=min(cw\,ch)/20:chroma_power=1[bg];[0:v]scale=720:720:force_original_aspect_ratio=decrease[fg];[bg][fg]overlay=(W-w)/2:(H-h)/2[outv]" -map [outv] -map 0:a? out.mp4
  14. Convert .mov to .mp4 with trim 04Jan2020
    ffmpeg -i in.mov -ss 13.2 -to 16 out.mp4
  15. Convert .mov to .mp4 with trim 04Jan2020
    ffmpeg -i in.mov -ss 13.2 -t 2.8 out.mp4
  16. Convert .mp4 to .mp4 with overlay 04Jan2020
    ffmpeg -i in.mp4 -i logo.png -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" out.mp4
  17. Convert .mp4 to .jpg 04Jan2020
    ffmpeg -i in.mp4 -ss 14.5 -vframes 1 -q:v 2 out.jpg
  18. Convert .mp4 to .gif animated 04Jan2020
    ffmpeg -i in.mp4 -vf "fps=10,scale=320:-2:flags=lanczos" out.gif
  19. Convert .mp4 to .png palette04Jan2020
    ffmpeg -i in.mp4 -vf "fps=10,scale=320:-2:flags=lanczos,palettegen" out.png
  20. Convert .mp4 to .gif animated with palette04Jan2020
    ffmpeg -i in.mp4 -i palette.png -filter_complex "fps=10,scale=320:-2:lanczos[video];[video][1:v]paletteuse" video_clip-palette.gif
  21. Convert stream to mp405Jan2020
    ffmpeg -i rtmp://192.168.1.101:19035/live/ -map 0 out.mp4
  22. Convert stream to live05Jan2020
    ffplay -rtsp_transport tcp rtsp://192.168.1.102:554/stream.sdp
  23. Convert .avi to mp305Jan2020
    ffmpeg -i in.avi -map 0:a out.mp3
  24. Convert stream to mp305Jan2020
    ffmpeg -i rtmp://192.168.1.101:19035/live/ -map 0:a out.mp3
  25. Convert stream to mp4:v05Jan2020
    ffmpeg -i rtmp://92.168.1.101:19035/live -map 0:v out.mp4
  26. Convert .mp3 to .mp3:1 and .mp3:205Jan2020
    ffmpeg -i in.mp3 -map_channel 0.0.0 out1.mp3 -map_channel 0.0.1 out2.mp3
  27. Convert .mp4 to .mp4:v and .mp305Jan2020
    ffmpeg -i in.mp4 -map 0:v  out.mp4 -map 0:a out.mp3
  28. Convert .mp4 and .mp3 to .mp405Jan2020
    ffmpeg -i in.mp4  -i in.mp3  -map 0:v  -map 1:a out.mp4
  29. Convert .mp4 and .png to /mp405Jan2020
    ffmpeg -i in.mp4 -i in.png -filter_complex 'overlay' out.mp4
  30. Convert .mp4 to yuv05Jan2020
    ffmpeg -i in.mp4 out.yuv
  31. Convert .mp4 to jpgs05Jan2020
    ffmpeg -i in.mp4 -r 1 -s 640x480 -f image2 out-%03d.jpeg
  32. Convert .mp4 to jpgs05Jan2020
    ffmpeg -i in.mp4 -r 1 -ss 50 -vframes 3 -s 640x480 -f image2 out-%03d.jpeg
  33. Convert .jpgs to .avi05Jan2020
    ffmpeg -f image2 -framerate 25 -i in-%03d.jpeg   -s 1280x720  out.avi
  34. Convert codec05Jan2020
    ffmpeg -i in.mp4 -vcodec libx264  -s 640x480  -acodec aac -strict experimental -ar 44100 -ac 2 -b:a 96k out.mp4
  35. Convert size05Jan2020
    ffmpeg -i in.mp4  -vf scale=iw/2:ih/2 out.mp4
  36. Trim .mp405Jan2020
    ffmpeg -ss 00:00:30 -vsync 0 -t 00:00:30 -i in.mp4 -vcodec libx264-acodec libfaac out.mp4
  37. Crop .mp405Jan2020
    ffmpeg -i in.mp4 -vf crop=iw/2:ih/2 out.mp4
  38. Crop .mp405Jan2020
    ffmpeg -i in.mp4  -vf crop=iw/3:ih/3:100:100 out.mp4
  39. ffplay detect05Jan2020
    ffplay in.mp4 -vf cropdetect
  40. Add border05Jan2020
    ffmpeg -i in.mp4 -vf pad=iw+60:ih+60:30:30:pink out.mp4
  41. Hflip05Jan2020
    ffmpeg -i in.mp4  -vf hflip out.mp4
  42. Vflip05Jan2020
    ffmpeg -i in.mp4  -vf vflip out.mp4
  43. transpose05Jan2020
    ffmpeg -i in.mp4  -vf transpose=2 out.mp4
  44. blur05Jan2020
    ffmpeg -i in.mp4  -vf  boxblur=1:10:4:10  out.mp4
  45. unshape05Jan2020
    ffmpeg -i in.mp4  -vf unsharp=5:5:1.0:5:5:0.0 out.mp4
  46. delete logo05Jan2020
    ffmpeg -i in.mp4 -vf delogo=10:10:256:256:0:0 out.mp4
  47. drawtext05Jan2020
    ffmpeg  -i in.mp4 -vf drawtext="fontfile=arial.ttf:text='test':x=(w-tw)/2:y=(h-th)/2:fontcolor=green:fontsize=60" in.mp4
  48. drawtext moving05Jan2020
    ffmpeg -i in.mp4  -vf drawtext="fontfile=ARIALUNI.ttf:text='test':x=w-mod(t*50\,w):fontcolor=darkorange:fontsize=30" out.mp4
  49. drawtext moving05Jan2020
    ffmpeg -i in.mp4 -vf drawtext="fontfile=ARIALUNI.ttf:text='test':x=w-mod(t*50\,w):y=h-th:fontcolor=darkorange:fontsize=30" out_.mp4
  50. Add time05Jan2020
    ffmpeg -i in.mp4  -vf drawtext="fontfile=arial.ttf:x=w-tw:fontcolor=white:fontsize=30:text='%{localtime\:%H\\\:%M\\\:%S}'" out.mp4
  51. play with rolling05Jan2020
    ffplay  -i in.mp4  -vf crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2+((in_h-out_h)/2)*sin(n/7)
  52. play with changing color05Jan2020
    ffplay -i in.mp4 -vf hue="H=2*PI*t:s=sin(2*PI*t)+1"
  53. Convert color to gray05Jan2020
    ffmpeg -i in.mp4 -vf lutyuv="u=128:v=128" out.mp4
  54. Convert speed05Jan2020
    ffmpeg -i in.mp4 -vf setpts=PTS/2 -af atempo=2 out.mp4
  55. Convert mp4 to gif05Jan2020
    ffmpeg -i in.mp4 -ss 50 -t 10 -pix_fmt rgb24  -s 640x480 out.gif
  56. extract mp4 to 1 png05Jan2020
    ffmpeg  -i in.mp4  -frames 1  -vf "select=not(mod(n\,300)),scale=320:240,tile=2x3" out.png
  57. Error! Convert to lmp4 and rmp4 to mp405Jan2020
    ffmpeg -i "in1.mp4" -vf "[in] scale=iw/2:ih/2, pad=2*iw:ih [left]; movie=\'in2.mp4\', scale=iw/2:ih/2 [right];[left][right] overlay=main_w/2:0 [out]" -b:v 768k out.mp4
  58. Error! Convert to ump4 and lmp4 to mp405Jan2020
    ffmpeg -i "in1.mp4" -vf "[in] scale=iw/2:ih/2, pad=iw:2*ih [top]; movie=\'in2.mp4\', scale=iw/2:ih/2 [bottom];[top][bottom] overlay=0:main_h/2 [out]" -b:v 768k out.mp4
  59. Error! Combine and edit05Jan2020
    ffmpeg -i "in1.mp4" -vf "[in] scale=iw:ih, pad=iw:ih  [top]; movie=\'in2.mp4\', scale=iw/4:ih/4 [bottom];[top][bottom] overlay=main_w/8:main_h/8 [out]" -b:v 768k out.mp4
  60. Combine 2 video in sequence05Jan2020
    ffmpeg -i in1.mp4 -qscale 0 out1.mpg
    ffmpeg -i in2.mp4 -qscale 0  out2.mpg
    copy /b "out1.mpg"+"out2.mpg" "out3.mpg"
    ffmpeg -i out3.mpg -qscale 0 out4.mp4
  61. Combine audio only05Jan2020
    fmpeg.exe -ss 00:00:08.5 -vsync 0 -t 00:00:09 -i file1.mp3   file1end.mp3
    ffmpeg.exe -ss 00:00:00 -vsync 0 -t 00:00:08 -i file1.mp3   file1New.mp3
    
    ffmpeg -i file2.mp3 -i file1end.mp3   -filter_complex amix=inputs=2:duration=first:dropout_transition=0 file2forNew1.mp3
    
    ffmpeg.exe -ss 00:00:00 -vsync 0 -t 00:00:04 -i file2forNew1.mp3   file2New.mp3
    ffmpeg.exe -ss 00:00:04 -vsync 0 -t 00:00:05 -i file3.mp3   file2End.mp3
    
    ffmpeg -i file3.mp3 -i file2End.mp3   -filter_complex amix=inputs=2:duration=first:dropout_transition=0 file3New.mp3
    
    ffmpeg -i file1New.mp3 -qscale 0 inputfile_01.mpg
    ffmpeg -i file2New.mp3 -qscale 0  inputfile_02.mpg
    copy /b "inputfile_01.mpg"+"inputfile_02.mpg" "inputfile_all.mpg"
    ffmpeg -i file3New.mp3 -qscale 0  inputfile_05.mpg
    copy /b "inputfile_all.mpg"+"inputfile_05.mpg" "inputfile_al2.mpg"
    ffmpeg -i inputfile_al2.mpg -qscale 0 file5.mp4
    ffmpeg -i file5.mp4 -map 0:a result.mp3
    

Source and Reference

https://ffmpeg.org/ffmpeg.html
https://medium.com/abraia/basic-video-editing-for-social-media-with-ffmpeg-commands-1e873801659
http://www.jeepxie.net/article/495862.html

©sideway

ID: 200101002 Last Updated: 1/10/2020 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Reference 79

Computer

Hardware 249

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 429

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019