Dynamically read height and width dimensions of .mov

Hi there!
I am wondering if anyone knows of a way to dynamically get the height and width dimensions of a quicktime movie, before streaming it?
The circumstances are this. I have clients who upload quicktime movies to my server. Right now, I use code to embed movies in a fixed size page, but the movies can vary quite dramatically in terms of their dimensions. For example, if the movie is 400px wide, it looks fine in my page. However, if it is 800px wide, it extends out beyond the borders of my page and looks terrible. I could just make a huuge page, but then the tiny movies look ridiculous
If I could somehow gets the dimensions of a movie before it starts streaming, i could create a large target page for larger movies, and a small target page for small movies. Basically it comes down to being able to somehow dynamically read the dimenions of the movie.
Is this even possible? Like my boss keeps telling me, it's all just Math isn't it?
Thanks!!!

Hmmm...
I think the movie dimensions are exposed to JavaScript, but only after the movie has opened. So you would have to load the movie into the plugin, then get the dimensions, then use JavaScript to rewrite the page. Which I don't think is quite what you had in mind; you're wanting to collect this information and deal with it before you write the page.
Let me see if I have this straight...You are allowing clients to upload movies to your server, and then you're hoping to generate an embedded movie page on the fly in PHP to display the movie just uploaded, correct?
For a library of movies, you could generate a small database of all the movie dimensions, then just look that data up in the table when you generate the page. The trouble is, I don't know of any way to get the movie dimensions except to get them from QuickTime, and to do that you have to load the movie into either the player or the plugin. You could, for instance, have an AppleScript that looks at each movie and populates the database, but I don't see how you could trigger that to run on upload, and I don't know what kind of server you're using.
Now here's an idea...If you have some way of arbitrarily reading and parsing the QuickTime file, you can get the dimensions out of the file, but it isn't easy. If you are lucky, the moov atom will include a prfl atom (movie profile) which includes the video dimensions. But the prfl atom is not mandatory, which means you have to look at each trak atom that contains video and examine the size *and position* and accommodate the fact that you may have multiple, overlapping video tracks. But you could get the data by parsing the QT atoms yourself. All the data you need to do that is here:
http://developer.apple.com/documentation/QuickTime/QTFF/QTFFPreface/chapter1_section1.html
...and may God have mercy on your soul!
Seriously, though, you CAN parse a QT file, and that might be the best (though obviously not the easiest!) way to get the data you want dynamically. QuickTime does help you out by giving you all the offsets for all the atoms, but it can be tricky!
--Dave Althoff, Jr.

Similar Messages

  • Adjusting Text Height and Width using the Move Tool...

    I have yet another question about using Type in PSE 5.0. I know you can adjust a particular types size by using the font drop down menu and clicking on any of the listed sizes or you can type in a custom size as well.
    Is it though, ok to expand the Type/Text by selecting it with the Move tool and then enlarging it by using the selection handles located on the Box surrounding the text? I know you can do this, but I am wondering if you run the risk of creating a jagged look or pixalizing the text this way. The text is still vector based at this point, so I am thinking that it shouldn't be a problem, but wanted to know if it could look pixaly upon printing. I have found that I can sometimes get the text to look more the way I want using this method rather than just relying on changing the font size.
    Thanks,
    Lee

    I believe you can achieve this by using the Move Tool, clicking on any one of the resizing handles surrounding the Box which the Move Tool creates when you select an object using it, and then just drag the resizing handles to expand your text to your liking.
    If you press on a corner handle and press the shift-key at the same time while you drag, you should maintain the aspect ratio of your text.
    But that's what my original question is above. By expanding or contracting the text in this way, are you running the risk of things looking jagged and/or pixaly. Is it okay to expand/contract text using the Move Tool or you should you only adjust by setting the Font size.
    Lee

  • Dynamically size movieclip to fit text's string height and width

    Hello,
    I am trying to dynamically size a movieclip to fit the size of a text's string height and width (This text is inside the movieclip)
    here is my code so far..
    var Font1_ = new Font1();
    var Format2:TextFormat = new TextFormat();
    Format2.size = 36;
    Format2.align = TextFormatAlign.CENTER;
    Format2.font = Font1_.fontName;
    var MessageBox:MovieClip = new MessageBoxMC();
    MessageBox.Text1.defaultTextFormat = Format2;
    MessageBox.Text1.embedFonts = true;
    MessageBox.Text1.antiAliasType = AntiAliasType.ADVANCED;
    MessageBox.Text1.wordWrap = true;
    MessageBox.Text1.width = 800;
    MessageBox.Text1.height = 400;
    MessageBox.Text1.textColor = 0xFFFFFF;
    MessageBox.Text1.cacheAsBitmap = true;
    MessageBox.Text1.mouseEnabled = false;
    MessageBox.Text1.text = String("Use the Arrow Buttons to move");
    MessageBox.width = MessageBox.Text1.width;
    MessageBox.height = MessageBox.Text1.height;
      MessageBox.x = 400;
      MessageBox.y = 200;
      addChild(MessageBox);
    this isn't working for me.. anyone know the best way to do this?
    I also want the text to be centered in the movieclip, with a border of around 2-4 pixels
    I am also not sure if i should be using text.length? any advice and input is greatly welcomed.
    thanks in advance!

    Essentially, you need to check for a change in .textWidth or .textHeight, which are different from .width and .height.
    This code works for me (assumes a background box called bg and a foreground text instance fg inside a moveclip and an X and Y bounds offset variable to say how far away you want the box from the text and a textFrameNudge to provide a tweak value).
         // Resize background box
         thisBox.bg.x = thisBox.fg.x - boundsOffsetX + textFrameNudge; // I'm using .4 as the tweak value for textFrameNudge
         thisBox.bg.y = thisBox.fg.y - boundsOffsetY;
         thisBox.bg.width = thisBox.fg.textWidth + boundsOffsetX*2 +textFrameNudge*thisBox.fg.getTextFormat().size;
         thisBox.bg.height = thisBox.fg.textHeight + boundsOffsetY*2;

  • Dynamically changing the height and width of Stage

    Hi,
              I would like to know how can I change the height and width of stage dynamically. I tried it with the following code:
                             Stage.height = 250;
                             Stage.width = 250;
    during the run time. Initially the Stage is at a height and width of 370 and 450 respectively. Also when I tried to trace the height and width of Stage after resizing the stage width and height, its showing the old value of width and height. That means the width and height not chnaging. Anybody have any idea about this.

    Hi Ross,
                I could understand something about the problem after making a research on this topic. We can't change the width and height of stage from actionscript itself, right? I will explain the way I am planning to do. I don't know whether its right or not. Anyway you just go through it. First the player need to be resized, according to the specified height and width. Then in the object tag, there are two fields named height and width. We should change these value according to the specified height and width of video controller, dynamically. Am I right? But I am confused with two properties of Stage such as: align and scaleMode. The code was actually developed my trainer. There, the scaleMode is set to "noScale" and no align property is used. My doubt is how should I set align and scaleMode properties of Stage. Hope you understood what I meant.
    Regards,
          Sreelash.S.

  • Can I turn off the setting that displays the height and width in a little black box when using the marquee tool?

    In Photoshop CC, on a mac...
    When using the marquee selection tool, a little black box pops up next to the curser and displays in real time, the height and width of the selection.  The same annoying box also appears when dragging an item with the move tool, displaying the numerical location of the cursor.  Is there anyway to turn off the display of that little black box?  It is driving me bonkers.

    Under the preferences cmd/ctrl-k click on "Interface". At the bottom of the UI is a drop down box for show transformation. Set that to "Never"

  • How to resize and maintain height and width ratio IR image column

    Hello, I am upgrading from 3.2 to 4.1 reports that include images in report columns. I have had good success with this except for one thing. If the height and width is fixed it distorts the photos, and if I do not have fixed dimensions the image may be too large depending on the original dimensions of the :P1_PHOTO item which is File Browse... BLOB column. I do not want to restrict users ability to upload large image files, or files with different dimensions, but I want them to display as a thumbnail size proportional to the original dimensions in the report, or maybe I need a different approach? Report region template is No Template. I appreciate any suggestions.
    select decode(nvl(dbms_lob.getlength(photo),0),0,null,'<img src="'||apex_util.get_blob_file_src('P1_PHOTO',id)||'" height="75" width="75"/>') photo from table.
    I tried using percent i.e.: width="10%" that does not work.
    I have tried several variations of <style> in page HTML header to change column width, but the image size does not change.
    <style>
    td[headers="PHOTO"] {
    width:75px;
    </style>
    <style>
    #apexir_PHOTO{width: 75px;}
    </style>
    Thanks.

    Try to go with max-width / max-height. However, if you have IE browser, hang on for pain. For some ideas, some links:
    http://wordpress.mfields.org/2011/scaling-images-in-ie8-with-css-max-width/ (ignore object-fit, it is not yet supported on most browser)
    http://stackoverflow.com/questions/3915219/max-width-on-img-tag-not-working-in-ie8
    etc. Be sure to try out your chosen solution on the target browser(s)!
    IE is just nasty :(
    What i have done before is not to have my browser scale my images, especially when the images can be large(r) and you expect quite some traffic. All those extra (kilo)bytes won't help it load faster. I just added an extra column in the table, like photo_thumb, and create a scaled version of the uploaded picture when it is being inserted.
    For example, i have the following process on my apex page, and i'm using wwv_flow_files.
    Have some code:
    IF :P3_FIND_PHOTO IS NOT NULL THEN
       DECLARE
         v_id number;
         v_small_photo blob;
         v_large_photo blob;
         v_mime_type apxt_contacts_img.mime_type%type;
         v_content_type apxt_contacts_img.content_type%type;
       BEGIN
          SELECT blob_content a, blob_content b, mime_type, content_type
          INTO v_small_photo, v_large_photo, v_mime_type, v_content_type
          FROM wwv_flow_files
          WHERE name = :P3_FIND_PHOTO;
          IF lower(v_mime_type) NOT IN ('image/jpg', 'image/jpeg') THEN
             raise_application_error(-20001, 'File for upload is not a jpg!');
          END IF;
          -- Rezise the photo so that it is proportionally 125*125
          -- ordimage is an oracle type able to manipulate all sorts of pictures
          ordimage.process(v_small_photo, 'maxScale=125 125');
          -- If contact is of type personnel, then no need to store
          -- a large photo since it wont be displayed
          IF :P3_CONTACT_TYPE_ID = 2 THEN
            v_large_photo := NULL;
          END IF;
          -- Delete previously uploaded picture
          IF :P3_ID IS NOT NULL THEN
             DELETE FROM apxt_contacts_img
              WHERE contact_id = :P3_ID;
          END IF;
          -- Insert the data into the contacts_img table as a
          -- SELECT from WWV_FLOW_FILES
          INSERT INTO apxt_contacts_img
          (contact_id,
           image_name,
           mime_type,
           content_type,
           filename,
           small_photo,
           large_photo)
          VALUES
          (:P3_ID,
           :P3_LASTNAME,
           v_mime_type,             
           v_content_type,
           :P3_FIND_PHOTO,
           v_small_photo,
           v_large_photo);
          -- Remove the image from the apex wwv_flows_files table
          DELETE FROM wwv_flow_files WHERE name = :P3_FIND_PHOTO;
       END;
    END IF;

  • Height and width of image loaded into blob?

    i am loading images into my database which is all working fine. in parts of my app i am displaying these images so i am wondering is there a way to get the dimensions (height an width) of the image you are loading in so that when it comes time to display you can scale as needed but the aspect ratio is the same so then the image is not distorted by just putting some random values for height and width.
    <br><br>
    eg
    instead of
    <br><br>
    select decode(file_type,'I','<imge src="OWNER.download_file?p_file=' || nvl(file_id,0) ||'" height="100" width="100" />','') from project_file
    where file_id = :P31_FILE_ID
    <br><br>
    i want to replace 100 with values from columns in table that were loaded at time of save
    Message was edited by:
    victorp

    thanks scott. is it correct to say that this example is storing the image at whatever size the user puts in the width and height boxes on screen? thats what it looks like to me anyway. i see there are functions to get these but does the user have to enter them still? it will be just what i need if indeed I do need it!
    Yes, that's correct. Of course you could modify the code so that you choose the size of the image, and not allow the user to change it.
    Thanks,
    - Scott -

  • Info panel/height and width

    When resizing or dragging a guide out the info panel or the height and width box dimensions ar enot live. They do not change until I let go so it is either guess or manually type in. is there a preference setting for this? If not what is the fix. Thanks!

    Well I am going to answer my own question if that is allowed. I know there are ratings and such for right answers but I figured out what was wrong/sort of. I closed out and rebooted then brought the program back up and ticked info in the window menu area and voila it is working. So a reboot has done the trick I think. 

  • How to keep anchor in middle while changing height and width for comp in extendscript?

    When i try to change my composition height and width using extendScript, it works but with anchor point at top left corner. How do I maintain it at the center??
    My code:
    comp.width = 4000;
    comp.height= 4000;
    result:
    expected:
    Thank you

    So you caught me on an open day, and I even dragged in another staffer (Josh) to sit and figure this out and we did. I just need to clean it up into a function for ease of use. It literally became an obsession between Josh and I to figure this problem out. We seriously need to get outside more, haha. I'll post the solution here shortly once it's cleaned.
    Is there a way to access layer's properties like position, rotation etc without its comp open or selected and not knowing its item number.
    Finding layers can be done by looping through all comps and all layers. You must set a series of matching criteria to compare against so you don't accidentally grab a duplicate layer that has the same values though. Usually the layer name, size or any property spec that is unique, source asset if it's an AVLayer, etc... It's also possible to have a list returned that you choose from if you wanna verify the layer before proceeding. All this has to be manually coded though.
    var comp = app.project.activeItem;
    var layer = comp.selectedLayers[0];
    //assuming layer is a comp
    layer.duplicate();
    var num = layer.index;
    var name = (layer.name + "_comp");
    var newComp=  comp .layers.precompose([Lnum], Lname, true);
    newComp.width =  4000;
    newComp.height =  4000;
    now what am trying to achieve is move the comp (layer) to the center of newComp i.e at 2000, 2000
    I'm not fully understanding the process you are intending. You are searching for precomps (comps used as layers) basically?

  • Diagram Optimize Shape Size Height and Width

    What determines the dimensions set by the Jdeveloper 11g menu option of Diagram.Optimize Shape Size.Height and Width while editing a Database Diagram ?
    I was hoping that this option resizes the dimensions of a box that represents a table to fully display all the columns, types and keys within the limits set by Tools.Preferences.Diagrams.Database.Max Compartment Entriesand Max Shape Width.
    I set
    Tools.Preferences.Diagrams.Database.Max Compartment Entries = 100
    Max Shape Width = 1000
    However, what I observe when using this option in a Database Diagram is that the box height is resized to show the first 15 column names and an ellipsis and the box width is less than the width of many of the column name rows.
    Does anyone else think this is a bug? If so, I will open an SR.

    Update:
    The limits set by Tools.Preferences.Diagrams.Database.Max Compartment Entries and Max Shape Width affect the default values for subsequently created shapes and not existing shapes.
    However, a Service Request has confirmed that changing the value for Max Compartment Entries has no effect. This behavior has been filed as a bug that will hopefully be fixed in the next release of Jdeveloper 11g.

  • How to change the height and width of a control?

    Dear all,
    is there anyway to change the height and width of a control?
     In the property nodes, i am just able to read the bound values but cudnt write to it.
    How can i set the bound values for a control?
    Thanks,
    Ritesh

    Not all controls can be sized this way. For example to change the vertical size of a simple numeric, you would need to change the font size.
    LabVIEW Champion . Do more with less code and in less time .

  • How to determine height and width of a JScrollPane client

    Hi,
    I wish to display a webpage in a JScrollPane and wish to determine the height and width of the HTML content so that I can use the information to generate PDF and control the content on each page. Can anybody let me know how I can do this?
    Thanks in advance
    Prashant Baj

    JEditorPane and getSize()?

  • How to create instant quote tool for website? Customer enters height and width and price is calculated.

    I am trying to create a instant quote tool for my site.. so customer type in there height and width and a price appears but I have no clue where to start.. is there any tutorial or would someone kindly give me some advice on how to do this on dreamweaver. I havent used Dreamweaver in years and I cant even remember anything now
    Kind Regards

    Well this is what I have soo far.. so I want to enter the height /width then if they want to add extras such as fixing options and cut out it will add to the product price ????
    <!doctype html>
    <html>
    <head>
    <div class="summary entry-summary">
            <h1 itemprop="name" class="product_title entry-title">Ral 1000</h1><div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
        <meta itemprop="price" content="160" />
        <meta itemprop="priceCurrency" content="GBP" />
        <link itemprop="availability" href="http://schema.org/InStock" />
    </div><div itemprop="description">
        <script src="https://apis.google.com/js/plusone.js" type="text/javascript">
    </script>
    <script type="text/javascript">gapi.plusone.go();</script>
    <p>6mm, low iron, toughened glass, PAR
    </div>
    <div class="shortcode-google-plusone"><div class="g-plusone"  data-size="standard" data-annotation="none"></div></div><!--/.shortcode-google-plusone-->
    </p>
    </div>
    <form class="cart" method="post" enctype='multipart/form-data'>
            <table id="price_calculator" class="simple_price_calculator">
            <tr>
            <td style="text-align:right;">
              </td>
    <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script>
    $(document).ready(function() {
    $('#width').keyup(function() {
    var height = $('#height').val();
    var width = $('#width').val();
    var price = (height * width / 1000000 * 325).toFixed(2);;
    $('.price').html('Product price: &pound;' + price);
    </script>
    </head>
    <body>
    <p><label for="height">Height (mm)</label>
    <input type="text" name="height" id="height">
    </p>
    <p>
    <label for="width">Width (mm)</label>
    <input type="text" name="width" id="width">
    </p>
    <p>
    </p>
    </body>
    </html>
        </tr>
    </table>
    <div class=" product-addon product-addon-add-fixing-option">
                <h3 class="addon-name">Add Fixing Option </h3>
        <p class="form-row form-row-wide addon-wrap-1738-add-fixing-option">
        <select class="addon addon-select" name="addon-1738-add-fixing-option">
                        <option value="">Select an option...</option>
                        <option data-price="5" value="silicone-adhesive-tube" >Silicone Adhesive Tube (<span class="amount">&pound;0.00</span>)</option>
                        <option data-price="5" value="screws-and-drill-holes" >Screws and Drill Holes (<span class="amount">&pound;6.00</span>)</option>
        </select>
    </p>
        <div class="clear"></div>
    </div><div class=" product-addon product-addon-add-extra-layer-multi-coloured-fine-glitter">
                <h3 class="addon-name">Add Cut Out and Notches </h3>
        <p class="form-row form-row-wide addon-wrap-1738-add-extra-layer-multi-coloured-fine-glitter">
        <select class="addon addon-select" name="addon-1738-add-extra-layer-multi-coloured-fine-glitter">
                        <option value="">Select an option...</option>
                        <option data-price="8" value="1" >1 (<span class="amount">&pound;25.00</span>)</option>
                        <option data-price="15" value="2" >2 (<span class="amount">&pound;50.00</span>)</option>
                        <option data-price="25" value="3" >3 (<span class="amount">&pound;75.00</span>)</option>
                        <option data-price="25" value="4" > (<span class="amount">&pound;100.00</span>)</option>
        </select>
    </p>
    </p><p class="price">Product Price: &pound;</p>
        <div class="clear"></div>
    </div><div id="product-addons-total" data-type="simple" data-price="160"></div>
            <input type="hidden" name="add-to-cart" value="1738" />
            <button type="submit" class="single_add_to_cart_button button alt">Add to cart</button>
                </form>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    </head>
    <body>
    </body>
    </html>

  • How to resize the calendar height and width

    Hi,
    how to re size the calendar height and width...
    Ie i need to fix this calendar region  7 cross 4 format in my page
    Regards,
    Pavan

    If the text exceeds the container, which can happen in a scrollable container where you have to scroll to see some of the text, then the values getContentBounds returns are estimated values. This is because we don't want to force the text to recompose all the way to the end of a very long TextFlow in order to return a value. However, if you want to get the exact amount, and don't mind taking the time to recompose, call textFlow.flowComposer.composeToPosition(), before calling getContentBounds. This forces all the text to recompose to the end, and then getContentBounds will return the fully calculated value instead of estimating.

  • What is the maximum height and width for bitmap files in Flash?

    I'm trying to import a huge game race track 8000 x 7000, and I'm having problems.  Any tips?
    Thanks!

    Thanks Kglad,
    What is the height and width max for objects on the stage in Flash Pro?  I have a large track I've created, 7728 by 6051, I can't see all of it on the stage, and when I try to set its x and y position i get an invalid error.

Maybe you are looking for

  • Can only start up in safe mode

    mac g5 running tiger can only start up in safe mode I already ried the following:  zap pram//  open-firmware startup// repair permissions//  turned off all startup items//  disabled automatic login//  tried booting from startup disk//  started up in

  • Can't find Boot Camp on my leopard install DVD

    I upgraded to leopard when it came out. I have the leopard DVD install disc. I can not find Boot Camp to install it. I also can not find the boot camp install assistant on my computer or on the disk. Please help, I need to install xp badly and ASAP!

  • IChat Connection Error -- weird reason?

    Hello, I have successfully video chatted before on multiple occasions, but for some reason, when trying to iChat now, i am unsuccessful and this error message shows up. I never am able to connect with the other party, and it has gotten kind of annoyi

  • Performance Counters in Oracle Data Provider Version 11

    Hi, I'd like to be able to monitor some of the new Oracle performance counters added in ODP Version 11. What do I need to do to make these performance counters visible in Windows Server 2003's Performance Monitor? Do I: - upgrade my ODP install to ve

  • SAP BI online backup recovey

    Hi experts, We need to make an online bakup of our BI system. But we had some infopackages that ran after the online backup, so the delta timestamps in ECC are greater than the timestamp of the backup. Do you know if after the recovery of the BI onli