Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.04 KB | None | 0 0
  1. FFMPEG '-i', file, '-c:v', 'libopenjpeg', "jpeg2000\\" + name + ".jp2"\
  2.  
  3. Convert image to jpeg2000
  4. ffmpeg -i in.png -c:v libopenjpeg out.jp2
  5. Hex Edit out.jp2
  6. ffmpeg -i in.jp2 -c:v png out.png
  7.  
  8. General Edit
  9. ffmpeg -i input.avi -c:v mpeg2video -g 999 -q:v 1 output.avi
  10. *edit in avidemux/whatever*
  11. ffmpeg -i input.avi -c:v h264 -preset medium -crf 24 final.mp4
  12.  
  13. Remove bFrames
  14. -x265-params b-frames=0"
  15.  
  16. GET FORMATS
  17. ffmpeg.exe -codecs | grep DEV
  18.  
  19. Get list of Containers
  20. ffmpeg -formats | grep DE
  21.  
  22. Get Encoder options
  23. ffmpeg -h encoder=X
  24. X from Get Formats
  25.  
  26. sharpen abuse (loop dis)
  27. ffmpeg -i IN.jpg -q:v 31 -vf unsharp=luma_amount=0.2 input.jpg
  28.  
  29. Displacement Maps
  30. ( Remove crf and b:v parts to get normal quality)
  31. ffmpeg -i IN.mp4 -i IN.mp4 -i IN.mp4 -c:v hevc -crf 40 -b:v 20k -filter_complex "[0][1][2]displace=edge=wrap[middle];[middle]stereo3d=ar" -y res.mp4
  32.  
  33. Get Frames
  34. ffmpeg -i in.avi -q:v 0 imagename_%04d.jpg
  35.  
  36. convert image to video
  37. (single image into 10 sec video)
  38. ffmpeg -loop 1 -y -i sourceimage.jpg -t 10 -c:v codec-you-wanna-use video.avi
  39.  
  40. (from Frames r == fps)
  41. ffmpeg -r 1/5 -i img%03d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp4
  42.  
  43. Video to RAW for sonifaction
  44. ffmpeg -ss 00:01:02 -t 5 -i IN.mp4 -f rawvideo -pix_fmt yuv420p result.yuv
  45. ss = start time
  46. t == seconds after ss to use
  47.  
  48. RAW to Video (After Sonfication)
  49. ffmpeg -f rawvideo -video_size 1280x720 -pix_fmt yuv420p -i result.yuv output.mp4
  50.  
  51.  
  52. BELOW CREDIT oioiiooixiii:
  53.  
  54. STACK EFFECTS!!! can use ffmpeg but results will be different.
  55. ffplay -i IN.mp4 -vf \
  56. "
  57. scale=-2:720,
  58. tblend=all_mode=difference128,
  59. tblend=all_mode=difference128,
  60. tblend=all_mode=difference128,
  61. spp=4:10,
  62. tblend=all_mode=average,
  63. tblend=all_mode=difference128,
  64. tblend=all_mode=difference128,
  65. tblend=all_mode=difference128,
  66. spp=4:10,
  67. tblend=all_mode=average,
  68. tblend=all_mode=difference128,
  69. tblend=all_mode=difference128,
  70. tblend=all_mode=difference128,
  71. spp=4:10,
  72. tblend=all_mode=average,
  73. tblend=all_mode=difference128,
  74. tblend=all_mode=difference128,
  75. tblend=all_mode=difference128
  76. "
  77.  
  78.  
  79. # Isolate motion-vectors using 'difference128' blend filter
  80. # - add brightness, contrast, and scaling, to taste
  81. ffplay \
  82. -flags2 +export_mvs \
  83. -i "video.mp4" \
  84. -vf \
  85. "
  86. split[original],
  87. codecview=mv=pf+bf+bb[vectors],
  88. [vectors][original]blend=all_mode=difference128,
  89. eq=contrast=7:brightness=-0.3,
  90. scale=720:-2
  91. "
  92.  
  93. # chromatic aberration in ffmpeg
  94. # ffplay used for testing; filtergraph can be directly inserted into ffmpeg
  95.  
  96. ffplay\
  97. -i video.mkv\
  98. -vf\
  99. "split=3[r][g][b];\
  100. nullsrc=size=640x360[base1];\
  101. nullsrc=size=640x360[base2];\
  102. nullsrc=size=640x360[base3];\
  103. [r]lutrgb=g=0:b=0[red];\
  104. [g]lutrgb=r=0:b=0[green];\
  105. [b]lutrgb=r=0:g=0[blue];\
  106. [base1][red]overlay=x=10:shortest=1,format=rgb24[x];\
  107. [base2][green]overlay=x=0:shortest=1,format=rgb24[y];\
  108. [base3][blue]overlay=y=10:shortest=1,format=rgb24[z];\
  109. [x][y]blend=all_mode='addition'[xy];\
  110. [xy][z]blend=all_mode='addition'[xyz];\
  111. [xyz]crop=630:350:10:10,scale=640:360:out_color_matrix=bt709"
  112.  
  113. # Averaged Key-Frames
  114. # To extract keyframes from a video using FFmpeg
  115. ffmpeg -i video.mp4 -vf "select=eq(pict_type\,I)" -vsync vfr frame-%08d.png
  116.  
  117. # To merge images together with ImageMagick
  118. convert *.png -evaluate-sequence mean output.png
  119.  
  120. #Pixel Array
  121. # A trimmed down version, using only one instance of FFmpeg.
  122. # The disadvantage with this is the lack of progress display.
  123. ffmpeg -i input.vid -frames 1 -vf "scale=1:1,tile=640x220" output.png
  124.  
  125. # OR v1
  126. # First instance of FFmpeg traverses the frames, the second concatenates them.
  127. ffmpeg -y -i video.mkv -vf "scale=1:1" -c:v png -f image2pipe pipe:1 |\
  128. ffmpeg -y -i pipe:0 -vf "tile=640x242" output.png 2> /dev/null
  129.  
  130. ## ECHO!!!! by Rob Mac
  131. ## so to deconstruct, we have the normal input, then use seeking to offset each input of the same file each time:
  132. -i k1.mkv -ss 00:00:00.25 -i k1.mkv, and so on, i'm using offsets of 250ms (0.25 seconds) but you can use whatever
  133. works for you, ffmpeg will try its best to match it. then we use [0][1]blend[a] and [1][2]blend[b] to make the two
  134. echoes, nothing too unusual there. after that each needs a stage to blend back together, so we go [a][b]blend[p] to
  135. mix down our echoes, then [0][p]blend[o] to mix back into main signal, and [o] to output. if we did more, say 4 instead
  136. of 2, we would do [0][1]blend[a], [1][2]blend[b], [2][3]blend[c],
  137. then [b][c]blend[mix1],[a][b]blend[mix2],[mix1][mix2]blend[echo],[0][echo]blend[o] instead. i probably wouldn't want to
  138. use this for more than a few echoes to be honest just because making the filter toplogy is a bit of a pain, but it encodes
  139. pretty quick and does some fun stuff in different blend modes..
  140. ffmpeg -i k1.mkv -ss 00:00:00.25 -i k1.mkv -ss 00:00:00.50 -i k1.mkv -filter_complex "[0][1]blend=all_mode=lighten[a];[1][2]blend=all_mode=lighten[b];[a][b]blend=all_mode=lighten[p];[0][p]blend=all_mode=lighten[o]" -map "[o]" -c:v h264 -crf 15 kd.mp4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement