Ask a Question related to Coldfusion Flash Integration, Design and Development.
-
prasanth25 #1
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
-
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:... -
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... -
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... -
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... -
[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... -
karlkrist #2
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
-
karlkrist #3
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
-
GArlington #4
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
-
karlkrist #5
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



Reply With Quote

