Multi-filter rtmp live push stream based on Gpuimage

Source: Internet
Author: User

Previous open-Source Videocore improvements: 1) added a beauty filter; 2) added the librtmp to replace the original too simple rtmpclient;

Later listen to friends said, in Videocore above OpenGL modification, add new filter More trouble, iOS filter best to calculate gpuimage.

I decided to the multi-filter open-source gpuimage to achieve the rtmp live streaming push;

Implementation of the scenario:

1,gpuimagemoviewriter the output of the RGBA video data.

By rewriting the Gpuimagemoviewriter, we implement an agent protocol Pixelbufferdelegate, and speak the output of the RGBA video data after the GPU filter is encoded;

Self.moviewriter = [[Gpuimagemoviewriterex alloc] Initwithmovieurl:movieurl size:cgsizemake (360.0, 640.0)];

Self.movieWriter.encodingLiveVideo = YES;

Self.movieWriter.pixelBufferdelegate = self;

2, initializing the encoding and RTMP module

Self.rtmpsession = [[Vcrtmpsession alloc] Initwithvideosize:video_size_cif fps:25 BITRATE:BITRATE_CIF];

[Self.rtmpsession startrtmpsession:@ "rtmp://192.168.1.104/live/123456"];

3. Set the desired gpuimage filter

Self.filter = [[Gpuimagebeautifyfilter alloc] init];

[Self.videocamera AddTarget:self.filter];

Now you can use the Gpuimage-based rtmp push stream,

GitHub Code Address: Https://github.com/runner365/GPUImageRtmpPush

Multi-filter rtmp live push stream based on Gpuimage

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.