Home > Articles > How to encode video to flv on your server side with ASP, ASP.net, PHP
How to encode video to flv on your server side with ASP, ASP.net, PHP
2009-10-12 07:26:19

Flash Video MX SDK V2 is an application to create Flash (SWF), Flash video (FLV) and AAC/H.264 MP4 video from almost all video formats. Free to download Flash Video MX SDK (Windows Version)MX SDK consists of two interfaces: Command Line and COM, thanks to which it can be used under a great range of programming languages like: Visual C++, Visual Basic, .Net, ASP, Delphi, PHP, ColdFusion, etc.

 

Encode video to Flash with Visual C++, PHP, ColdFusion, ASP, ASP.net ...

This program is widely used in server applications to automatically convert videos in virtually any format to FLV, AAC/H.264 MP4, SWF for a video sharing website construction like that of YouTube, Google Video, Yahoo!Video, Daily Motion, MySpace, etc. It is also widely adopted by multimedia applications for its video to FLV, AAC/H.264 MP4, and SWF conversion. Then, how does MX SDK V2 work? How to create an FLV, AAC/H.264 MP4, and SWF with this SDK? While with its set of functions like video editing for a better visual effect, text and image watermarking, Flash 8 encoding, Flash 8 alpha video encoding, processor locking, processor priority, interactive mode, and video cropping and trimming, etc, it is easy to command. Then, how does MX SDK V2 work? How to create an FLV, AAC/H.264 MP4, and SWF with this SDK? As long as you are moving on following exactly what the "Help document" integrated in the program, you are sure to make it. The following is a rough demonstration of conversion from myvideo.avi to myflv.flv. Source video: myvideo.avi Path: D:Documents and SettingsyukiDesktop Target flv: myflv.flv Path: E:myflv.flv Target SWF: myswf.swf Path: E:myswf.swf OK, start and run the application: Type in the command: flashvideomx 's "D:Documents and SettingsyukiDesktopmyvideo.avi" "E: myflv.flv", and press "Enter" to start the conversion. Convert the output myflv.flv to myswf.swf: Type in the command: FLV2SWF "E: myflv.flv" "E: myswf.swf", and press "Enter" to launch the FLV to SWF conversion. The command lines above are basically for conversion, and a lot of advanced functions can be realized by more command lines:

1. Convert a video file to FLV with the original dimension and frame rate: flashvideomx -s myvideo.avi myflash This command is to convert myvideo.avi to myflash.flv.

2. Convert a video file to FLV with settings of output dimension, video bit rate, frame rate, audio sample rate, audio bit rate and audio channel: flashvideomx -s myvideo.avi myflash -vs 320x240 -vbr 400000 -abr 64000 -asr 22050 -ac mono -vfr 25 This command is to convert myvideo.avi to myflash.flv with 320x240 as dimension, 400kbps as video bit rate, 64kbps as audio bit rate, 22050Hz as audio sample rate, monophonic channel and 25fps as frame rate.

3. Add a LOGO image to the video: flashvideomx -s myvideo.avi myflash -l "mylogo.jpg" -ls 100x100 -la_origin 0 -la_off 10:10 -lt 0:10000 -lt e-10000:10000 This command is to stretch mylogo.jpg to 100x100 in dimension and show the image when the video starts to play and last 10000 milliseconds, and show the image again when there are still 10000 milliseconds to the end of the video, and last 10000 milliseconds with the coordinate (10,10). flashvideomx -s myvideo.avi myflash -l "mylogo.jpg" -ls 100x100 -la_origin 0 -la_off 10:10 This command is to stretch mylogo.jpg to 100x100 in dimension and show the image from the beginning to the end of the video with the coordinate (10,10).

4. Add characters to the video: flashvideomx -s myvideo.avi myflash -t "Text to show on video" -ta_origin 0 -ta_off 0:0 -lt 0:10000 -lt e-10000:10000 It is to show "Text to show on video" in the top left corner and show the characters when the video starts to play and last 10000 milliseconds, and show the characters again when there are still 10000 milliseconds to the end of the video, and last 10000 milliseconds. flashvideomx -s myvideo.avi myflash -t "Text to show on video" -ta_origin 0 -ta_off 0:0 -tff "Times New Roman" -tf_style 0 -tf_size 24 -tfe 0 -tfc FF0000 -tfa 80 >It is to show the semi-transparent characters "Text to show on video" in the top left corner with "Times New Roman" as font, "24" as size, "FF0000" as color (red).

5. Sequence several videos into one file: flashvideomx -s headervideo.avi -s myvideo.avi -s tailervideo.avi myflash It is to connect headervideo.avi, myvideo.avi, and tailervideo.avi together and convert them to one file: myflash.flv

6. Replace the audio data in the video file: flashvideomx -sv myvideo.avi -sa myaudio.mp3 myflash It is to replace the audio data in myvideo.avi with myaudio.mp3, and then convert to myflash.flv.

7. No audio: flashvideomx -s myvideo.avi myflash -i v This command is to generate an FLV file without audio data.

8. No video: flashvideomx -s myvideo.avi myflash -i a This command is to generate an FLV file without video data.

9. Get thumbnail picture: flashvideomx -s myvideo.avi myflash -gp mypic.jpg -gp_size 120x120 This command is to convert myvideo.avi to myflash.flv, and generate a random mypic.jpg in size 120x120 as the thumbnail picture. flashvideomx -s myvideo.avi myflash -gp mypic.jpg -gp_size 120x120 -gpt 60000 This command is to convert myvideo.avi to myflash.flv, and generate pictures in mypic.jpg with the size of 120x120 in dimension in the given 60000 milliseconds. flashvideomx -s myvideo.avi myflash -gpw 10:mypic??.jpg -gp_size 120x120 This command is to convert myvideo.avi to myflash.flv, and capture 10 pictures in 120x120 dimension as: mypic01.jpg, mypic02.jpg, ..., mypic10.jpg.

10. Convert the video to FLV with time trimming: flashvideomx -s myvideo.avi -st 0:300000 myflash This command is to convert myvideo.avi with 300000 milliseconds from the starting point of the video into myflash.flv. flashvideomx -s myvideo.avi -st 0:300000 -st e-300000: 300000 myflash This command is to convert the two video parts in myvideo.avi to myflash.flv. One is the part from the start point to the 300000ms point. The other part is the one from the point 300000ms before the end point to the end point.


Replay
Leave a Reply
 

 
Copyright © 2009 - 2017 bigbigsoft.com. All Rights Reserved.