Results 1 to 9 of 9
  1. #1
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Extracting WMV3 Screenshots with FFmpeg
    I've been pulling my hair out trying to figure out how to use a Linux server to extract still frames from WMV3 video files. Unfortunately a decoder hasn't been built that works with FFmpeg, but there are so many sites online that do it already. Any idea how I can decode a WMV3 file through Linux? A couple sites that do it are www.zippyvideos.com, http://video.google.com, www.putfile.com and www.youtube.com. Youtube even converts the wmv3 file to an flv which would be an added bonus. How are they doing this?

    Thank you!
    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  2. #2
    Member johnm's Avatar
    Join Date
    August 24th, 2005
    Location
    minneapolis
    Posts
    65
    Yep.. MPlayer/MEncode + win32 codecs on linux
    Hi there,
    From what you are saying, you can extract the frames from other formats, but you are having trouble with WMV3/WMP9 support on linux. Well, MEncode can load and utilize win32 binaries (dll) on linux. Grab the MPlayer/MEncode project, but make sure you install the win32 codec packages FIRST -- before you compile & install !

    helpful links:
    http://www2.mplayerhq.hu/DOCS/HTML/en/mencoder.html
    http://www2.mplayerhq.hu/DOCS/HTML/e...odec-importing
    http://www2.mplayerhq.hu/homepage/design7/codecs.html

    quote: " If you run Linux on an x86 processor, you should grab the essential codec package. It includes every working codec that is not implemented natively, like Windows Media 9, newer Real Audio/Video, Quicktime QDM2 audio, and a lot of other less common formats. You will surely miss some important features of MPlayer without this codec package."

    Let me know if you need more info. If you run into a broken link on mplayerhq.hu, just replace the www with www2. I think they are having server issues.

    As far as the flv conversion you can set up batch jobs for windows machines running one of the sorenson squeeze (etc) packages. They probably just have machines set up waiting for files to appear, and compress them as they come. The FLV format is a tainted version of sorenson spark -- albiet pretty handy. The other option you have is if you have some really clever video capture driver and application that can take a video file, and stream it as if it were a live source, and let a flash movie capture it as if it were a web cam (or other capture source). It does work but it's a monumental pain in the butt, not to mention unreliable and buggy.

    Now that I think about it, FFMpeg may be able to load the dll's as well, but I haven't looked in a long time. I also remember something about an app called "transcode" that worked for me in lieu of ffmpeg for a few things, `back in the day'. Good luck, let me know how it turns out.

    Cheers,
    John

  3. #3
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Wow, those dll's worked like a charm!! Now I just need to figure out how to use mencoder properly. I found this URL that describes how to convert to flv:

    http://archives.free.net.ph/message/...bbe9ea.en.html

    I tried both of these commands and they were able to convert the wmv3 to an flv file, but the sound stops 2 seconds into it and the video plays much too fast. I'm sure there's something wrong with the parameters. Do you happen to have a good reference for using mencoder?

    Thanks again! You've been a huge help,
    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  4. #4
    Member johnm's Avatar
    Join Date
    August 24th, 2005
    Location
    minneapolis
    Posts
    65
    You bet, I should've included it in my previous email! Sorry, I was about passing out at the keybord. Without further ado, a decent overall encoding reference:

    http://www2.mplayerhq.hu/DOCS/HTML/e...ing-guide.html

    Thinking about what you said, the audio plays for about 2 seconds into it, and the video goes way too fast ---- seems like there is a sample rate mismatch somewhere. Your video and audio aren't synced. Try other sample rates for the audio (8/11/22/44 are used with flv/mx com) and/or other encoder bitrates. I think what is happening is the FLV player is trying to play the video at a framerate derived from the sample rate of the audio, and ostensibly it is expecting something a bit lower bandwidth from the audio (less audio data resolution: lower video frame rate, in this case).

    Might fiddle with any of the flv encoder settings for encoding bitrate and/or sample rate, or if there are options for the relationship between the two -- Something like the ar/ab ffmpeg settings -- might also want to use a two-pass system (not a 'proper' 2-pass, just in name): the first to transcode the wmv3 file to a standard flv-friendly rate (whatever that might be) and the second pass to convert it.

    cheers,
    john

    Quote Originally Posted by Snib
    Wow, those dll's worked like a charm!! Now I just need to figure out how to use mencoder properly. I found this URL that describes how to convert to flv:

    http://archives.free.net.ph/message/...bbe9ea.en.html

    I tried both of these commands and they were able to convert the wmv3 to an flv file, but the sound stops 2 seconds into it and the video plays much too fast. I'm sure there's something wrong with the parameters. Do you happen to have a good reference for using mencoder?

    Thanks again! You've been a huge help,
    - Scott

  5. #5
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Thanks for the tips, you've been extremely helpful. I tried changing the sampling rate and that had no effect. I even did -nosound, but the video still plays much too fast. I couldn't seem to convert to anything but flv. Everything else failed. Very strange.. When converting wm3 to mpg, I got the following error:

    bitrate 224 is not allowed in mp2

    Which is strange because it should accept that bitrate. I tried 44100 as the bitrate and this error went away, but the resulting mpg file didn't play properly. I think the problem is still with the wmv3 as I've been able to convert mpg and mov to flv successfully with sound and a normal speed. I'm wondering if I should try a different dll library.

    Thank you,
    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  6. #6
    Member johnm's Avatar
    Join Date
    August 24th, 2005
    Location
    minneapolis
    Posts
    65
    You are very welcome. I liked your posts you made awhile back on the web 2.0; I've mixed thoughts about it all, but the reality of it all is neither the hype nor the doldrums that people make it out to be -- at any rate, I agree with most of what you said. As far as this thread, I'm always glad to help. It being a curious problem makes it fun to figure out.

    That said, this is kind of annoying me now; I wonder what the deal is. I have a hard time letting mysteries die, and there are always plenty of them in a/v work on non-windows platforms (and even windows sometimes). It really could be a combination or just about anything, or almost nothing at all. Nature of the beast I guess. I'd like to know how it turns out if you don't mind, if for nothing else but to keep for my notes.

    If you don't mind me asking, what are you working on? Maybe I could solve the problem with a different tack? I have sort of understood that you're a developer by a number of your posts, and I'm always interested in what's going on. If you do mind, no harm done, I understand.

    Take it easy,
    john

    Quote Originally Posted by Snib
    Thanks for the tips, you've been extremely helpful. I tried changing the sampling rate and that had no effect. I even did -nosound, but the video still plays much too fast. I couldn't seem to convert to anything but flv. Everything else failed. Very strange.. When converting wm3 to mpg, I got the following error:

    bitrate 224 is not allowed in mp2

    Which is strange because it should accept that bitrate. I tried 44100 as the bitrate and this error went away, but the resulting mpg file didn't play properly. I think the problem is still with the wmv3 as I've been able to convert mpg and mov to flv successfully with sound and a normal speed. I'm wondering if I should try a different dll library.

    Thank you,
    - Scott

  7. #7
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    I've got a new idea to recompile mplayer with the CVS sources rather than the downloadable. Somebody said that might be a better idea. I'll give that a shot and see if I have any better luck. I used the Linux essential codecs and am considering using the 'all' set instead. You think that might make a difference?

    Basically I'm trying to take any media format and convert it to flv then generate a screenshot for reference. Sort of like the sites I listed above. I thought it'd be easy, but boy was I wrong! I'm making progress though and I'm happy to have finally generated a screen from a wmv3 file. Now I just need to get it to convert to flv properly.

    The web 2.0 stuff interests me greatly, but hype aside the building blocks are more or less essential in future development. Tagging especially as that's really a facinating categorization method. I'm starting to use it on all my projects and hope to incorporate more RSS and AJAX as time goes on.

    Thanks again,
    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  8. #8
    Member johnm's Avatar
    Join Date
    August 24th, 2005
    Location
    minneapolis
    Posts
    65
    No problem! I agree re: web 2.0; the drive towards web services as components of all types is the obvious and most useful route. I also agree that tagging is fascinating! I'm doing some heavy work with a pretty large scale system that utilizes several forms of it (hand and machine derived classification). Participating in tagging things and designing algorithms to use them in various (many novel) ways seems to open my mind to really think about how people interpret things, and perhaps they give a bit of direction to motivations, and probably the most fascinating aspect, the ability to glean a bit of information on the "organic relationships" between subject matter on many different levels (people, their things, their tags, etc.).

    I could BS for hours about this stuff, but as far as this thread is concerned, mission accomplished. I do have to get back to work for tonight. Good luck with your video project! I'd like to take a peek when it's up and going, or any other curio you have. Here, I'll go first. Fire up Firefox and take a peek at my re-creation of the OSX dock in pure javascript:

    http://tlwtc.blogspot.com/

    Cheers,
    John

    Quote Originally Posted by Snib
    I've got a new idea to recompile mplayer with the CVS sources rather than the downloadable. Somebody said that might be a better idea. I'll give that a shot and see if I have any better luck. I used the Linux essential codecs and am considering using the 'all' set instead. You think that might make a difference?

    Basically I'm trying to take any media format and convert it to flv then generate a screenshot for reference. Sort of like the sites I listed above. I thought it'd be easy, but boy was I wrong! I'm making progress though and I'm happy to have finally generated a screen from a wmv3 file. Now I just need to get it to convert to flv properly.

    The web 2.0 stuff interests me greatly, but hype aside the building blocks are more or less essential in future development. Tagging especially as that's really a facinating categorization method. I'm starting to use it on all my projects and hope to incorporate more RSS and AJAX as time goes on.

    Thanks again,
    - Scott

  9. #9
    Member johnm's Avatar
    Join Date
    August 24th, 2005
    Location
    minneapolis
    Posts
    65
    Sorry, got carried away -- YES, compile it from scratch. And absolutely try the other dll sets.


    Quote Originally Posted by Snib
    I've got a new idea to recompile mplayer with the CVS sources rather than the downloadable. Somebody said that might be a better idea. I'll give that a shot and see if I have any better luck. I used the Linux essential codecs and am considering using the 'all' set instead. You think that might make a difference?

    Basically I'm trying to take any media format and convert it to flv then generate a screenshot for reference. Sort of like the sites I listed above. I thought it'd be easy, but boy was I wrong! I'm making progress though and I'm happy to have finally generated a screen from a wmv3 file. Now I just need to get it to convert to flv properly.

    The web 2.0 stuff interests me greatly, but hype aside the building blocks are more or less essential in future development. Tagging especially as that's really a facinating categorization method. I'm starting to use it on all my projects and hope to incorporate more RSS and AJAX as time goes on.

    Thanks again,
    - Scott

  10. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Extracting data from emails
    By munizjm in forum Programming / Datafeeds / Tools
    Replies: 3
    Last Post: December 31st, 2003, 01:49 PM
  2. Extracting query strings
    By happypoon in forum Midnight Cafe'
    Replies: 11
    Last Post: September 24th, 2003, 03:33 AM
  3. Tips For Extracting Payment
    By Tiebreaker in forum Midnight Cafe'
    Replies: 6
    Last Post: July 29th, 2003, 03:05 PM
  4. Screenshots
    By Haiko de Poel, Jr. in forum Programming / Datafeeds / Tools
    Replies: 9
    Last Post: December 4th, 2001, 02:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •