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