Script for batch converting .mkv files with ffmpeg

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

Script for batch converting .mkv files with ffmpeg

#1 Post by ally »

hi

I am batch converting .mkv files using ffmpeg

I have 2 drives, one with the raw files the second is the target drive

all is well apart from I need to move the original source file to another folder on the same drive

Code: Select all

#!/bin/bash
for i in *.mkv;
do 
	ffmpeg -i "$i" -c:v libx264 -preset medium -crf 15 -c:a copy /media/dvdrip_2/Film/conv_"$i"
	mv "$i" /media/dvdrip_1/Converted/"$i"
done
the mv line fails, can somebody help

:)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#2 Post by MochiMoppel »

No error message?

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#3 Post by ally »

no

it's not a big deal as I am doing it manually, just curious

I thought maybe I had the syntax wrong

:)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#4 Post by MochiMoppel »

What then do you mean by "mv line fails"? Are you saying that the files are not moved at all? That would be odd. Run mv in verbose mode (mv -v). You should get a message of what has been done. Syntax looks OK.

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#5 Post by muggins »

Ally,

I don't know if I've been using the wrong commandline options with ffmpeg, but have always been unhappy with the quality of the transcoded video. No such problems with handbrake-CLI, Just google & there are plenty of examples of batch processing with handbrake-CLI.

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#6 Post by ally »

thanks both

yes, the file failed to move

I will try the verbose on the next batch

the above script reduces the file size about 30%, am happy with the quality, I had to junk 500 rips because the output was poor, only a months work...

:)

Post Reply