Changing the Cover Art for a WMV Video File

mona_lisaAs you may have read from my previous postings, I use my Zune primarily for watching TV shows that have been recorded on my desktop PC in DVR-MS format, and then converted to WMV format for my Zune. I’ve got the entire process automated using the wonderful utility called, DVRMSToolbox, along with a commercial-cutting utility called ShowAnalyzer.

The only small issue I have, is that the cover art for the generated WMV file (or “Thumbnail” image) is obtained from a randomly selected frame image from the video file. Since this frame image is selected before all the commercials are cut out, sometimes it will use a image frame from a commercial and thus looks bad as a cover art for the video file. As such, there isn’t an easy way of defining a different frame or image to be used as the cover art. You can use the File Explorer add-on utility called AudioShell to define the cover art, but that’s a very manual process and I want something that can be done on a command line for use with my DVRMSToolbox setup.

Thus, I created a small utility called setWMVThumbmailImage which will modify the WM/Picture attribute of WMV video file container and set the cover art to a specified jpg file. To use it, you run the following from a DOS command window:

setWMVThumbnailImage (input wmv file)  art  (cover.jpg)

So as an example, if I have a video file called, “fringe.wmv” and I want to change the cover art for this video to use the jpg image file, “fringe_show.jpg” I would use the following command,

setWMVThumbnailImage  fringe.wmv  art  fringe_show.jpg

Note, that “art” is a required keyword that tells the application to insert the jpg as the cover art.

With this utility, I can now use it to insert a jpg image as the cover art for my converted DVR-MS file to WMV format. So, I can change the cover art, but how do I extract an image from the video file to be used as the cover art? The makers of DVRMSToolbox also have a utility called DSSnap which is suppose to extract a specified frame from a DVR-MS video file into a jpg file, but it doesn’t seem to work on my Vista OS system. As such, I discovered that I can use the well known video converter tool called FFMpeg to extract a specific image from a WMV video file to a jpg file. Here’s how I would extract the video frame image at 1 minute, 10 secs into the video playback,

ffmpeg -i “fringe.wmv” -an -ss 00:01:10 -t 00:00:01 -f image2 -vcodec mjpeg “fringe_show.jpg”

So I can use the above operation to get the desired jpg cover art from the video being processed, and use my utility to insert this jpg image as the cover art for the WMV video file. I’m going to test this a bit with my automated conversion system and if it works ok, I’ll make my cover art utility available on this web site in the near future. Stay tuned!

Advertisements

14 thoughts on “Changing the Cover Art for a WMV Video File

  1. Jay says:

    I prefer to do this manually by using Tag&Rename. Too bad it’s shareware.
    Audioshell conflicts with some other software I use. However, when I add cover art
    to a video that is already in my Zune library, it doesn’t recognize the new art. It keeps
    the one that the Zune software gave it. Is there any way to fix this?

    (btw) Thanks for the site.

  2. zunetips says:

    Jay: I believe you need to remove the modified video from your Zune sync folder, and then put it back for the Zune software to see the changed thumbnail image.

    Are you using WMV or MP4 video files?

  3. Jay says:

    Thanks. That did the trick. Previously I renamed the video while the Zune program was open, then named it back. That didn’t work. This time I moved the videos out of the folder, then opened up the Zune software. After it acknowledged that there were no videos, I closed the program, moved the videos back, and reopened the sotware.

    I’m using wmv files. I have an old Zune 30. Thanks for the help.

  4. Randy says:

    Just browsing around Mp3tag’s forum and it seems that Florian may be interested in adding some Zune support to his program. At least he replied!

    http://forums.mp3tag.de/index.php?showtopic=10155

    Although the post is not about Video tags, it may lead into it.

    It would be awesome if he did! Maybe someone browsing here could head on over and answer any questions he may have.

  5. Iain Smith says:

    Any chance you could share the code for this utility, or even point me at some tips?

    I’ve managed to update pretty much all other WMV fields but struggling with WM/Picture.

    Many thanks.

  6. zunetips says:

    Iain: Do you want the source code or the compiled executable?

  7. Bitwize says:

    I would LOVE to have the compiled executable for your nifty application…

    setWMVThumbmailImage

    Thanks so much! I’ve been looking for something like this a long time.

  8. zunetips says:

    Ok, here’s a link to that executable:

    http://www.filefactory.com/file/a1ea5e3/n/SetWMVThumbnailImage.zip

    Hopefully, you’ll have all the required system DLL files on your machine to run it. If it doesn’t work, let me know.

  9. Bitwize says:

    Thx so much, but the file link has expired already 😦 Please post again if you don’t mind! Much appreciated 🙂

  10. zunetips says:

    Ok, I’ve updated the link. Give it a try now.

  11. Bitwize says:

    Brilliant! Thx again!!

  12. Novy says:

    Can you refresh the link, it is dead again or email me the file. Thanks!

  13. PCWarrior says:

    That little program you have there works unbelievably well! Thank you so much! I pitted it against Audioshell, and it actually performs faster, which is sweet. Is it possible that I can see the source code please? I’m in Computer Engineering, and am learning a ton of programming, some at school, but mostly on my own, and am curious what you did to be able to do this. Thanks a lot again!

  14. Shadan says:

    Greetings
    Can you kindly share the exe file with me?
    Thanks and best regards
    Shadan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s