Advertisement
Guest User

webm converter hmm

a guest
Apr 4th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2.  
  3. :: WebM converter/watermarker script
  4. :: Requirements:
  5. ::      an ffmpeg installation and path (you need to be able to type ffmpeg into the command line)
  6. ::
  7. :: Configuration:
  8. ::      Edit the Options below to your needs. Important ones are outdir, wmark, and threadcount.
  9. ::      Don't put any spaces after your options, it breaks things.
  10. ::
  11. :: How to run:
  12. ::      Either run the program and input the file location through text, or
  13. ::      drag a video file onto the batch script and continue operation.
  14. ::      Once you have a video file, just input the start time and duration.
  15. ::      Then, enter the output name (without the .webm) and let ffmpeg do its work.
  16. ::
  17. :: Notes:
  18. :: This is kinda slow to get good video quality.
  19. :: This does NOT rescale the output, so the resolution will be the same as your input file.
  20.  
  21. ::::::: OPTIONS :::::::
  22. :: outdir       : Output directory for the WebMs
  23. :: wmark        : Path to the watermark
  24. :: bitrate      : Bitrate (5M=5000kbps, use what you like)
  25. :: audio        : Audio flag, 1: enable 0: disable
  26. :: watermark    : Watermark flag, 0: disable, 1: bottom right, 2: bottom left, 3: top left, 4:top right
  27. :: wmarkxpad    : Watermark X Padding in pixels, I like 5
  28. :: wmarkypad    : Watermark Y Padding in pixels, I like 5
  29. :: threadcount  : Thread count, reccomend to set to the max number of threads
  30.  
  31. SET outdir=K:\Videos\webms\
  32. SET wmark=K:\Videos\webms\wmark.png
  33. SET bitrate=5M
  34. SET audio=0
  35. SET watermark=1
  36. SET wmarkxpad=5
  37. SET wmarkypad=5
  38. SET threadcount=7
  39.  
  40. SET ddrop="%~1"
  41.  
  42. IF %ddrop%=="" (
  43.     SET /p infile="Enter Path to Input File: "
  44. ) ELSE (
  45.     SET infile=%ddrop%
  46. )
  47.  
  48. IF %audio%==1 (
  49.     SET la=-c:a libvorbis
  50. ) ELSE (
  51.     SET la=-an
  52. )
  53.  
  54. IF %watermark%==1 (
  55.     SET filterarg=-i %wmark% -filter_complex "overlay=(main_w-overlay_w-%wmarkxpad%):(main_h-overlay_h-%wmarkypad%)"
  56. )
  57. IF %watermark%==2 (
  58.     SET filterarg=-i %wmark% -filter_complex "overlay=%wmarkxpad%:(main_h-overlay_h-%wmarkypad%)"
  59. )
  60. IF %watermark%==3 (
  61.     SET filterarg=-i %wmark% -filter_complex "overlay=%wmarkxpad%:%wmarkypad%"
  62. )
  63. IF %watermark%==4 (
  64.     SET filterarg=-i %wmark% -filter_complex "overlay=(main_w-overlay_w-%wmarkxpad%):%wmarkypad%"
  65. )
  66.  
  67. IF %watermark%==0 (
  68.     SET filterarg=
  69. )
  70.  
  71. IF NOT EXIST %infile% (
  72.     ECHO Err: file not found - %infile% >&2
  73.     pause
  74.     EXIT /B 1
  75. )
  76.  
  77. SET /p stime="Start Time (mm:ss) or ss : "
  78. SET /p length="Video Length: (mm:ss) or ss : "
  79. SET /p outname="Output filename: "
  80.  
  81. ffmpeg -ss %stime% -i %infile% %filterarg% -t %length% -c:v libvpx -b:v %bitrate% %la% -threads 7 %outdir%%outname%.webm
  82.  
  83. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement