Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. Time: XX.YYYYY (XX are the seconds and YYYYY are the decimals (as much as you want, at least two if you want a precise enough cut)
  2. example: "651.165" is the time for 10 minutes, 51 seconds and 165 milliseconds
  3.  
  4.  
  5. Note: "E:\encoding\" is the path to my work place, I recommand you to create your own for example "C:\Users\<YourSession>\Documents\Encoding" if you don't have any other hard drive
  6.  
  7.  
  8. * Scaling (from 720 to 480 for example) *
  9. ffmpeg -i E:\encoding\<input>.webm -map 0:v -map 0:a -shortest -c:v libvpx-vp9 -b:v 0 -crf 20 -pix_fmt yuv420p -vf scale=-1:<resolution> -deadline good -cpu-used 1 -tile-columns 6 -threads 5 -c:a libopus -b:a 320k -ac 2 E:\encoding\<output>.webm
  10. (res= 720 or 480 usually)
  11. * cuting video *
  12. ffmpeg -ss <StartTime> -to <EndTime> -i E:\encoding\<input>.webm -map 0:v -map 0:a -shortest -c:v libvpx-vp9 -b:v 0 -crf 20 -pix_fmt yuv420p -deadline good -cpu-used 1 -tile-columns 6 -threads 5 -c:a libopus -b:a 320k -ac 2 E:\encoding\<output>.webm
  13.  
  14. * cuting and scaling (from 720 to 480 for example) *
  15. ffmpeg -ss 586.213 -to 632.948 -i E:\encoding\01.mkv -map 0:v -map 0:a -shortest -c:v libvpx-vp9 -b:v 0 -crf 20 -pix_fmt yuv420p -vf scale=-1:<resolution> -deadline good -cpu-used 1 -tile-columns 6 -threads 5 -c:a libopus -b:a 320k -ac 2 E:\encoding\DeadmanWonderlandInsKomoriuta_720.webm
  16.  
  17. * extract audio from a video *
  18. ffmpeg -i E:\encoding\<input_video>.webm -codec:a libmp3lame -b:a 320k -compression_level 7 E:\encoding\<output_audio>.mp3
  19.  
  20. * add audio to a video *
  21. ffmpeg -i E:\encoding\<input_video>.webm -i E:\encoding\<input_audio>.ogg -c copy -map 0:v -map 1:a E:\encoding\<output>.webm
  22.  
  23. * check volume levels for mp3/webm/whatever // For AMQ: Aim at max peak between -5 and -9dB, and mean around -20dB* -Approximate values, do not take those as granted-
  24. ffmpeg -i E:\encoding\<input>.mp3 -af "volumedetect" -vn -sn -dn -f null /dev/null
  25.  
  26. * scale audio (from ogg to mp3 for example) *
  27. ffmpeg -i E:\encoding\<input>.ogg -b:a 320k -compression_level 7 E:\encoding\<output>.mp3
  28.  
  29. ------------------------------------------------------------------------------------------------------------------------------------------
  30.  
  31. * to cut in-between a video using ffmpeg *
  32. ffmpeg -ss <StartTime> -to <EndTime of the first half> -i E:\encoding\<input>.webm -map 0:v -map 0:a -shortest -c:v libvpx-vp9 -b:v 0 -crf 20 -pix_fmt yuv420p -deadline good -cpu-used 1 -tile-columns 6 -threads 5 -c:a libopus -b:a 320k -ac 2 E:\encoding\firstpart.webm
  33. ffmpeg -ss <StartTime of the second half> -to <EndTime of the second half> -i E:\encoding\<input>.webm -map 0:v -map 0:a -shortest -c:v libvpx-vp9 -b:v 0 -crf 20 -pix_fmt yuv420p -deadline good -cpu-used 1 -tile-columns 6 -threads 5 -c:a libopus -b:a 320k -ac 2 E:\encoding\secondpart.webm
  34. <etc if there are more cuts to made>
  35.  
  36. * Create a .txt file containing this *
  37. file 'E:\encoding\firstpart.webm'
  38. file 'E:\encoding\secondpart.webm'
  39. <etc if there are more different part>
  40.  
  41. * use this command to fuse the different part *
  42. ffmpeg -f concat -safe 0 -i E:\encoding\<file>.txt -c copy E:\encoding\<output>.webm
  43.  
  44. * add this to a line to change volume *
  45. -af volume=-2.5dB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement