PDA

View Full Version : [Download] Movie renamer


iBeech
2009-03-31, 12:17
Hey chaps,

I've developed a small application which does the following:

-Renames your existing movies and adds the following info:
-Resolution
-Media (bluray / dvd)
-Sound Channels
-Audio Codec
-Recursively scans directories
-Renames moviename-fanart.jpg and moviename.tbn aswel :)

It does it in such a way that current builds of XBMC will detect appropraite information :)

IMPORTANT: When entering the movie name, make sure you strip out any existing tags, as they will be left where they are.

No guarantees with this!

http://cid-b2f8b72c9b105d90.skydrive.live.com/self.aspx/.Public/Renaner%200.3.rar

mYre
2009-03-31, 12:23
Just got a question about that, what about DVD Folders? (VIDEO_TS.ifo) will tags work for them too?

iBeech
2009-03-31, 12:26
<scratch>not supported atm. please skip dvd files</scratch>

infact... i've not tested it. I certainly haven't put a filter in for DVD files, and i've not tested the mediainfo.dll with dvd files.... give it ago :)

Ayla
2009-03-31, 12:28
I see in another thread here, that djh is working on getting movie info directly from the .nfo. He showed a screenshot where it works.

The .nfo video info is populated from MIP.

Wouldn't it be better to wait for that update, before renaming all your files?

But, thanks for your work!

iBeech
2009-03-31, 12:30
Most likley! But this is something I did the other day, thought i'd share :)

the info for the studio already comes out of the NFO, so if you cannot wait, this will make your tags work =)

MrTourettes
2009-03-31, 12:36
Nice one I will give this a play.

Montellese
2009-03-31, 12:38
Well as I never used MIP until now and relied on Media Companion, this is a nice tool.
But I'm gonna give MIP a go as well but only if it manages to import all my movies from the existing nfo files.

Maybe you could extend your program to write the tags into the nfo directly. Shouldn't be too difficult, as it's XML based.
Maybe you could even adjust your program in that way that you can choose whether to put the tags in the filename or in the nfo file (or even both) so that everyone can have it the way he likes.

iBeech
2009-03-31, 12:40
thats a pretty good idea. i'll look into that at lunch!

Montellese
2009-03-31, 12:45
Thanks a lot.
I would do it myself but I'm at work atm and you already got the base application.

iBeech
2009-03-31, 12:50
do you know what the tag names are for resolution / audio codec / channels / resolution / media type in the NFO file?

mYre
2009-03-31, 12:51
<streamdetails>
<video>
<width>1280</width>
<height>544</height>
<codec>h264</codec>
<formatinfo>AVC</formatinfo>
<duration>1mn 1s 166ms</duration>
<bitrate>7 231 Kbps</bitrate>
<bitratemode />
<bitratemax />
<container>.mkv</container>
<codecid>V_MPEG4/ISO/AVC</codecid>
<codecidinfo />
<scantype>Progressive</scantype>
</video>
<audio>
<language />
<codec>DTS</codec>
<channels>6</channels>
<bitrate>1 536 Kbps</bitrate>
</audio>
</streamdetails>

Thats a sample

iBeech
2009-03-31, 12:52
cheers! i'll get this done at lunch and hopefully post up a new version tonight.. or earlier if i get it done ;)

Montellese
2009-03-31, 12:53
Check this post from fekker:

http://xbmc.org/forum/showthread.php?t=47842

He somehow puts it in the <credits> or <votes> tags. Don't ask me why maybe these are almost never used and he didn't wanna add new ones.

But what mYre provides looks much better.

mYre
2009-03-31, 12:53
would be great :) maybe you can test if dvd files are checked too? i can't right now because i'm at work^^ would be awesome

cheers

Montellese
2009-03-31, 12:55
Btw mYre where did you get that XML structure from?
Is this an official suggestion how it will be intregrated in XMBC as a whole?

Because as far as I understand what fekker proposed is just some special way to do it for Aeon atm because it isn't supported by XMBC yet.

mYre
2009-03-31, 12:56
Check this post from fekker:

http://xbmc.org/forum/showthread.php?t=47842

He somehow puts it in the <credits> or <votes> tags. Don't ask me why maybe these are almost never used and he didn't wanna add new ones.

But what mYre provides looks much better.

i used MIP and it does it like i posted <channels>...</channels> and so on
in the new version he doesn't take the credits or votes if i saw it correctly.

cheers

Btw mYre where did you get that XML structure from?
Is this an official suggestion how it will be intregrated in XBMC as a whole?

Because as far as I understand what fekker proposed is just some special way to do it for Aeon atm because it isn't supported by XBMC yet.

out of MIP just tested a file and it gave me the .nfo code like that :) reloaded library on xbmc and voooila it works :)

cheers

*EDIT*: Ok i tested it again and didn't work, but this xml code just came from the MIP generated .nfo, i guess / hope djh implements it in the new release/build

by now it just works (like i saw) if you rename the file to for example: hero.2002.720p.bluray.mkv

so it worked for me :S

Montellese
2009-03-31, 12:59
Can you check your <credits> tag? Coz the one posted by Hitcher had both tags used.
http://xbmc.org/forum/showpost.php?p=305856&postcount=2

<credits>Universal_Pictures - 720p DTS 6ch eng eng rum cze</credits>

mYre
2009-03-31, 13:03
Can you check your <credits> tag? Coz the one posted by Hitcher had both tags used.
http://xbmc.org/forum/showpost.php?p=305856&postcount=2

<credits>Universal_Pictures - 720p DTS 6ch eng eng rum cze</credits>

Here's the whole .nfo i got

<?xml version="1.0" encoding="utf-8"?>
<movie xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<fileinfo>
<lastupdate>2009-03-31T11:27:41.890625+02:00</lastupdate>
<version>1.2</version>
<streamdetails>
<video>
<width>1280</width>
<height>544</height>
<codec>h264</codec>
<formatinfo>AVC</formatinfo>
<duration>1mn 1s 166ms</duration>
<bitrate>7 231 Kbps</bitrate>
<bitratemode />
<bitratemax />
<container>.mkv</container>
<codecid>V_MPEG4/ISO/AVC</codecid>
<codecidinfo />
<scantype>Progressive</scantype>
</video>
<audio>
<language />
<codec>DTS</codec>
<channels>6</channels>
<bitrate>1 536 Kbps</bitrate>
</audio>
</streamdetails>
</fileinfo>
<title>Ying xiong </title>
<rating>8.0</rating>
<year>2002</year>
<top250 />
<votes>66,800</votes>
<outline>A series of Rashomon-like flashback accounts shape the story of how one man defeated three assassins who sought to murder the most powerful warlord in pre-unified China. </outline>
<plot>In ancient China, before the reign of the first emperor, warring factions throughout the Six Kingdoms plot to assassinate the most powerful ruler, Qin. When a minor official defeats Qin's three principal enemies, he is summoned to the palace to tell Qin the story of his surprising victory.</plot>
<tagline>Kono kuni wa mada, hont no hero wo shiranai [Japan] (This land doesn't know a real hero. Yet.) </tagline>
<runtime>99 min | Turkey:89 min (TV version) | China:107 min (extended version) | China:93 min </runtime>
<thumb />
<fanart url="http://www.themoviedb.org/">
<thumb preview="image/backdrops/4289/tt0299977_thumb.jpg">image/backdrops/4289/tt0299977.jpg</thumb>
<thumb preview="image/backdrops/6113/tt0299977_thumb.jpg">image/backdrops/6113/tt0299977.jpg</thumb>
</fanart>
<mpaa> Rated PG-13 for stylized martial arts violence and a scene of sensuality.</mpaa>
<playcount />
<File />
<Path />
<filenameandpath />
<id>tt0299977</id>
<genre>Action / Adventure / History</genre>
<credits />
<director>Yimou Zhang</director>
<premiered />
<status />
<studio>Beijing New Picture Film Co.</studio>
<album />
<trailer />
<watched>no</watched>
<actor>
<name>Jet Li</name>
<role>Nameless</role>
<thumb>http://ia.media-imdb.com/images/M/MV5BMTI4MjcxMzYwM15BMl5BanBnXkFtZTcwOTAyOTYyMQ@@._ V1._SY30_SX23_.jpg</thumb>
</actor>
<actor>
<name>Tony Leung Chiu Wai</name>
<role>Broken Sword</role>
<thumb>http://ia.media-imdb.com/images/M/MV5BMjA2Nzk5OTA0N15BMl5BanBnXkFtZTcwMTgzMDcyMQ@@._ V1._SY30_SX23_.jpg</thumb>
</actor>
<actor>
<name>Maggie Cheung</name>
<role>Flying Snow</role>
<thumb>http://ia.media-imdb.com/images/M/MV5BNzQ0MDU0MTg1MF5BMl5BanBnXkFtZTcwMTM0NDEyMQ@@._ V1._SY30_SX23_.jpg</thumb>
</actor>
<actor>
<name>Ziyi Zhang</name>
<role>Moon</role>
<thumb>http://ia.media-imdb.com/images/M/MV5BMTc3NDM1MDA4OF5BMl5BanBnXkFtZTcwMzE0NzEzMQ@@._ V1._SY30_SX23_.jpg</thumb>
</actor>
<actor>
<name>Daoming Chen</name>
<role>King of Qin</role>
<thumb>http://i.media-imdb.com/images/tn15/addtiny.gif</thumb>
</actor>
<actor>
<name>Donnie Yen</name>
<role>Sky</role>
<thumb>http://ia.media-imdb.com/images/M/MV5BMjA5NDQxNDE1OV5BMl5BanBnXkFtZTcwNDczNTAyMQ@@._ V1._SY30_SX23_.jpg</thumb>
</actor>
<actor>
<name>Liu Zhong Yuan</name>
<role>Scholar</role>
<thumb>http://i.media-imdb.com/images/tn15/addtiny.gif</thumb>
</actor>
<actor>
<name>Zheng Tia Yong</name>
<role>Old Servant</role>
<thumb>http://i.media-imdb.com/images/tn15/addtiny.gif</thumb>
</actor>
<actor>
<name>Yan Qin</name>
<role>Prime Minister</role>
<thumb>http://i.media-imdb.com/images/tn15/addtiny.gif</thumb>
</actor>
<actor>
<name>Chang Xiao Yang</name>
<role>General</role>
<thumb>http://i.media-imdb.com/images/tn15/addtiny.gif</thumb>
</actor>
<actor>
<name>Yakun Zhang</name>
<role>Commander</role>
<thumb>http://i.media-imdb.com/images/tn15/addtiny.gif</thumb>
</actor>
<actor>
<name>Ma Wen Hua</name>
<role>Head Eunuch</role>
<thumb>http://i.media-imdb.com/images/tn15/addtiny.gif</thumb>
</actor>
<actor>
<name>Jin Ming</name>
<role>Eunuch</role>
<thumb>http://i.media-imdb.com/images/tn15/addtiny.gif</thumb>
</actor>
<actor>
<name>Xu Kuang Hua</name>
<role>Pianist</role>
<thumb>http://i.media-imdb.com/images/tn15/addtiny.gif</thumb>
</actor>
<actor>
<name>Wang Shou Xin</name>
<role>Musician</role>
<thumb>http://i.media-imdb.com/images/tn15/addtiny.gif</thumb>
</actor>
</movie>

i can't see anything in credits oO?

Montellese
2009-03-31, 15:46
Well I don't know if fekker already released a version of MIP with the flags in the <credits> tag.

mindweaver
2009-04-02, 11:17
Is it really such a good idea to rely on info added to the nfos? Everytime I export library to separate files, these gets overwritten.

Too bad I can't use either MIP och Media Companion since they aren't nearly as good scrapers as xbmc itself. MIP is the one that gets closest but not all the way. It can read on a folder name basis but when the renaming starts it all goes wrong. It renames the files based on the folder name.. not based on the filename and the current nfo/fanart/tbh that xbmc has created.

mYre
2009-04-02, 11:27
Is it really such a good idea to rely on info added to the nfos? Everytime I export library to separate files, these gets overwritten.

Too bad I can't use either MIP och Media Companion since they aren't nearly as good scrapers as xbmc itself. MIP is the one that gets closest but not all the way. It can read on a folder name bases but when the renaming starts it all goes wrong. It renames the files based on the folder name.. not based on the filename and the current nfo/fanart/tbh that xbmc has created.

At weekend, there will be a new release for non english movies, for all outstanding people in here (german, french and so on)

Just be patient we try our best.

mindweaver
2009-04-02, 14:53
Which programming language are you using? Is it possible to have a look at the source code?

mYre
2009-04-02, 14:56
Which programmling language are you using? Is it possible to have a look at the source code?

By now it's not possible to have a look at the code :)

it's mostly developed in c#

mindweaver
2009-04-02, 15:13
By now it's not possible to have a look at the code :)

it's mostly developed in c#

Ok. Just let me know if you need assistance, I know c#.

Would be nice to extend it's functionality now that Aeon Stark doesn't read filenames no more (as of update v0.91) to have it read the .nfo (if it has mediainfo in it or else add it).

Do you have any guide for using the MediaInfo.dll or have you figured it all out on your own? I would like to try and build something for myself :)

mYre
2009-04-02, 15:17
Ok. Just let me know if you need assistance, I know c#.

Would be nice to extend it's functionality now that Aeon Stark doesn't read filenames no more (as of update v0.91) to have it read the .nfo (if it has mediainfo in it or else add it).

Do you have any guide for using the MediaInfo.dll or have you figured it all out on your own? I would like to try and build something for myself :)

Scrapers are included, the tags are added in the studio section by now.

Help we dont need by now.

MediaInfo is not my Project, we figured it out ourselves, for questions belonging to Media Info please contact Fekker.

mindweaver
2009-04-02, 15:23
Ok thanks for your answers :)


One thing annoys me. It keeps finding "Thumb" as a movie. I don't know why? Maybe it is finding the hidden Thumb.db file that exists in all folders in windows. Maybe you should ignore it :)

Montellese
2009-04-02, 15:28
Using MediaInfo is quite simple and straight forward. I used it in a C++ project I wrote about 1-2 years ago.

If you want I could provide you with the files I wrote back then. They sure aren't up-to-date with the newest version but it should be enough to give you an idea on how to use it.

EDIT: Or just go to the MediaInfo website, download the DLL package for your OS and check the "Developers" folder. There's a Doxygen documentation along with example source code for C++, C#, Java, Python and VB. That's what I used to get started with it.

mindweaver
2009-04-02, 15:40
Using MediaInfo is quite simple and straight forward. I used it in a C++ project I wrote about 1-2 years ago.

If you want I could provide you with the files I wrote back then. They sure aren't up-to-date with the newest version but it should be enough to give you an idea on how to use it.

EDIT: Or just go to the MediaInfo website, download the DLL package for your OS and check the "Developers" folder. There's a Doxygen documentation along with example source code for C++, C#, Java, Python and VB. That's what I used to get started with it.

Yeah I figured it out on my own. But thank you for your post! I had to get the dll and examples elsewhere though, all sourceforge links are broken for windows source/dll.

Started my project now :)

mYre
2009-04-02, 15:50
Yeah I figured it out on my own. But thank you for your post! I had to get the dll and examples elsewhere though, all sourceforge links are broken for windows source/dll.

Started my project now :)

thats just what we need :D :D 1000s of movie apps that all do the same^^

Montellese
2009-04-02, 16:18
Well everyone can write his own app if he wants. He doesn't have to distribute it to anyone :;):

Most of the people started coding something that already exists to learn no programming languages or to get into some stuff he didn't know before.

I for my part most often prefer to write my own programs as well because it will do exactly what I want, look exactly the way I want and if something doesn't work I know the guy responsible for it very well ;-)
I also considered writing my own software to do all that tagging and stuff (until I found XBMC I used a self written Media Center and Media Database software) as both Media Companion and MIP don't always do what I want them to do but it's just too much work to get it done quickly :;):

mYre
2009-04-02, 16:27
Well everyone can write his own app if he wants. He doesn't have to distribute it to anyone :;):

Most of the people started coding something that already exists to learn no programming languages or to get into some stuff he didn't know before.

I for my part most often prefer to write my own programs as well because it will do exactly what I want, look exactly the way I want and if something doesn't work I know the guy responsible for it very well ;-)
I also considered writing my own software to do all that tagging and stuff (until I found XBMC I used a self written Media Center and Media Database software) as both Media Companion and MIP don't always do what I want them to do but it's just too much work to get it done quickly :;):

I didn't want to insult or offend you with my above post. For sure you can, I'm not telling everyone to not develope their own programs of course not :)

But in some time when you are finished or able to prerelease let me know and maybe if you want I can help out in some ways :)

@All: always remember, we are a community :P together we are strong muahahaha :D^^

mindweaver
2009-04-02, 16:31
thats just what we need :D :D 1000s of movie apps that all do the same^^

Your program does not do what I want it to do. So no, it will not be the same :)

And as Montellese said.. I'm not going to distribute if there's no need for it.

Keep up your good work.

Montellese
2009-04-02, 16:34
I didn't feel insulted or something. I'm not even the one you quoted :;):

I would be glad to help in any way but I' more of a (low level) C/C++ developer. I have no idea about C#, .NET or anything about skinning which is why I need to use the Qt Framework to be able to write my desktop applications.

mYre
2009-04-02, 16:38
I didn't feel insulted or something. I'm not even the one you quoted :;):

I would be glad to help in any way but I' more of a (low level) C/C++ developer. I have no idea about C#, .NET or anything about skinning which is why I need to use the Qt Framework to be able to write my desktop applications.

Ok I understand, the major part on this whole thing is that my job is developing^^ So by now I don't think we need any help, but thanks for that I will come back to it if we need some.

We use Visual Studio 2008 and of course this is not easy, .NET gives me sometimes damn goosebumps^^

The shit is that mafis is able to develope nearly all time, i'm just able to do this on spare time, starting at 10p.m.^^

djh_
2009-04-02, 16:51
http://xbmc.org/forum/showthread.php?t=48097