How to add intros via asx file and my random intro generator

Media Browser Tutorial ONLY (strictly enforced)

How to add intros via asx file and my random intro generator

Postby scales » Wed Jun 03, 2009 6:53 am

I thought I would share what I have come up with on my system and I think its pretty cool.

I have added my 20th century fox custom intro and random dts and dolby digtial trailers to my movies via asx file. Hopefully some of you will find this of interest to you.

*****I do not know how the asx play list will work with ts folders or other formats It should work with all single file movies.****

I am assuming you have made a custom 20th century fox style intro already. if not i will explain later how to change the asx file.

Step 1: create a folder in c: drive on your computer running Media Center called "INTROS" eg: c:/INTROS

Step 2: download the following zip file to somewhere you can remember.
http://portfolio.itas.ca/~jamie.scales/mediabrowser/playlistrandom.zip
intro.asx -- this is a windows play list file
mkintros.exe -- this is a small php script that changes intro file names randomly.
(I compiled it with bam compiler in case you were wondering about the .exe extension. Here is the code in it. You do need anything special to run this script)

<?php

$random = rand(0,4);
echo $random;
rename('c:/INTROS/introgood.mkv', 'c:/INTROS/intro5.mkv');
rename('c:/INTROS/intro'.$random.'.mkv', 'c:/INTROS/introgood.mkv');
rename('c:/INTROS/intro5.mkv', 'c:/INTROS/intro'.$random.'.mkv');
exit();
?>

step 3: download 5 of your favorite trailers / intros from http://www.demo-world.eu/trailers/

step 4: convert each of your 5 intros to an mkv file using your program of choice or using handbrake http://handbrake.fr/ (the code I use is set up this way as i use mkv's)

step 5: name the 5 converted files as ...

introgood.mkv
intro0.mkv
intro1.mkv
intro2.mkv
intro3.mkv
intro4.mkv

Now put these into c:/INTROS

step 6: put mkintros.exe into your windows Startup folder or run it on a schedule to change more often

step 7: if you have a custom 20th century style intro, convert it to an mkv and rename it "myintro.mkv" and place it in c:/INTROS
IF YOU DO NOT HAVE A CUSTOM INTRO open the intro.asx file in notepad and remove the THIRD LINE from the top.

step 8: In order for the play list to work you must add "02" to the end of each movie file but before the extension. And then put the intro.asx file into every movie folder and rename it the same name as the movie but with a "01" at the end.

eg: x:/mymoviefolder/rambo first blood
rambo01.asx
rambo02.mkv

(perhaps someone could make a batch that can do step 8 as it may take a while if you have a large collection)

If you want to change your intros just add new ones in the INTROS folder and change their name.

Now everytime you play a movie in media browser it will show your custom intro then your THX or Dolby Digital OMG I broke my windows sound test followed by your feature presentation.

I hope you find this of some use.
scales
 
Posts: 13
Joined: Wed Apr 01, 2009 12:04 am

Re: How to add intros via asx file and my random intro generator

Postby daavid1 » Wed Jun 03, 2009 1:49 pm

Really nice work - Having step 8 more automated would be great though as it could be very tedious.
daavid1
 
Posts: 166
Joined: Sun Jan 11, 2009 1:04 pm

Re: How to add intros via asx file and my random intro generator

Postby daavid1 » Fri Jun 05, 2009 1:11 pm

Hi Scales, It might be worth putting this in the tutorial section since it is something a lot of people are after in the feature requests forum.
daavid1
 
Posts: 166
Joined: Sun Jan 11, 2009 1:04 pm

Re: How to add intros via asx file and my random intro generator

Postby Jon » Fri Jun 05, 2009 1:15 pm

Moved to tutorials section.
Jon
 
Posts: 410
Joined: Thu Aug 28, 2008 6:26 pm
Location: Lawrenceville, GA

Re: How to add intros via asx file and my random intro generator

Postby casperinmd » Mon Jun 08, 2009 10:55 pm

scales wrote:step 8: In order for the play list to work you must add "02" to the end of each movie file but before the extension. And then put the intro.asx file into every movie folder and rename it the same name as the movie but with a "01" at the end.

eg: x:/mymoviefolder/rambo first blood
rambo01.asx
rambo02.mkv

(perhaps someone could make a batch that can do step 8 as it may take a while if you have a large collection)


Is this something that we can make work? It is a script I wrote for creating asx files in each movie folders directory based on finding a VIDEO_TS.ifo file in that directory, so I can easily modify it to find Movie.ext and then rename Movie.ext to Movie02.ext, and my script will already create an .asx file with the needed info, and I can tweak that to make it look like what you want. If you want to change it up, go for it or I can assist if you dont' know how (I assume you do since you script with PHP already) :D

********* USED FOR DVD FOLDER FORMAT'S ONLY *********
Code: Select all
:: Script will create an asx playlist by parsing through a directory and its subdirectories to find a VIDEO_TS.IFO file,
:: then back out one directory and create an asx file with the intro being called from K:\Movies\@Intro\intro.mpg
:: which can be changed to whatever file you wish so you can change it up as you like followed by the Main Movie
:: in the VOB folder.

:: *** Change the 3 SET statements below to fit your environment ***


@echo off
SET MOVIEDRIVE=D:
SET MOVIEPATH=D:\Movies
SET INTRO=K:\Movies\@Intro\intro.mpg

:: CHANGE TO THE DRIVE AND BASE PATH WHERE THE MOVIE DIRECTORIES ARE STORED
%MOVIEDRIVE%
CD %MOVIEPATH%


:: GET LIST OF ALL FOLDERS CONTAINING A VIDEO_TS.IFO FILE AND LOOP THROUGH EACH
FOR /f "tokens=3-4 delims=\" %%a in ('dir VIDEO_TS.IFO /s') DO (
echo +++++++++++
echo Processing:
echo Genre=%%a
echo Movie Name=%%b
echo.

:: CHECK TO SEE IF DIRECTORY HAS ALREADY BEEN PROCESSED, IF SO SKIP IT AND MOVE ON
IF EXIST "%MOVIEPATH%\%%a\%%b\@intro.asx". (
ECHO File @intro.asx already exists.
   )ELSE (
   echo ^<asx version="3"^> > "%MOVIEPATH%\%%a\%%b\@intro.asx"
   echo ^<title^>%%b^</title^> >> "%MOVIEPATH%\%%a\%%b\@intro.asx"
   echo ^<entry^>^<ref href="%INTRO%" /^>^<title^>Intro^</title^>^</entry^> >> "%MOVIEPATH%\%%a\%%b\@intro.asx"
   echo ^<entry^>^<ref href="%MOVIEPATH%\%%a\%%b\VIDEO_TS\VIDEO_TS.IFO" /^>^<title^>Main Movie^</title^>^</entry^> >> "%MOVIEPATH%\%%a\%%b\@intro.asx"
   echo ^</asx^> >> "%MOVIEPATH%\%%a\%%b\@intro.asx"
   )

:: pause
echo.
)


The result of the asx file looks like this:
Code: Select all
<asx version="3">
<title>Cool Movie</title>
<entry><ref href="K:\Movies\@Intro\intro.mpg" /><title>Intro</title></entry>
<entry><ref href="D:\Movies\Action\Cool Movie\VIDEO_TS\VIDEO_TS.IFO" /><title>Main Movie</title></entry>
</asx>
Last edited by casperinmd on Wed Jun 17, 2009 1:46 am, edited 2 times in total.
casperinmd
 
Posts: 122
Joined: Mon Mar 23, 2009 2:07 pm

Re: How to add intros via asx file and my random intro generator

Postby scales » Fri Jun 12, 2009 6:06 am

I am glad you posted your script. I just about to manually add the asx files to my ever growing collection. I will have a go att eh script and see what I come up with. Thanks
scales
 
Posts: 13
Joined: Wed Apr 01, 2009 12:04 am

Re: How to add intros via asx file and my random intro generator

Postby daavid1 » Sat Jun 13, 2009 1:04 pm

Any luck with this?
daavid1
 
Posts: 166
Joined: Sun Jan 11, 2009 1:04 pm

Re: How to add intros via asx file and my random intro generator

Postby casperinmd » Sun Jun 14, 2009 6:05 pm

What are you looking for daavid1?
casperinmd
 
Posts: 122
Joined: Mon Mar 23, 2009 2:07 pm

Re: How to add intros via asx file and my random intro generator

Postby tlmaclennan » Mon Jun 15, 2009 6:46 pm

I got this to work...it was quite easy. It would be great to see a batch that could be placed in my Movie directory that will change the Movie.mkv to Movie02.mkv and make a Movie01.asx playlist. I tried messing with the script casperinmind posted but had not such luck...I'm not too experienced with it.

Also, I just bought the DTS Blu-Ray Demo Disc 2008 so that I can rip the full quality trailers for my intros. Not sure how big they will be but if anyone wants them just let me know. Should have it this week!
tlmaclennan
 
Posts: 13
Joined: Thu Jun 11, 2009 9:37 pm

Re: How to add intros via asx file and my random intro generator

Postby casperinmd » Mon Jun 15, 2009 7:07 pm

tlmaclennan wrote:I got this to work...it was quite easy. It would be great to see a batch that could be placed in my Movie directory that will change the Movie.mkv to Movie02.mkv and make a Movie01.asx playlist. I tried messing with the script casperinmind posted but had not such luck...I'm not too experienced with it.

Also, I just bought the DTS Blu-Ray Demo Disc 2008 so that I can rip the full quality trailers for my intros. Not sure how big they will be but if anyone wants them just let me know. Should have it this week!


Of course. Let me clean up the script above to rename what you need, since that is waht this post was about, then create the asx file. Won't promise tonight...but will surely do my best!

So to fully understand, you want to run the batch, if it finds a x:\some movie name\someMovieName.mkv, then rename that to x:\some movie name\someMovieName02.mkv then output an asx file called x:\some movie name\someMovieName01.asx playing 2 movies, the x:\myIntros\intro.mkv (always) and then x:\some movie name\someMovieName02.mkv (based on the movie of course). Then on each future run, if it doesn't see a someMovieName.mkv, just skip the directory.

Right?
casperinmd
 
Posts: 122
Joined: Mon Mar 23, 2009 2:07 pm

Next

Return to Tutorials



Who is online

Users browsing this forum: No registered users and 0 guests