Video file (.flv) and CF

Ask a Question related to Coldfusion Flash Integration, Design and Development.

  1. #1

    Default Video file (.flv) and CF

    Hi,
    Is there any method to find the resolution or dimensions of a Video file using
    CF. The video format is FLV. Since am dealing with only FLV files for now -
    finding the dimensions of a Flash file can also solve the issue. I am in an
    emergency situation and I need a solution ASAP.

    Thanks in Advance,
    Prasanth


    prasanth25 Guest

  2. Similar Questions and Discussions

    1. Finding video-file URLs in decompiled Flash video
      Hi, My department in a research library archives Web sites. This involves downloading all the files that are necessary to reconstruct a Web site:...
    2. file flow or video
      Hi I want to make the I calculate of a Hosting of my you paginate I have files in flash that are of video I want to know the quantity of...
    3. Director Video Vs Flash Video [file size]
      I am a flash application developer. I just encode video into flv and integrate video with flash. This method decreases the file size of video also...
    4. Linking video file
      Jack k. wrote: Did you set the propertie to streaming, cause I think that the swif wait until the video is completly load into the ram that why it...
    5. [Video CD] Problems with .mpg file
      Hi there! I have a Muxed MPEG1, 320 x 240 file that Toast 5.2.1 does not accept to be burned as VCD. (error message says: xxx.mpg cannot be used...
  3. #2

    Default Re: Video file (.flv) and CF

    I have been searching for the same exact thing. Any solutions would be greatly appreciated!

    ..swf is easy- just can't figure out how to do this for a .flv.

    Karl
    karlkrist Guest

  4. #3

    Default Re: Video file (.flv) and CF

    I figured out how to do this.

    I am writing up an entire article about it, but in the short term feel free to e-mail me at [email]kakrist@ucdavis.edu[/email]


    karlkrist Guest

  5. #4

    Default Re: Video file (.flv) and CF

    Hi,
    Did you succeed in doing that? If yes, could you share your findings for .flv AND .swf
    Thanks.
    GArlington Guest

  6. #5

    Default Re: Video file (.flv) and CF

    I was going to write a longer page about this, but putting the info up here NOW
    is probably better than waiting until it gets pretty.

    First, you need to have ffmpeg.exe on your server. It does not need to be
    'installed', you just need the file to be available.

    Here is the code that will use it. I hope it is fairly well explained. Much
    of it only works on my server of course, but you can figure that part out.





    <!---create the batch file that will be run to determine the height and width
    My server has a 'filenum' variable that is actually the file name of the flv.
    You will want to replace that with your file name--->
    <cffile
    action="write"
    file="d:\websites\media\flvinfo#filenum#.bat"
    output="d:\websites\media\ffmpeg.exe -i #linkpath#\#trim(filenum)#.flv 2>
    d:\websites\media\file#filenum#info.txt">

    <!---now execute the file just created. This will create a .txt file to use
    to get the information. Also, if you just try to execute the batch file
    directly, it won't work. You need to go through cmd.exe--->
    <cfexecute
    name="c:\windows\system32\CMD.EXE"
    arguments="/C d:\websites\media\flvinfo#filenum#.bat">
    </cfexecute>

    <!---we need to put coldfusion to sleep for a while, to let ffmpeg do its job,
    otherwise you will always find that the text file created by ffmpeg is not
    available--->
    <cfset thread = CreateObject("java", "java.lang.Thread")>
    <cfset thread.sleep(5000)>


    <!---read in the text file that was created by ffmpeg--->
    <cffile action="read" file="d:\websites\media\file#filenum#info.txt"
    variable="spewer">




    <!---find the pattern of two numbers, an 'x' then two more numbers
    These are the dimensions of the file there are no other items that will match
    this pattern, so this is safe--->
    <cfset johnson=refind("[0-9][0-9]x[0-9][0-9]", spewer)>


    <!---grab the 4 characters before the x, the x itself, then the 4 characters
    after
    Essentially this will be:

    1240x1000

    But sometimes the numbers will be 2, or 3 digits, but grab the whole thing--->

    <!---if this does NOT work, then set the size to 500px by 400px
    .flv files created by some applications will not have the dimensions in the
    header--->



    <cftry>


    <cfset jonesy=mid(spewer, val(johnson-2), 9)>


    <!---take the value of the last 4 digits for the width this will always
    end up with a number--->
    <cfset flvheight=val(mid(jonesy, 6, 4))>

    <!---to get the first number, we just need to isolate the first 4
    characters. But find out if there is a space, just in case this is less than 4
    digits--->
    <cfset flvwidth=left(jonesy, 4)>
    <cfset flvspace=find(' ', flvwidth)>
    <cfset flvwidth=right(flvwidth, val(4-flvspace))>


    <!---set this as the default, this works with the swf file I use to display
    the flv--->
    <cfcatch>
    <cfset flvwidth=500>
    <cfset flvheight=400>
    </cfcatch>
    </cftry>


    So now you have the flvwidth and flvheight variables...



    karlkrist Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139