Batch convert video in entire folder using ffmpeg
I am trying to schedule batch conversion of all mpeg in a single base folder to swf in another output folder, backup original mpeg, and delete original mpeg from base folder.
I would like to run when mpeg exist (appear) in base folder or on a schedule. I was planning on scheduling bat files containing ffmpeg commands to run and use xcopy/del for backup but other posts seem to handle similar tasks with bash shell scripts (which I am not too familiar) I am open to whichever method works best. When I try to run the following...I get the error "cannot open file C:\OUTPUT\*.swf" Code:
c:\ffmpeg\ffmpeg.exe -i "C:\BASE\*.mpg" -ar 44100 -ab 192 "C:\OUTPUT\*.swf" ?????? Code:
for x in *.mpg; do ffmpeg -i "$x" -ar 44100 -ab 192 "`basename "$x" .mpg`.swf"; done I am not sure how to use bash scripts similar to below to schedule conversions of an entire folder. bash example: mpg2swf Code:
#!/bin/bash Thanks. |
There are a gazillion applications and scripts already that can do what you want, but since your commandline works, lets just expand. I hope commentary is kind of self-explanatory else you might want to read some Bash scripting guides like http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html and http://www.tldp.org/LDP/Bash-Beginne...tml/index.html.
Code:
#!/bin/sh -- Code:
#!/bin/sh -- |
pathname syntax
The "cannot open file C:\OUTPUT\*.swf" error actually indicates that you are using a Windows-style pathname. On the other hand you are using a bash script, that would require UNIX-style pathnames. I suppose this is even true if you run CygWin on Windows, though I'm not sure of this.
Linux Archive |
I'm sorry, it's still not working for me.
I am using cygwin in a WinXP environment. I tested a simple bash script and it works using cygwin through bash.exe. Code:
echo 123 I can't understand what I may be doing wrong. Thanks for sticking with me on this... seraphim172 - yes. The code that generated that error was run from win cmd line. It didn't work most likely because of my attempt to use wildcards to perform conversion on multiple files in a folder. Most likely this is incorrect ffmpeg syntax. I am also looking into trying to schedule bash scripts and unSpawn is trying to help me figure this out. If I knew the proper syntax to run ffmpeg on a folder from cmd I would use that. If I could work out a bash/shell script to do the same I would try to use that. Applications and utilities I have found require manual selection of individual files in a folder to do batch conversion which is not flexible enough. Thanks again. |
Now I am able to get the error:
Quote:
|
All times are GMT -5. The time now is 01:11 AM. |