Project-Id-Version: Trac 0.12
Report-Msgid-Bugs-To: trac-dev@googlegroups.com
POT-Creation-Date: 2008-01-30 09:20+0100
PO-Revision-Date: 2010-07-19 23:05+0200
Last-Translator: Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
Language-Team: en_US <trac-dev@googlegroups.com>
Plural-Forms: nplurals=2; plural=(n != 1)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Generated-By: Babel 0.9.6

Warning: Can't synchronize with repository "(default)" (Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? ). Look in the Trac log for more information.

CreateFlashVideo: convert2flash.bat

File convert2flash.bat, 2.1 KB (added by sebastian, 9 years ago)

Convert your movies to smaller flash videos

Line 
1@echo off
2REM
3REM convert2flash.bat, version 1.0
4REM Convert movie files to flash video using ffmpeg (www.ffmpeg.org)
5REM
6REM This script could be used to convert movie files to flash movies for
7REM the opensource social photo gallery www.phtagr.org. Drag'n'drop movie
8REM files or folders to the batch file and upload the flash movies.
9REM
10REM Requirements: ffmpeg.exe from www.ffmpeg.org. Copy ffmpeg.exe
11REM to the same directory as convert2flash.bat
12REM
13REM 2010 by Sebastian Felis sebastian@phtagr.org
14REM
15REM Feel free to use, copy, and modify it unless keeping original copyright
16REM notice. Please report fixes and improvements to the original author.
17REM
18REM History:
19REM - 2010-04-12 first release
20REM
21
22REM Add path of the script to PATH environment
23set _PATH=%~dp0
24set PATH=%_PATH%;%PATH%
25
26set SCRIPT=%0
27set FFMPEG=ffmpeg.exe
28set LOG="%_PATH%debug.txt"
29set LOG=NUL
30
31REM Test for ffmepg in PATH
32%FFMPEG% -version > NUL 2> NUL
33if errorlevel 1 (
34 echo ffmpeg is missing! >> %LOG%
35 echo ffmpeg is missing! Download it from http://sourceforge.net/projects/mplayer-win32/files/FFmpeg/
36 goto :eof
37)
38
39REM Loop through each argument
40:loop_args
41 if [%1]==[] goto :eof
42 call :read_arg %1
43 shift
44 goto :loop_args
45
46REM Read one argument
47:read_arg
48 if exist "%~f1\*" (
49  call :read_dir %1
50 ) else (
51  for /F %%G IN (".AVI .avi .MPEG .mpeg .MPG .mpg .MOV .mov") do if [%~x1]==[%%G] call :s_convert %1
52 )
53 goto :eof
54
55REM Read directories recursivly for video files
56:read_dir
57 pushd %1
58 echo Read directory %~f1 >> %LOG%
59 REM Read all movie files
60 for /f "tokens=*" %%G in ('dir /b *.AVI *.MPEG *.MPG *.MOV') do (call :s_convert "%%G")
61 REM Recusive directory call
62 for /f "tokens=*" %%G in ('dir /a:d /b') do (call :read_dir "%%G")
63 popd
64 goto :eof
65
66REM Convert given movie file
67:s_convert
68 REM Replace extension of source filename to flash extension FLV
69 set DST=%~dpn1
70 set DST=%DST%.FLV
71 set SRC=%~f1
72 if not exist "%DST%" (
73  echo Convert %SRC% to %DST% >> %LOG%
74  %FFMPEG% -i "%SRC%" -s 320x240 -r 15 -b 256k -ar 22050 -ab 48k "%DST%" > NUL
75 ) else (
76  echo Skip existing %DST% >> %LOG%
77 )
78 goto :eof