This forum has been archived. All content is frozen. Please use KDE Discuss instead.

script for automatic rendering

Tags: None
(comma "," separated)
juzerek
Registered Member
Posts
6
Karma
0

script for automatic rendering

Sun Dec 26, 2010 10:24 am
Hallo Group Members.
I have to render 1000 avi files to *.mp4 ones. For each file separatelly.
All of them should be rendered with the same kdenlive params: using 6000k/2pass/force Interlace.

Setting rendering process for each of 1000 files is tedious task.

Is there a way to set it up in automatic way, some batch loop:
for i in *.avi
do
kdenlive someProjectTemplate_6000k_2pass_forceInterlace $i $i.mp4
done

?
best regards,
Paul
geoffrey
Registered Member
Posts
100
Karma
0

Re: script for automatic rendering

Sun Dec 26, 2010 11:14 pm
I don't think this can be done in kdenlive - but I'm not certain. I'm sure it has been done using the command line tools ffmpeg or mencoder though. Seems pretty straight forward except for the 2 pass part which may complicate things a little.
Maybe see if anyone posts something here or google it.
Good Luck.





Granjow
Moderator
Posts
247
Karma
0

Re: script for automatic rendering

Mon Dec 27, 2010 11:01 am
juzerek, cannot you simply use ffmpeg directly? You only want to transcode, right? This should be an easy task. I'd ask on freenode#ffmpeg for the precise ffmpeg flags because I always get them the wrong way round.
OpenHawk
Registered Member
Posts
15
Karma
0

Re: script for automatic rendering

Wed Dec 29, 2010 9:43 am
I'm interested in this myself. Someone got a link, where batch-rendering for ffmpeg is discribed?
Granjow
Moderator
Posts
247
Karma
0

Re: script for automatic rendering

Wed Dec 29, 2010 2:37 pm
Just throwing in some bookmarks. For specific needs see google or #freenode.
http://howto-pages.org/ffmpeg/
http://linux.byexamples.com/archives/295/convert-audio-encoding-format-with-ffmpeg/
http://www.linuxjournal.com/article/8517
OpenHawk
Registered Member
Posts
15
Karma
0

Re: script for automatic rendering

Thu Dec 30, 2010 4:13 pm
Again thanks a lot Granjow,

after reading through your links I googled a littel by myself and here is my result, for anyone who has no idea about creating a shellscript(like I had none):

To automatically render all files in a folder - in my case m2ts-files - to another format - in my case .avi with codec mjpeg/mp3 - you have to

1) create a shell script file -> right mouseclick in nautilus "create document" -> "empty file"
2) rename it into "your preferred filename".sh (for me it was "m2ts2avi.sh")
3) make the file executable -> right click on it properties->permissions->allow executing file as program
4)open with texteditor
5)enter the script:

for f in *.m2ts;
do ffmpeg -i "$f" -f avi -acodec libmp3lame -ab 256k -ar 48000 -vcodec mjpeg -s 1920x1080 -b 30000k -deinterlace "${f%hdv.m2ts}.avi";
done

6) move the shell script file into the directory your sourcefiles are lying.
7) run the shell script file in a terminal

I personally don't know anything about this code but I can guess. And I guess f is a variable defined in the first line as all files ending with .m2ts.
The second line is what performs the action:
starting ffmpeg defining the input file as "f", means all files ending with .m2ts
at the back of the second line is the outputfilname defined.
beneath input and output lies the ffmpeg options I chose for converting
done :)


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], Yahoo [Bot]