Change Video Resolution

Hi at all
I want to change the resolution of my video. As far as I know this is possible with IAMStreamConfig.But all the samples I see are handling with a Webcam Input.
What about changing the resolution of a video file?
That's how I would do it, but it doesn't work
Code Snippet
Guid iid = typeof(IAMStreamConfig).GUID;
object outPin;
hr = cgb2.FindInterface(PinCategory.Capture, MediaType.Video, fileSource, iid, out obj);
DsError.ThrowExceptionForHR(hr);
IAMStreamConfig config = outPin as IAMStreamConfig;
AMMediaType mediaType;
hr = config.GetFormat(out mediaType);
DsError.ThrowExceptionForHR(hr);
try
VideoInfoHeader vih = new VideoInfoHeader();
Marshal.PtrToStructure(mediaType.formatPtr, vih);
vih.BmiHeader.Width = 640;
vih.BmiHeader.Height = 480;
finally
Marshal.ReleaseComObject(mediaType);

You both understood what I wanted. Yes I want to the change the video Resolution, not the display resolution!
But when you look at the DxLogo sample you will see this method:
Code Snippet
private void SetConfigParms(ICaptureGraphBuilder2 capGraph, IBaseFilter capFilter, int iFrameRate, int iWidth, int iHeight)
            int hr;
            object o;
            AMMediaType media;
            IAMStreamConfig videoStreamConfig;
            IAMVideoControl videoControl = capFilter as IAMVideoControl;
            // Find the stream config interface
            hr = capGraph.FindInterface(
                PinCategory.Capture, MediaType.Video, capFilter, typeof(IAMStreamConfig).GUID, out o );
            videoStreamConfig = o as IAMStreamConfig;
            try
                if (videoStreamConfig == null)
                    throw new Exception("Failed to get IAMStreamConfig");
                hr = videoStreamConfig.GetFormat(out media);
                DsError.ThrowExceptionForHR( hr );
                // copy out the videoinfoheader
                VideoInfoHeader v = new VideoInfoHeader();
                Marshal.PtrToStructure( media.formatPtr, v );
                // if overriding the framerate, set the frame rate
                if (iFrameRate > 0)
                    v.AvgTimePerFrame = 10000000 / iFrameRate;
                // if overriding the width, set the width
                if (iWidth > 0)
                    v.BmiHeader.Width = iWidth;
                // if overriding the Height, set the Height
                if (iHeight > 0)
                    v.BmiHeader.Height = iHeight;
                // Copy the media structure back
                Marshal.StructureToPtr( v, media.formatPtr, false );
                // Set the new format
                hr = videoStreamConfig.SetFormat( media );
                DsError.ThrowExceptionForHR( hr );
                DsUtils.FreeAMMediaType(media);
                media = null;
                // Fix upsidedown video
                if (videoControl != null)
                    VideoControlFlags pCapsFlags;
                    IPin pPin = DsFindPin.ByCategory(capFilter, PinCategory.Capture, 0);
                    hr = videoControl.GetCaps(pPin, out pCapsFlags);
                    DsError.ThrowExceptionForHR( hr );
                    if ((pCapsFlags & VideoControlFlags.FlipVertical) > 0)
                        hr = videoControl.GetMode(pPin, out pCapsFlags);
                        DsError.ThrowExceptionForHR( hr );
                        hr = videoControl.SetMode(pPin, 0);
            finally
                Marshal.ReleaseComObject(videoStreamConfig);
What do I have to do that this (also) works with a File Source?
Because this method only works with a Live Source (from webcam etc.)

Similar Messages

  • Cannot Change Video Resolution in Youtube

    When I try to change the video resolution in YouTube, the screen goes black and it automatically goes to 240p regardless of the resolution that I choose. It will play the video so long as it remains in its default resolution i.e. 360p or 240p. I also have Chrome downloaded and it has no issue changing between video resolution so I am assuming it is an issue with Safari. I reinstalled Flash and I tried resetting the computer but had no success with either of those attempts. Any ideas?
    Thanks!
    Dan

    Thanks dschinkal! When I view You Tube clips on Safari and click the resolution adjuster to increase it (say, to 720), the screen goes black and I have to click refresh in order to reload the page. After which, it plays again at a low resolution.
    This has happened since I bought my new iMac 27" a month ago.

  • Can you change the size of the preview images on an Apple TV without changing video resolution?

    I have a 32 inch LCD TV. My room is relatively large and I can't easily see the preview images or read the text on the TV across the room. Is it possible to change the size of preview images in the menu screens without increasing the resolution of the TV itself? I think this should be possible, but can't seem to find a way to do it.

    No that's not something you can do on the Apple TV.
    If you have any suggestions that you think might enhance the Apple TV you can send Apple your feedback here.

  • I can't change video resolution on youtube. When I try to change it, it goes to 240p and the screen is black and the vid doesnt play.

    Hello, I have this problem.
    Recently I noticed, that when I try to change the quality of the video from the default 360p to whatever one, the quality will jump to 240p and the video wont run. There will be just black screen.
    I tried resetting the browser and it did not fix my problem.
    I tried the same video in internet explorer and the quality change worked normally.
    How could I fix this?
    Thanks

    Clear the cache and cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"

  • How to change video resolution in Flash CS5

    Hi, I've made a small app that captures and displays the camera feed. But the problem i'm having is that the app only displays a fraction of what the camera is showing (top left part of the corner), is there a way to shrink the resolution in Flash CS5 so that the app can show the full picture??
    Many thanks.

    I think I found the solution to my problem..... but dont know how to implement it correctly.
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageScal eMode.html#SHOW_ALL
    I believe I need to use the SHOW_ALL constant, but there isn't an example of how to do it
    Heres my code, it compiles without errors, but when I publish it as .exe I get the 'Error 1037: Package cannot be nested':
    package
              import flash.display.StageScaleMode
              import flash.media.Camera;
              import flash.media.Video;
              public class ScaleMode
                        public static const SHOW_ALL:String = StageScaleMode.SHOW_ALL;
                        var camera:Camera = Camera.getCamera();
                        if (camera != null) {
                                  videoTwo.attachCamera(camera);
                        } else {
                                  trace("You need a camera.");
              stop();
    Any ideas??

  • How do I change video resolution.

    I have Number-Nine S3mini driver. The bios is 86C357. I can't get the depth of color, nor can I get the higher resolution.
    Any suggestions ?
    Pranava.

    Pravana,
    You can use these 2 commands to attempt a change in the keyboard/display mode comfiguration:
    Login as root
    #kdmconfig -u
    #kdmconfig -cf
    You will see a menu driven configuration screen to set the resolution and monitor type/model.
    Allen Lai
    Sun Microsystems

  • VM change video resolution

    Greetings,
    I have a Win7 VM (4.2.1, and latest additions) running on Win XP Dell laptop E6410.
    The native Win XP runs at 1280 X 800 resolution.
    The VM with Win 7 gives me a choice of 1204 X 733 or 800 X 600.
    I am trying to load Motorola 123Scan2 on the virtual machine, but install fails because it requires 1024 X 768 min.
    Is there a setting I have missed, or a workaround on the Win 7 VM ?
    Thank You,
    Larry Van

    Install the Windows PV driver inside the WIn7 guest. This will not only give you better video, but also better hard disk and network performance.
    You can find the package on edelivery.oracle.com on the latest release of OVM.

  • Change video resolution and get it to be full screen? How..?

    Ok, so i got this small video clip i want to be in 720p. The "problem" is that its current video/image size is 640x480, and it is black on its left and right side. HOW do i edit the video so it gets full screened (and thereby stretched too) and in 1280x720 size? Like, when i play the video in media player and full screen it, it will be full screened WITHOUT those black tiles on the right and left side?

    goodiegood wrote:
    But does either of you know the answer to my other question about the fullscreen? Like, when i go into fullscreen in my media player, there should not be any black lines on the left or right. I see many tv-series that works like this
    It's all in the maths. Your monitor Aspect Ratio is 1280 ÷ 720 = 1.78:1 (the norm for most commercial DVD's) also known as 16:9. Your video aspect Ratio is 640 ÷ 480  = 1.33 (the norm for traditional TV screens) also known as 4:3.
    If you have a 'semi-intelligent' modern widescreen TV you will often find that 4:3 programs look distorted because your TV has stretched the image to ensure no black bars top and bottom. You then have to manually switch, with your remote, the aspect ratio to 4:3 to make the image look normal - but this then leaves black lines left and right.
    But the entertainment companies know that consumers want shows that fill the screen without black bars. To do this for older shows they artificially zoom the original to take only a portion of it. But they take that portion in a 16:9 ratio. It looks good on TV BUT, and a big BUT at that, you have lost some of the original image. They are also doing this with feature films.
    Two examples that arouse my ire:
    'The Wizard of Oz'. Originally filmed in 4:3 (most films before, around 1957, were). But go to any video store and you can buy a widescreen version. But there never was a widescreen version of that film. All they've done is cut a 16:9 segment out of each frame and, figuratively, thrown the rest away.
    'Original Star Trek'. You can buy this in widescreen, or watch the TV widescreen version. But there never was a widescreen version - they are cropping it to 16:9 and throwing the rest away.
    You can usually tell if a film/show has been cropped: there will be many examples (frequently of close ups on peoples faces) where the top or bottom of their heads don't show.
    So to (finally) answer your question: to Share your video in a widescreen format you must crop your clips to a 16:9 frame - job done.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children

  • Option of changing video resolution higher than 360p just disappeared on youtube, when I use chrome everything is fine. why?

    There is just no more resolutions either than 360p on that list when I use Firefox.

    This happens in safe mode:
    *[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Firefox in safe mode]
    Also try turn off the hardware acceleration:
    *[https://support.mozilla.org/en-US/kb/upgrade-graphics-drivers-use-hardware-acceleration Upgrade your graphics drivers to use hardware acceleration and WebGL]
    Also:
    *[http://www.mozilla.org/en-US/plugincheck/ Check plugins]

  • Change the video resolution when capturing a WEB-cameras

    Language: Java
    It is used in addition: JMF
    When capturing video from WEB-cameras with JMF - getting the video is at the lowest resolution.
    Can you please tell how to change the video resolution?
    The code by which the captured image (no SWING-forms):
    MediaLocator getWebCam = new MediaLocator("vfw://0");
    private Player player;
    Timer timer = new Timer(40, this);
    public BufferedImage grabFrameImage() {
    Image image = null;
    FrameGrabbingControl frameGrabbingControl = null;
    if (player != null)
    frameGrabbingControl = (FrameGrabbingControl) player.getControl("javax.media.control.FrameGrabbingControl");
    Buffer buffer = frameGrabbingControl.grabFrame();
    if (buffer != null)
    image = new BufferToImage((VideoFormat) buffer.getFormat()).createImage(buffer);
    if (image != null)
    return (BufferedImage) image;
    return null;
    public WorkWithWebCam() throws NoDataSourceException, IOException, NoPlayerException {
    initComponents();
    player = Manager.createPlayer(Manager.createDataSource(getWebCam));
    player.start();
    private void jButton1ActionPerformed(ActionEvent e) {
    timer.start();
    public static void main(String args[]) {
    EventQueue.invokeLater(new Runnable() {
    public void run() {
    try{
    new WorkWithWebCam().setVisible(true);
    }catch(Exception ex){}
    public void actionPerformed(ActionEvent e) {
    panelMain.getGraphics().drawImage(this.grabFrameImage(), 0, 0, 400, 300, null);
    P.S. Can you please tell how this forum can be identified code \ listing?

    Hello,
    I don't know if there is a way to change the video. But I think you can easily use your own videos by using a local .mpg or .3gp file via InputStream. Just change the player's parameters in video/mpg instead of capture://video.
    Hope it helps...
    Torsten

  • Problem to change screen resolution in MB Intel DG41 with video on board

    Hi, I need some help as soon as possible because this problem it´s make me difficult my job. I have installed the MAC OS Snow Leopard 10.6.2 in a Motherboard Intel DG41 with micro Core2Duo and video on board of this motherboard and don´t let me change screen resolution. I have a display of 22´ inches and the panel to change the screen resolution only mark 1024x768. I think the more likely it is that the system does not recognize me the drivers to this chipset of video. I searched everywhere on the internet but I have not found the solution.
    Thanks Fernando

    First of all sorry for my English is not very good. My PC is an Intel MotherBoard DG41 with onboard video and a micro Core2Duo. The system is MAC OS Snow Leopard 10.6.2.
    Thanks for replying

  • When I am open file with adobe Pro and reader the resolution in my computer failing, change the resolution from 1920x1200 to 800x600. my video card is nvidia quadro 2000. w7 & 32 bits

    when I am open file with adobe Pro and reader the resolution in my computer failing, change the resolution from 1920x1200 to 800x600. my video card is nvidia quadro 2000. w7 & 32 bits

    Hi fabiangs,
    I'm not sure that I follow. Are you saying that when you open a PDF file in Acrobat or Reader, that the display resolution changes automatically on your system?
    What version of Acrobat/Reader are you using? Do you see this same issue in other files/applications?
    I look forward to hearing back from you.
    Best,
    Sara

  • Changing video clip resolution

    Let's say I've completed a video. I have mulitple clips, connected clips and such. So let's say these clips are a 1400x788 resolution. I would like to change the resolution to 1280x720 BEFORE export. Is this possible to change the resolution of the clip itself once it is on the timeline and edited.
    Thanks in advance!

    What you really mean is to change the project frame size. The clips are what they are.
    Depending on the spatial conform options, it may be as simple as selecting your project, going to the inspector and clicking on "Modify Settings". See the picture below.

  • How do you change the resolution size of a mp4 file?

    I am looking for a free (really free, not just a trial for 30 days free) program that will allow me to change the resolution of a mp4 video.
    If this is a "parameter" setting issue in DW what would be the parameter and the value?
    The video is here: http://www.argraph.com/Sirui-P-Series-Monopods.html#psSeries.............a little past midway down the page.
    As you see the words SIRUI and the tag line cannot be seen in their entirety.
    THIS is the way it should look.....
    The second image represents a youtube link but my boss said he cannot see it on his laptop or tablet
    and insists that I use mp4 because it works with all formats; iphone, android, pc and mac.
    I tried doubling the size of the file and it worked but was SOoooooo big that it blew the page out so I suspect that I
    have to resize the file.
    Ken? Nancy? ANYBODY?????   Seriously as always any suggestion would be greatly appreciated.
    -Gwynnplaine-

    1. As far as HTML5 support, if they have a browser made within the last few years (I think since about 2009), it supports html5. The page I linked to gives the versions where all of the major browsers started supporting the <video> tag.
    2. The "your browser does not support..." text is what appears on screen when a viewer uses a browser that doesn't support HTML5 (like IE8).
    If you still plan to support the old non-html5 browsers, the best thing to do is to place a fallback video using the old <object><embed> method in that "your browser does not support" location. That way, if they don't have an html5 compatible browser, the fallback video will play using whatever plug-in they have installed to deal with it. It would look like this...
    <video width="320" height="240" controls>
    <source src="movie.mp4" type="video/mp4" />
    <source src="movie.ogg" type="video/ogg" />
    <object width="320" height="240">
    <param name="movie" value="myvideo.swf" />
    <embed src="movie.swf" width="320" height="240"></embed>
    </object>
    </video>

  • Nokia Lumia 820 change photo resolution

    Hello,
    Can anyone tell me why can't I change the resolution in the photo camera? If I choose video I can select resolution, but on photo I cannot, there is no option. This is not ok, my phone took the last photos both in landscape and portrait at 1280x720 / 720x1280 resolution. If it has 8mpx why can't I benefit from this res?? who from Nokia had this brilliant idea of taking out the option to select the photo resolution???

    I presume you are uploading your photos to Skydrive. The phone automatically reduces the resolution before photos are uploaded. To dwnload your photos at full resolution you need to either connect to pc via usb or change the auto upload settings as follows. Goto settings>backup>photos>best quality (needs wifi)

Maybe you are looking for