Transmits data from a media transcoding queue to FFMPEG for video encoding.

Source: Internet
Author: User

Compile ffmpegin windows. Generally, mingww.msys. compile the windowsexecutable file ffmpeg.exe.

When I read the FFMPEG source code, I found that FFMPEG supports pipe. In other words, the input file parameters and output file parameters transmitted to the ffmpeg.exe process do not need to be the hard disk file path. The entire process can be completed directly in the memory.

Test method:

1. Use VC to call createnamedpipe to create a named pipe. Note that the opened space must contain at least one frame of data.

2. Call connectnamedpipe to connect to the named pipe.ProgramWill be suspended until a process connects to the named pipe.

3. Open the command line, go to the FFMPEG directory, and enter the command line:FFmpeg-F rawvideo-pix_fmt rgb24-s 320x240-I-f Avi-s 320x240 C: \ out. Avi

4. When the VC process is awakened, The FFMPEG process suspends and waits for the image data to be written. The VC process calls writefile to write image data to the named pipe. (Note that the written data format must be the same as the parameters passed in by the command line)

5. When the named pipe is written to data, FFmpeg automatically wakes up for encoding. After encoding, it continues to wait for the next frame of data.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.