The H264 video stream and AAC audio stream have been synthesized by hand recently, but there is no open source FFmpeg API to handle audio and video streaming. The method is to imitate ffmpeg in the libavformat/flvenc.c file write code to complete the audio and video of the FLV format encapsulation. In this package process, the FLV file format needs to be very clear. There is a lot of information on the
Article Title: Build a flv Streaming Media Server using nginx. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
I,
Introduction to FLV video publishing methods
There are two methods to publish FLV videos.
1,
HTTP
In t
Server | solution | upload
FLV format files cannot be played after uploading servers because most of them are Win2003 hosts. Default is not specified output FLV This format, although it can be seen in the FTP, but not through HTTP access, it can not play.
[ Reason:WIN2003 has tightened IIS6 mime verification, and all unregistered extended file formats show 404 errors. Manually add a MIME mapping relationsh
During this period of time, the work needs are converted from FLV stream to standard h264 and aac on rtmp. The server is an open-source project crtmpserver, client flex writing, video encoding h264, and audio encoding AAC, some protocol-related items are recorded as follows.
1. Analyze FLV data
Let's take a FLV file to analyze the
. RedirectStandardOutput = true; // redirect standard outputP. StartInfo. RedirectStandardError = true; // redirect error outputP. StartInfo. CreateNoWindow = true; // you can specify not to display a window.
P. Start ();// P. StandardInput. WriteLine (command); // you can also use this method to export the command to be executed.// P. StandardInput. WriteLine ("exit"); // you must remember to add Exit. Otherwise, the next line of program will become available.
// You must create the code that e
FLV MP4 makes it easy to transfer downloaded video from the network to mobile hardware, MP4, IPod, IPhone, PSP, PSV, PS3, ipad, and so on. Given the need for FLV MP4 to be compatible with mobile devices, in the FLV MP4 process, conversion speed, conversion quality and good compatibility on mobile hardware are undoubtedly some of the most important aspects of the
This time, the work of the need, on the rtmp to do the FLV stream to the standard H264, AAC conversion, the server is open source project Crtmpserver, client flex writing, Video coding H264, Audio coding AAC, now some of the agreements related to the following things record.
I. Analysis of FLV data
Let's take an FLV file to briefly analyze the format of the
rtmp/flv Learning points of attention
1.RTMP and FLV format-friendly compatibility, mainly embodied in the RTMP package playable audio and video streams, when carefully studied, you will find that the RTMP packet in the package of audio and video data flow, in fact, and Flv/tag package the way the video data is the same, so, We just need to follow the
During video projects, videos are generally converted to the FLV format for playback, and videos are displayed during uploads. For convenience, C # (Asp.net) is provided to upload videos to the FLV format andCode.
The following code adds a video:
String filename = publicmethod. getfilename (_ FILES [I]. filename); // getfilename ();String upfilename = server. mappath (publicmethod. upfile + filename );_
Http://itindex.net/detail/48702-nginx-rtmp-http
One, streaming media playback mode
1. HTTP mode
this way to download the FLV video file to local playback, once the FLV video file download is complete, will not consume the server resources and bandwidth, but the drag function is not rtmp/rtmp streaming media powerful, many video sites are implemented in HTTP, such as: YouTube, potatoes, Cool 6 etc
2, rtmp
)--------------------------------------------------------------------------------------------------------------- ----------------------------------------1. Installing zlibTar xzvf zlib-1.2.3.tar.gz #解压 cd zlib-1.2.3 #进入解压目录 ./configure #配置 make make install #编译并安装2. Installing gcc-c++Yum-y install gcc-c++ #会自动安装的, but requires networking4. Installing PcreTar zxvf pcre-7.9.tar.gz cd pcre-7.9./configure--prefix=/usr/local/pcre #配置安装路径为/usr/local/pcre make ma Ke Install5. Installi
The full name of the FLV video is Flash, which is not the same as Flash and uses a different player. In order to improve the classroom effect, we often download various resources from the Internet to enrich the courseware content when making courseware. Most are in FLV format video files, but many people do not know how to insert multimedia software PowerPoint. Today, the Waves Ripple Computer knowledge Lea
Tips | media
The FLV streaming Media format is a new video format, all called flash videos. Flash MX 2004 provides the perfect support, its appearance effectively solves the video file import Flash, makes the exported SWF file bulky, cannot use on the network very good shortcoming. Here's how to use the compact FLV streaming media file.
I. Establishment of FLV
of Nalu (nal_unit_type) Description: #define NALU_TYPE_SLICE 1#define NALU_TYPE_DPA 2#define NALU_TYPE_DPB 3#define NALU_TYPE_DPC 4#define NALU_TYPE_IDR 5#define NALU_TYPE_SEI 6#define NALU_TYPE_SPS 7#define NALU_TYPE_PPS 8#define Nalu_type_aud 9#define NALU_TYPE_EOSEQ 10#define Nalu_type_eostream 11#define Nalu_type_fill 12 Each Nalu the first byte 0x1f can derive its type, such as the first nalu:67 0x1f = 7, then this unit is an SPS, the third: the 0x1f = 8, This unit is PPS, so look at the
FLV is the short name of Flash video, which is a good visual format. The advantage of FLV format video, compared to SWF format, is that the resulting files are small, load fast, and can be played while loading.
If you are a stand-alone server, you can add the following MIME mapping relationship in the MIME type of the Web site HTTP header in IIS:
MIME type: video/x-fl
PHP implementation to obtain the FLV File time. PHP implementation of FLV file acquisition time this article mainly introduces the PHP implementation of FLV file acquisition time, this article directly provides the implementation code and use method, for more information about how to obtain FLV files in PHP, see
This
For FLV types:How to: Open Internet Information Services Manager (IIS (Microsoft Web server Platform)), select Local Computer--> user site--> Open Properties--> "HTTP headers"-- > "MIME Type"--> "new". Extension = ". flv" MIME type = "Flv-application/octet-stream", save exit.Method Two: Select "Local Computer"--> user site--> Open "Properties"--> "HTTP Headers"--
Files in FLV format cannot be played after being uploaded to the server because most of the hosts in China are Win2003. The FLV format is not specified by default. Although it can be seen in FTP, it cannot be accessed through http, it cannot be played.[Cause: IIS6 MIME verification is enhanced in WIN2003, and Error 404 is displayed for all unregistered extended file formats. Manually add the MIME ing relati
Recently made a RTMP transit service program, through the practice, familiar with rtmp play and push in various formats, summarized here.Program GitHub Address: Https://github.com/runner365/rtmp_relayRTMP Play Receive Message analysisMessage received at first frame:1) 0x46 4c: Refer to the following article:Character FLV Header2) 0x01 05Version typeflagsreserved Typeflagsaudio typeflagsreserved typeflagsvideoWhen this is resolved, it is generally not
This article describes a C # implementation of a method by ffmpeg from an FLV video file. Share to everyone for your reference. The specific analysis is as follows:Need to download FFmpeg first, this is open source, the code is as follows: The code is as follows:Using System; Using System.Configuration; public class PublicMethod:System.Web.UI.Page { Public Publicmethod () { } File path public static string ffmpegtool = "Ffmpeg/ffmpeg.exe"; public stat
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.