Brak opisu

JTX-Encoder.bat 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. @echo off
  2. title= ---- Encodeur du JTX ----
  3. color 0D
  4. cls
  5. where ffpmeg
  6. if %errorlevel% neq 0 (
  7. cls
  8. color 0C
  9. echo La commande ffmpeg ne peut pas ˆtre ex‚cut‚e actuellement.
  10. echo.
  11. echo Pour faire marcher l'encodeur, ajoute le chemin vers ffmpeg.exe
  12. echo dans la variable systŠme PATH et relance le programme.
  13. echo.
  14. pause
  15. exit
  16. )
  17. echo ******************************************************
  18. echo ****************** Encodeur du JTX *******************
  19. echo ******************************************************
  20. echo.
  21. echo Ce programme encode les vid‚os du dossier dans lequel
  22. echo il est plac‚, puis transfŠre les fichiers originaux
  23. echo dans un dossier Originaux/.
  24. echo Aucune vid‚o n'est donc supprim‚e.
  25. echo.
  26. echo 1 : FullHD 1920x1080 8 Mbits/s 25 i/s
  27. echo 2 : HD 1280x720 3 Mbits/s 25 i/s
  28. echo 3 : Web 854x480 1.5 Mbits/s 25 i/s
  29. echo 4 : Archives 720x576 1.5 Mbits/s 25 i/s
  30. choice /C 1234 /N /M "S‚lectionez le r‚glage en appuyant sur [1], [2], [3] ou [4] :"
  31. echo.
  32. if errorlevel 4 (
  33. echo ********************************************************
  34. echo Encodage au format Archives : 720x576 1.5 Mbits/s 25 i/s
  35. echo ********************************************************
  36. call :encoding 4
  37. )
  38. if errorlevel 3 (
  39. echo ***************************************************
  40. echo Encodage au format Web : 854x480 1.5 Mbits/s 25 i/s
  41. echo ***************************************************
  42. call :encoding 3
  43. )
  44. if errorlevel 2 (
  45. echo ******************************************
  46. echo Encodage en HD : 1280x720 3 Mbits/s 25 i/s
  47. echo ******************************************
  48. call :encoding 2
  49. )
  50. if errorlevel 1 (
  51. echo ***********************************************
  52. echo Encodage en FullHD : 1920x1080 8 Mbits/s 25 i/s
  53. echo ***********************************************
  54. call :encoding 1
  55. )
  56. goto:eof
  57. :encoding
  58. echo.
  59. md Originaux
  60. color 0a
  61. for %%a in (*.*) do (
  62. call :encodingcheck %1 "%%a"
  63. )
  64. goto:end
  65. :encodingcheck
  66. set toencode="false"
  67. set extension="%~x2"
  68. if %extension%==".mkv" set toencode="true"
  69. if %extension%==".MKV" set toencode="true"
  70. if %extension%==".avi" set toencode="true"
  71. if %extension%==".AVI" set toencode="true"
  72. if %extension%==".mpg" set toencode="true"
  73. if %extension%==".MPG" set toencode="true"
  74. if %extension%==".webm" set toencode="true"
  75. if %extension%==".WEBM" set toencode="true"
  76. if %extension%==".mp4" set toencode="true"
  77. if %extension%==".MP4" set toencode="true"
  78. if %extension%==".mov" set toencode="true"
  79. if %extension%==".MOV" set toencode="true"
  80. if %extension%==".mts" set toencode="true"
  81. if %extension%==".MTS" set toencode="true"
  82. if %extension%==".mxf" set toencode="true"
  83. if %extension%==".MXF" set toencode="true"
  84. if %toencode%=="true" (
  85. if %1==1 call :fullhd %2
  86. if %1==2 call :hd %2
  87. if %1==3 call :web %2
  88. if %1==4 call :archives %2
  89. )
  90. goto:eof
  91. :fullhd
  92. title= ---- Encodeur du JTX ---- Encodage de %1 en FullHD
  93. move %1 Originaux/
  94. ffmpeg -i Originaux/%1 -threads 0 -c:v libx264 -b:v 8M -maxrate 12M -r 25 -s 1920x1080 -x264opts level=4 -c:a aac -strict experimental -b:a 192k -y "%~np1.mp4"
  95. goto:eof
  96. :hd
  97. title= ---- Encodeur du JTX ---- Encodage de %1 en HD
  98. move %1 Originaux/
  99. ffmpeg -i Originaux/%1 -threads 0 -c:v libx264 -b:v 3M -maxrate 4.5M -r 25 -s 1280x720 -x264opts level=3.1 -c:a aac -strict experimental -b:a 192k -y "%~np1.mp4"
  100. goto:eof
  101. :web
  102. title= ---- Encodeur du JTX ---- Encodage de %1 au format Web
  103. move %1 Originaux/
  104. ffmpeg -i Originaux/%1 -threads 0 -c:v libx264 -b:v 1.5M -maxrate 2.25M -r 25 -s 854x480 -x264opts level=3 -c:a aac -strict experimental -b:a 192k -y "%~np1.mp4"
  105. goto:eof
  106. :archives
  107. title= ---- Encodeur du JTX ---- Encodage de %1 au format Archives
  108. move %1 Originaux/
  109. ffmpeg -i Originaux/%1 -threads 0 -c:v libx264 -b:v 1.5M -maxrate 2.25M -r 25 -s 720x576 -x264opts level=3 -c:a aac -strict experimental -b:a 192k -y "%~np1.mp4"
  110. goto:eof
  111. :end
  112. color 0b
  113. title= ---- Encodeur du JTX ---- Encodage termine
  114. cls
  115. echo.
  116. echo ***************************
  117. echo **** Fin de l'encodage ****
  118. echo ***************************
  119. echo.
  120. echo Les fichiers originaux se trouvent dans le dossier
  121. echo Originaux/
  122. echo.
  123. echo Merci d'avoir choisi l'encodeur du JTX !
  124. echo.
  125. Pause
  126. exit