Obtaining screenshots from X264 encoded video streams

Locked
User avatar
BasharOfTheAges
Just zis guy, you know?
Joined: Tue Sep 14, 2004 11:32 pm
Status: Breathing
Location: Merrimack, NH
Org Profile

Obtaining screenshots from X264 encoded video streams

Post by BasharOfTheAges » Wed Dec 14, 2005 6:13 pm

This is more of a general question for an icon or image macro rather than a video, but how exactly would one go about getting a screencap from X264 encoded video? I know this may sound awkward, but for some reason Media Player Classic won't open the file at all; VLC will, but it doesn't have a save image option; Virtualdub simply refuses to open the file; Photoshop and MSPaint both accept a "print screen"-ed image, but they both refuse to crop correctly and when I attempt to save the image as is it saves as a completely black screen.

Any suggestions?
Anime Boston Fan Creations Coordinator (2019-2023)
Anime Boston Fan Creations Staff (2016-2018)
Another Anime Convention AMV Contest Coordinator 2008-2016
| | |

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Post by Qyot27 » Wed Dec 14, 2005 6:32 pm

1) Do you have Haali's Media Splitter installed, or are you using Media Player Classic's default MP4 or MKV splitter (whichever one applies in this case)? Do you also have ffdshow installed and set to decode H.264/AVC? The newest builds of both of those are recommended for this.

2) It also sounds like you might be dealing with ISO-AVC, which is the proper way it should be stored in a file (the VFW implementation is a worse hack than DivX/XviD-encoded MPEG-4 Part 2 in AVI was). To work around this, you have two options:

a. Dump the raw .264 stream from the file with mp4box or mkvextract, and then use avc2avi to place it in an AVI container (not recommended, as it's kind of time consuming and cumbersome to do it correctly with the command line)

b. Once Haali's Media Splitter and ffdshow are installed/set up to decode AVC streams, open Graphedit and choose Render Media File... Choose the AVC file, delete every box that occurs after ffdshow (you might also want to delete the audio-related boxes also if you don't need them), and choose Save As Graph. Then use AviSynth's DirectShowSource function to serve the .grf file into VirtualDub. Unlike trying to use DirectShowSource with other types of media files, using it with .grf actually works the way it's supposed to.
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog

User avatar
sysKin
Joined: Fri Mar 26, 2004 6:37 am
Org Profile

Post by sysKin » Wed Dec 14, 2005 9:02 pm

Ffdshow has "grab" funciton in its configuration. Can grab all frames in a rangem or any particular frame, or just at the moment when you press the button.

User avatar
BasharOfTheAges
Just zis guy, you know?
Joined: Tue Sep 14, 2004 11:32 pm
Status: Breathing
Location: Merrimack, NH
Org Profile

Post by BasharOfTheAges » Wed Dec 14, 2005 10:01 pm

Thanks for the tips. Apparenttly something isn't configured in FFDShow correctly. I'm not really sure what exactly, but the file loads into MPC and won't play. It sits there stopped, yet provides a timeline that has an acurate video length displayed at the bottom. The play and pause buttons are simply unresponsive. I guess i'll attempt to follow the advice you gave, (although i'm not sure it's worth it for a single screenshot).

Any idea on why the printscreen images i take in VLC won't save in Paint or Photoshop?
Anime Boston Fan Creations Coordinator (2019-2023)
Anime Boston Fan Creations Staff (2016-2018)
Another Anime Convention AMV Contest Coordinator 2008-2016
| | |

trythil
is
Joined: Tue Jul 23, 2002 5:54 am
Status: N͋̀͒̆ͣ͋ͤ̍ͮ͌ͭ̔̊͒ͧ̿
Location: N????????????????
Org Profile

Post by trythil » Wed Dec 14, 2005 10:17 pm

BasharOfTheAges wrote:Any idea on why the printscreen images i take in VLC won't save in Paint or Photoshop?
VLC, like just about every other video player out there, will make use of a hardware video overlay to write image data straight to the video card and thus bypass Windows' screen capture mechanism. You'll see this in action if you capture a playing video, load the screenshot into a paint program, and move the paint window around.

trythil
is
Joined: Tue Jul 23, 2002 5:54 am
Status: N͋̀͒̆ͣ͋ͤ̍ͮ͌ͭ̔̊͒ͧ̿
Location: N????????????????
Org Profile

Post by trythil » Wed Dec 14, 2005 10:19 pm

trythil wrote:
BasharOfTheAges wrote:Any idea on why the printscreen images i take in VLC won't save in Paint or Photoshop?
VLC, like just about every other video player out there, will make use of a hardware video overlay to write image data straight to the video card and thus bypass Windows' screen capture mechanism. You'll see this in action if you capture a playing video, load the screenshot into a paint program, and move the paint window around.
Oh, I should have written this:

It's possible to force some video players to take the (slow) route through their windowing system, which will let you use the usual screenshot mechanisms to capture frames. mplayer, for instance, will let you do that.

No idea about VLC or anything else on Windows, though. Maybe disabling hardware acceleration would do it there.

I still wouldn't screenshot, though; it's too error-prone and too slow.

User avatar
Beefy_Suavo
Joined: Sat Feb 26, 2005 1:20 pm
Status: Dead and loving it
Location: Denver, CO
Contact:
Org Profile

Post by Beefy_Suavo » Wed Dec 14, 2005 11:33 pm

I don't have any x264 videos to try this with, but if the video will play in QuickTime 7, then you can go to the frame you want, and choose Edit -> Copy or Ctrl-C. Then paste the image into MS Paint or other image editing program.

You don't need QuickTime Pro, just plain QuickTime 7 will work.

Of course, if QuickTime 7 won't play a x264 video, then nevermind.
"WELDING! Oooo pretty light... AHHH! It burns!"
"Keep that up you'll go blind."

trythil
is
Joined: Tue Jul 23, 2002 5:54 am
Status: N͋̀͒̆ͣ͋ͤ̍ͮ͌ͭ̔̊͒ͧ̿
Location: N????????????????
Org Profile

Post by trythil » Wed Dec 14, 2005 11:52 pm

Beefy_Suavo wrote:I don't have any x264 videos to try this with, but if the video will play in QuickTime 7, then you can go to the frame you want, and choose Edit -> Copy or Ctrl-C. Then paste the image into MS Paint or other image editing program.

You don't need QuickTime Pro, just plain QuickTime 7 will work.

Of course, if QuickTime 7 won't play a x264 video, then nevermind.
Theoretically, it should be possible for QuickTime to play H.264 content encoded with anything (as you can encode H.264 content into MP4 with a wide variety of encoding and muxing tools), but in practice...

yeah, it doesn't work out that way.

Locked

Return to “Video & Audio Help”