Page 1 of 1

convert .wmv to .mp4

Posted: Mon Nov 19, 2012 11:29 am
by Oscar_NL
Hello,

I have on my local Mint install a folder which does have subfolders,
in those subfolders are .wmv files located.

Since one of my online scripts does not recognize .wmv,
I would like to convert the .wmv files over to .mp4 format.

It should keep quality/duration/dimensions + orginal file name, but just get the extension replaced.

Is here someone that can point me into the right direction ?
Thanks in advance.

Re: convert .wmv to .mp4

Posted: Mon Nov 19, 2012 1:33 pm
by remoulder

Re: convert .wmv to .mp4

Posted: Mon Nov 19, 2012 3:59 pm
by nomko
WinFF can do the trick. Works easy and has an easy to use GUI. And it is also available in the repo's.
http://winff.org/html_new/

Re: convert .wmv to .mp4

Posted: Mon Nov 19, 2012 5:57 pm
by cra1g321
You could also maybe check out Transmageddon - http://www.linuxrising.org/index.html

or Arista Transcoder - http://www.transcoder.org/

I think both are available in Linux Mint.

Re: convert .wmv to .mp4

Posted: Mon Nov 19, 2012 7:27 pm
by Oscar_NL
Thanks all,

Unfortunately still not able to get mp4 files + have the folder structure untouched, or copied.
My location is movie/category/a/ and then it might be that this folder "a" does have 100 or 200 dirs in it,
which should be kept in tact.
some of the above softwares don't support batch files.
With about 1400 files to encode, that would take me to long, I'm Sure Mint can be my supporter :)
:)

Re: convert .wmv to .mp4

Posted: Tue Nov 20, 2012 11:48 am
by Flemur
If you want batch conversion, which you didn't mention at first, try ffmpeg; the winff GUI to ffmpeg can help create a command-line to work from. Avidemux has some batch capabilites, but they're very poorly implemented.

Convert anything (change *.mp4 to whatever, e.g. *.wmv) to medium-quality .avi files:
++
for i in *.mp4; do
echo "Converting: " $i;
ffmpeg_avicon $i ;
done;
rename 's/\.mp4//' *.avi
++

ffmpeg_avicon script:
+
/usr/bin/ffmpeg -i $1 \
-f avi -vcodec mpeg4 -vtag XVID \
-b 400k -qmin 6 -qmax 9 \
-acodec libmp3lame -ab 64k -ac 2 \
-threads 2 \
$1.avi
++
Makes output files named "originalname.mp4.avi" -> "originalname.avi" with the "rename" above.

Use winff to see what to change in the ffmpeg params to to convert TO mp4.

Re: convert .wmv to .mp4

Posted: Tue Nov 20, 2012 12:12 pm
by Oscar_NL
Hello Flemur,

Thank you for this. Meanwhile tried to convert 1400 .wmv files to .mp4 format.
I initiated to do this with ffmpeg, but since it's depricated, "avconv" is recommended.

The command I use is :
avconv -i '/home/user/a/b/c/_Done_Uploaded/abc/2292/filename-0.wmv' -f mp4 -acodec mp2 '/home/user/a/b/c/_Done_Uploaded/abc/2292/filename-0.mp4'
When I add the first 100 lines like above, but just with increasing filename-1.wmv, filename-2.wmv etc,
after about 30 of 35 converted files the following msg does pops up:

File '/home/user/a/b/c/_Done_Uploaded/abc/2292/filena
avconv -i ' already exists. Overwrite ? [y/N]
*Please note the broken file name, and missing .ext !

Choosing "y" or "N" doesnt make much difference, it will try to convert 1 or 2 files more, and then closes it's process.

I also tried to have the paths without use of the Apostrophe Sign.

If my rules are this
avconv -i '/home/user/a/b/c/_Done_Uploaded/abc/2292/filename-0.wmv' -f mp4 -acodec mp2 '/home/user/a/b/c/_Done_Uploaded/abc/2292/filename-0.mp4'
avconv -i '/home/user/a/b/c/_Done_Uploaded/abc/2292/filename-1.wmv' -f mp4 -acodec mp2 '/home/user/a/b/c/_Done_Uploaded/abc/2292/filename-1.mp4'

How one would get this the best in a bash batch script, since I'd not think the command line will accept 1400 lines.