Welcome Guest.   Make a donation to an author on the site December 22, 2014, 06:06:12 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Your Support Funds this Site: View the Supporter Yearbook.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1] 2 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: batch create image contact sheet from videofiles?  (Read 24666 times)
Nod5
Supporting Member
**
Posts: 749



View Profile Give some DonationCredits to this forum member
« on: February 24, 2007, 06:46:13 AM »

I have a large amount of TV recordings made with a DVB tv-card. The files are .mpg and in most cases 2+ GB in size. The collection is large enough for me to need a good catalog system. I have a text index but recently got the idea of also making a contact sheet image for each video. By contact sheet I mean one image which contains a mosaic of many small thumbnail images from different parts of the video file. That provides a quick visual overview of the video.

I've recently made a few such contact sheets through a many-steps-process: I manually make screenshots in the application I use to also trim the video (commercial breaks and so on) before archiving it. After that, I use ACDSee to create a contact sheet out of the images.

Now I'm searching for a way to automate contact sheet creation from videos into a simple batch process.

So I want an application with these features:

1. read a video file and make screencaps
 - formats to handle: .mpg and ideally other formats like xvid .avi, .wmv ...
 - interval screencaps: I want a coherent contact sheet format and so want a sure way to get at least X number of screencaps (let's say 30) from any video regardless of it's length. So a "screencap every N seconds" setting might need to be complemented by a "screencap at every 1/N time segment of video".
 - timestamped screencaps: add a (customizable) timestamp to each screencap
(I understand that many automatic screenshots will be less useful than those taken manually but if I make many screencaps some of them will probably still give a good overview of the video.)

2. make contact sheet from screencaps
 - add a user customizable title/header for the contact sheet. Allow variables in header. Example: "$filename -- $year-$month-$day"
 - customizability for the amount of thumbnails, number os rows/lines, size of thumbnails, borders, background ...

3. saving
 - automatically save the generated contact sheet to some preset folder. Allow variables in filename just like for header/title above.
 
4. batch capabilities
 - run 1-3 over a set files/folders.
 - Or at the very least, allow complete command line control so that users can make external scripts to get such batch capabilities.
4 is important for me since I don't have the time to manually or even semi-manually make contact sheets for all older videos.

Can anyone recommend a tool that does all that? Or something that comes close? All suggestions are welcome!

I googled some before writing this post, but didn't find much. One problem is that I'm unsure what the definite keyword for such software is. I write "contact sheet" only because ACDSee call it that. So suggestions for what terms to search for might be useful for me too.
Logged
mrvampi
Charter Member
***
Posts: 3


View Profile Give some DonationCredits to this forum member
« Reply #1 on: February 25, 2007, 01:13:27 PM »

Not sure about batch capabilities.

Best program I found for the job was Image Grabber II.NET
Not been able to get onto the official website for a while, google gives a few pages with download links like this

There are some older versions of the program but they are not as good.

Options






Main Screen (thumbnail)


Final Output Sample (thumbnail)



There is also ImageGrab but I never had much success with that.

Hope that helps.
Logged
nudone
Cody's Creator
Columnist
***
Posts: 4,116



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: February 25, 2007, 01:56:26 PM »

that's kind of a cool program - Image Grabber II.
Logged
Nod5
Supporting Member
**
Posts: 749



View Profile Give some DonationCredits to this forum member
« Reply #3 on: February 26, 2007, 07:56:53 AM »

mrvampi,
thanks a lot! Image Grabber II.NET seem to have many (most) of the features I was looking for. I'll try it out. Also, since I now have a name of one application in the "genre" I'll do some more searches and see if any similar applications turn up. Will report back here if I do.

apparently there's three programs (or three versions of one program?) by the same author: Image Grabber I, II and II.NET. The first two can still be downloaded through archive.org, http://web.archive.org/we...5.brinkster.com/antworkz/ .

edit:
I still haven't had time to actually test ImageGrab II.NET yet but here's a follow up anyway...

First, I think I initially had trouble finding what I was looking for because I actually want two distinct things:
1. an image grabber (a.k.a. frameshot/screenshot maker) to output individual frameshot images from a video file
2. a contact sheet creator that operates on the previously generated frameshots

ImageGrab II.NET seems to do both which it great. But as mrvampi mentioned it doesn't seem to handle batch mode.

With the help of some better search phrases I found some alternatives that I'll also try.

IMAGE GRABBERS:
------------------
FrameShots (30$, free trial)
http://www.frame-shots.com/download.htm

Has command-line support so batch execution is possible. Options include: interval (both "frameshot every N seconds" and "X number of frameshots" are possible), timestamps, customizable filenaming, output file size and so on. In short, all image grabbing features I wanted. However, it does not seem to create a "contact sheet". It just creates multiple individual frame shot images. Contact sheet making isn't on the "future features" list either, http://www.frame-shots.com/future.htm

CONTACT SHEET CREATORS:
----------------------
this thread in alt.comp.freeware
http://groups.google.se/g...;rnum=14#769b541bb47e593b
included a link to a standalone .exe application that generates contact sheets, Image Joiner
http://www.puretna.com/imagejoiner.php (warning: the application page is hosted by an adult video file sharing site of some sort. I haven't tried it yet and so have no idea if it's malware-free)
It seems to have various useful settings but no command line support or batch mode.

the free image editor GIMP
http://gimp.org/downloads/
Accepts command line usage so batch execution is possible. And there's a contact sheet plugin available, http://registry.gimp.org/plugin?id=7544 .

the free image processing tool GraphicsMagick
http://www.graphicsmagick.org/
Accepts command line usage so batch execution is possible. And can "Create a montage of image thumbnails", http://www.graphicsmagick.org/www/montage.html

At first glance, GraphicsMagick seems most promising for easy automation.

So after trying ImageGrab II.NET I'll check if the combo FrameShots/GraphicsMagick can give an automated workflow.
« Last Edit: February 26, 2007, 01:48:37 PM by Nod5 » Logged
Nighted
Charter Honorary Member
***
Posts: 572


Meat Popsicle

View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: February 26, 2007, 02:40:43 PM »

Nod5, you can also do this with Media Player Classic. However, it doesn't give you the precise control over which frames are grabbed, but it's very easy and fast. I hear VideoCharge Pro does contact sheets too but I haven't had time to try it out.

Media Player Classic:


* Lost.jpg (254.36 KB, 1024x993 - viewed 816 times.)
« Last Edit: February 26, 2007, 03:06:19 PM by Nighted » Logged

I`m a firm believer in the philosophy of a ruling class, especially since I rule.
Nod5
Supporting Member
**
Posts: 749



View Profile Give some DonationCredits to this forum member
« Reply #5 on: February 27, 2007, 05:16:50 AM »

Nighted,
Thanks a lot! Media Player Classic suits my needs.

Media Player Classic
http://sourceforge.net/projects/guliverkli/
has the image grabbing features I requested (handles many video formats, interval screencaps of the sort "X number of frameshots", timestamps, specification of output file width) and it generates a contact sheet.

Its command line parameters doesn't include commmands for contact sheet creation. But I wrote an AutoHotkey script that allows batch usage.

edit: old code hidden
I did a testrun on a couple of video files without problems. Will try to run it on all my videos later tonight.

edit:
I just ran the script on 30+ video files and all seems to work fine. I also updated the script a bit. I edited this post so that the old script is hidden (above). Here's the new script:

[copy or print]
; AutoHotkey script to generate image contact sheets from a batch of video files in Media Player Classic

xinstructions =
(
--- INSTRUCTIONS ----
1. Get Media Player Classic, http://sourceforge.net/projects/guliverkli/
   mpplayerc.exe path: C:\program\MPC (or) Scriptfolder (or) specify in script parameters
2. Make flist.txt with list of video file paths (one path per line)
   flist.txt path: Scriptfolder (or) specify in script parameters
3. Set other script parameters (or use defaults)
4. Run script
)

; --- SCRIPT PARAMETERS --------------------------------
IfExist, C:\program\MPC\mplayerc.exe
 xmpcpath = C:\program\MPC\mplayerc.exe
IfExist, %A_ScriptDir%\mplayerc.exe
 xmpcpath = %A_ScriptDir%\mplayerc.exe

; ------------------------ path to media player classic
; xmpcpath =
; ------------------------

If xmpcpath =
{
msgbox, error: mpplayerc.exe not found.
exitapp
}
IfExist, %A_ScriptDir%\flist.txt
 xflistpath = %A_ScriptDir%\flist.txt

; ------------------------ path to flist.txt
; xflistpath =
; ------------------------

If xflistpath =
{
FileSelectFile, xflistpath,3,,Select textfile that contains list of video file paths
if xflistpath =
exitapp
}
; ------------------------ other script parameters
xoutputfolder = %A_Desktop%
xoutput_to_same_folder_as_source = 1
xcreate_even_if_contactsheet_exists = 0
xoutputfileprefix =
xoutputfilesuffix =_cs
xrows = 7
xcols = 3
xwidth = 1000
; ------------------------
;examples:
;xoutputfolder = C:\some folder\
;xoutput_to_same_folder_as_source = 1   --> yes --> no need to set xoutputfolder
;xoutput_to_same_folder_as_source = 0   --> no
;xcreate_even_if_contactsheet_exists = 0 --> don't create if already exists (= file with matching file name exists)
;xcreate_even_if_contactsheet_exists = 1 --> create new (overwrites outputfolder)
;xoutputfileprefix = some_prefix_
;outputfilesuffix = some suffix
;xrows = 7
;xcols = 3
;xwidth = 1000
;----------------------------


; --- ACTUAL SCRIPT START ----
msgbox, 1,,
(
%xinstructions%

current parameters:
xmpcpath = %xmpcpath%
xflistpath = %xflistpath%
xoutputfolder = %xoutputfolder%
xoutput_to_same_folder_as_source = %xoutput_to_same_folder_as_source%
xcreate_even_if_contactsheet_exists = %xcreate_even_if_contactsheet_exists%
xoutputfileprefix = %xoutputfileprefix%
xoutputfilesuffix = %xoutputfilesuffix%

Click OK to run script
)
IfMsgBox, Cancel
exitapp

FileRead, xflist_contents, %xflistpath%

;--------------------------------------------
Loop, parse, xflist_contents,`n
{
If A_LoopField =
 continue   ;skip empty line at end

xfpath = %A_LoopField%
SplitPath, xfpath, xfname ,xffolder,,xfnameNoExt

If xoutput_to_same_folder_as_source = 1
 xoutputfolder = %xffolder%

If xcreate_even_if_contactsheet_exists = 0
{
IfExist, %xoutputfolder%\%xoutputfileprefix%%xfnameNoExt%%xoutputfilesuffix%.jpg
continue
IfExist, %xoutputfolder%\%xoutputfileprefix%%xfnameNoExt%%xoutputfilesuffix%.bmp
continue
}

run %xmpcpath% /open "%xfpath%"
WinWait,ahk_class MediaPlayerClassicW
#WinActivateForce
WinActivate, ahk_class MediaPlayerClassicW
WinWaitActive, ahk_class MediaPlayerClassicW
Sleep, 1000

;0x111=command   wparam 888 lparam 0 = open save thumbs...
SendMessage, 0x111, 808, 0, , ahk_class MediaPlayerClassicW

WinWait, ahk_class #32770,Image width:,4
IfWinNotExist, ahk_class #32770,Image width:
{
SendMessage, 0x111, 808, 0, , ahk_class MediaPlayerClassicW   ;2nd try
WinWait, ahk_class #32770,Image width:
}

ControlSetText, Edit1,%xoutputfolder%\%xoutputfileprefix%%xfnameNoExt%%xoutputfilesuffix%, ahk_class #32770,Image width:
ControlSetText, Edit2, %xrows%, ahk_class #32770,Image width:
ControlSetText, Edit3, %xcols%, ahk_class #32770,Image width:
ControlSetText, Edit4, %xwidth%, ahk_class #32770,Image width:
ControlClick, Button2, ahk_class #32770,Image width:

Loop
{
IfExist, %xoutputfolder%\%xoutputfileprefix%%xfnameNoExt%%xoutputfilesuffix%.jpg
break
IfExist, %xoutputfolder%\%xoutputfileprefix%%xfnameNoExt%%xoutputfilesuffix%.bmp
break
sleep 1000
}

WinClose, ahk_class MediaPlayerClassicW
WinWaitClose, ahk_class MediaPlayerClassicW
}
;--------------------------------------------
« Last Edit: February 27, 2007, 01:31:16 PM by Nod5 » Logged
Nighted
Charter Honorary Member
***
Posts: 572


Meat Popsicle

View Profile WWW Give some DonationCredits to this forum member
« Reply #6 on: February 27, 2007, 04:26:20 PM »

Yeah, MPC really kicks ass, no other words can emphasize it more. It's amazing how much they packed into that player.  Hopefully you'll use it to watch videos too because it really is it's best feature! Wink
Logged

I`m a firm believer in the philosophy of a ruling class, especially since I rule.
Nod5
Supporting Member
**
Posts: 749



View Profile Give some DonationCredits to this forum member
« Reply #7 on: February 28, 2007, 12:20:24 PM »

Nah, I don't have time to watch the videos. I'm busy archiving them properly  Grin
More seriously, I've used VLC for a long time and I think I'll stick to that. But Media Player Classic has many of the same qualities it seems (no fancy, bloated GUI, works with almost all files and so on). Thanks again for bringing it up. Thmbsup
Logged
Nod5
Supporting Member
**
Posts: 749



View Profile Give some DonationCredits to this forum member
« Reply #8 on: March 31, 2008, 12:55:11 PM »

After updating this script a lot and making a GUI I now present:
VideoContactSheet
 
Read more and download here http://nod5.dcmembers.com/videocontactsheet.html

Can someone with Vista tell me if VideoContactSheet works as it should there?
« Last Edit: March 31, 2008, 01:01:15 PM by Nod5 » Logged
nixx_nl
Participant
*
Posts: 3

View Profile Give some DonationCredits to this forum member
« Reply #9 on: April 09, 2008, 06:50:27 AM »

Yo Nod5 amazing scripting, I needed it badly.
am using it now to catalog my inspiration footage smiley

Can you make it to accept any extention?

Have to rename my quicktimes to wmv for it to work (mpc can play QT)
Logged
Nod5
Supporting Member
**
Posts: 749



View Profile Give some DonationCredits to this forum member
« Reply #10 on: April 10, 2008, 01:21:33 PM »

nixx_nl,
I'm glad that you like the program!  smiley

Yes, VideoContactSheet by default only processes mpg,mpeg,avi,wmv,mkv files. I will keep some such default restriction since without it VideoContactSheet could send MPC a file that MPC can't handle. The entire batch would then be interrupted and that could be a problem for some users.

But I will consider expanding the list of default accepted files after doing some more testing.

I have now also added an extra .ini setting lets you override default to process all other file types. So if you want that then just do this: Download v080410 , goto settings, click save, open the created .ini file, set "xallextensions = 1", save the .ini file, restart VideoContactSheet. All dropped files regardless of file type should then be passed to MPC for CS making. Check that the files work in MPC first.

When I have time I will also clean up and publish the .ahk source so that others can customize the program to suit their needs.
« Last Edit: April 11, 2008, 06:34:18 AM by Nod5 » Logged
kartal
Supporting Member
**
Posts: 1,529


View Profile Give some DonationCredits to this forum member
« Reply #11 on: April 10, 2008, 01:26:13 PM »

Probably you can use this one

http://www.saleensoftware.com/VideoManager.aspx
Logged
nixx_nl
Participant
*
Posts: 3

View Profile Give some DonationCredits to this forum member
« Reply #12 on: April 17, 2008, 08:36:44 AM »

Great cheesy

Am using it now, it's perfect smiley

Thanks allot for your alteration!

It makes my lives allot easier smiley


and @ kartal > it's limited to only a few video file types..
otherwise it would be cool
Logged
4wd
Supporting Member
**
Posts: 3,532



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #13 on: April 18, 2008, 12:48:30 AM »


You might like to check out this version of MPC: MPC Home Cinema

V1.1.0.0 adds the following:
Quote
New features :
    * Custom presenter now support DXVA2, and display hardware acceleration mode in Jitter test information.
    * Internal video decoder based on ffmpeg for Flash video (FLV4, VP5, VP6), AMV, Mpeg4, SVQ3(1), Theora, VC-1, XVID, and DivX
    * Internal video decoder H.264 with DXVA 1 acceleration (using VMR9 or overlay on XP) and DXVA2 (using EVR on Vista).

It also has a few more options and bugfixes over the normal MPC.

@nod5: Just as a matter of interest, why do you use mouse/keypresses to interact with MPC in your program?
MPC has rather extensive HTML control, wouldn't it be more efficient and user-friendly, (the user would be able to do other things while it's working), to use that?

EDIT: Changed MPC HC link to Sourceforge page.
« Last Edit: April 19, 2008, 05:49:11 AM by 4wd » Logged

I do not need to control my anger ... people just need to stop pissing me off!
jgpaiva
Global Moderator
*****
Posts: 4,717



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: April 18, 2008, 03:28:41 PM »

4wd: Thanks a lot for that link!!
That version supports vista and x64, cool! cheesy
Logged

Nod5
Supporting Member
**
Posts: 749



View Profile Give some DonationCredits to this forum member
« Reply #15 on: April 18, 2008, 06:54:19 PM »

4wd: When I made the first version of the script I searched for alternative ways to control MPC but did not find any. After that I just stuck to the keyboard input method since it worked. But if there's a better way then I'll give it a try.  tellme I'm not sure what you mean by "HTML control" though. I can't find anything that seem to describe that: http://www.google.com/sea...=en&start=10&sa=N . Can you point me to some relevant page?
Logged
4wd
Supporting Member
**
Posts: 3,532



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #16 on: April 18, 2008, 08:37:48 PM »

Perhaps I should have said Web Interface smiley MPC Web Interface

This is all referring to MPC Home Cinema but I don't believe it's web interface is any different to MPC.

Open up MPC, go to View->Options->Player/Web Interface.

Enable: Listen on port: 13579   (Default I think)
           Enable compression
           Allow access from localhost only

The rest should be pretty much default.

Then click the link that says "Launch in web browser..."

Once the page opens in the browser, click the link "The media player interface made by chobits".

That will show you exactly what you can control via the web interface - pretty much everything.

« Last Edit: April 18, 2008, 08:42:52 PM by 4wd » Logged

I do not need to control my anger ... people just need to stop pissing me off!
Nod5
Supporting Member
**
Posts: 749



View Profile Give some DonationCredits to this forum member
« Reply #17 on: April 19, 2008, 04:08:07 AM »

Cool! I had no idea MPC had that. But while a lot of controls are available, the "save thumbnails" actions doesn't seem to be one of them:

Another reason against switching the script to the web interface is that all users would have to activate/deactivate the web server before using VideoContactSheet.

Does MPC Home Cinema have more controls?
« Last Edit: April 19, 2008, 04:11:33 AM by Nod5 » Logged
4wd
Supporting Member
**
Posts: 3,532



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: April 19, 2008, 05:55:47 AM »

Does MPC Home Cinema have more controls?
The web interface displayed is the same as for MPC but as to whether the 'Save Thumbnails' is implemented within the interface you would need to look at the source code.

As you can see from this page MPC PHP Control, a code is sent to MPC to perform a specific action.

I've yet to find the definitive list of all codes that can be sent, guess I'll have to grab the source.

Personally, I'd prefer to have to enable the web interface for a program such as yours to work, rather than have to not touch the mouse or keyboard while it's working - that just seems counter-productive to me.

eg. I could give your program a batch of files to do and then go back to something serious like online gaming  Wink
Logged

I do not need to control my anger ... people just need to stop pissing me off!
Nod5
Supporting Member
**
Posts: 749



View Profile Give some DonationCredits to this forum member
« Reply #19 on: April 19, 2008, 04:57:12 PM »

I see your point. Other things being equal I also prefer solutions that don't use GUI controls and require keyboard monopoly during the processing. I'm not so sure if it's worth the double work in this case though. I mean, MPC creates each contact sheet pretty quickly. An hour long video only takes 15-20 seconds. So 50 such videos can be processed in around 15 minutes. That's just a coffee break. While some might need to process many, many more files, I suspect that would be a one time thing in most cases (i.e. to process all videos in their archive). For a one time batch a wait of an hour or two is probably acceptable to most. And once the archive is processed to then wait for 15 minutes every month or two while processing new files is no biggie either I'd suspect (that's roughly the pace at which I record stuff with my DVB-T TV card at least). Or maybe this is just the lazy part of me rationalizing Grin
« Last Edit: April 19, 2008, 05:02:51 PM by Nod5 » Logged
nixx_nl
Participant
*
Posts: 3

View Profile Give some DonationCredits to this forum member
« Reply #20 on: May 30, 2008, 08:57:33 AM »

It took me a bit longer then a hour to process all vids smiley (being 330 video's cheesy) but this is also due to the fact that eventhough it plays quicktimes they sometimes require a fast manual click to get rid of some stupid error message smiley

no gui version would be perfect.. especially with a html output connected to it. (we have made a site now with the contactcheets to index all movies)

in this combo it could become a great app worthy of payment Wink
Logged
Nod5
Supporting Member
**
Posts: 749



View Profile Give some DonationCredits to this forum member
« Reply #21 on: July 09, 2008, 05:37:06 PM »

hi majax79, welcome to DC and sorry for the very late reply! Unfortunately I do not know of any way to force MPC to use a screencap of the first frame as the first image in the contact sheet.

In general, if I had a lot more time to make a more flexible contact sheet solution that could do what you ask for, and many more things, I think I'd try to make one that uses VLC as image grabber ( http://wiki.videolan.org/How_to_create_thumbnails ) and graphicsmagick as contact sheet maker ( http://www.graphicsmagick.org/www/montage.html ). But the fact is that I don't have time to do that.
Logged
doggy4s
Participant
*
Posts: 1

View Profile Give some DonationCredits to this forum member
« Reply #22 on: September 06, 2008, 01:07:02 PM »

Stumbled on this forum but also stumbled on this batch video thumbnail creator

http://www.suu-design.com/projects.html

hope it helps
Logged
freestyler
Participant
*
Posts: 1

View Profile Give some DonationCredits to this forum member
« Reply #23 on: September 08, 2008, 06:29:20 PM »

Amazing little script nod5.
I'm searching the last days for a program that batch makes CAPS form videos but i couldn't find any that works.
Your program saved me a lot time.

Just a little problem. Some times the script stops on MPC save thumbnail menu without pressing save to continue.
The reason for this is (from what i understand) is because you "try" to press SAVE immediately after filling the file name and some times if the media player freezes for a second the "press on save button" isn't registered.
Maybe you can add 1 sec delay before pressing save and after filling the file name.
Maybe i'm just wrong smiley
Anyhow, thanks for the program smiley 
Logged
Nod5
Supporting Member
**
Posts: 749



View Profile Give some DonationCredits to this forum member
« Reply #24 on: October 01, 2008, 04:58:34 PM »

hi freestyler. Yeah I've noticed that problem some time. The script already has such a delay - it tries to click "save" up to 6 times (with 0,5 seconds wait inbetween each). So the problem is something else but I haven't pinpointed what it is.

I haven't had time to test Video Thumbnails Maker (mentioned above; http://www.suu-design.com/projects.html ) but it looks good and is freeware:

If anyone does some testing with it, do post feedback here.
« Last Edit: October 01, 2008, 05:01:45 PM by Nod5 » Logged
Pages: [1] 2 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.058s | Server load: 0.02 ]