Recommend way to write module to do expensive job

hungnv at opensource.com.vn hungnv at opensource.com.vn
Fri Mar 6 10:49:50 UTC 2015


Hello again, 

I tried to modify our lib to make write job more efficient. At this time current lib can do this: 




When user request a file, nginx will pass request to intermediate lib (after doing some check), then the libraries will do very expensive job, read the input, process the video. But during processing phase, it will write output which is the data that can be read by browser to temp buffer, and append to output buffer (which is ngx_buf_t). The problem is at current state, I just can send response to client when the output buffer was completely filled, which takes a lot of time. But if I can write output to socket just after intermediate library write to temp buffer, it will be much faster. 

Is there any way to do this? 


--
Hưng
Email: hungnv at opensource.com.vn



> On Mar 5, 2015, at 3:48 PM, hungnv at opensource.com.vn wrote:
> 
> Hello, 
> 
> We are about to write a module that’s similar to image filter module, the difference is image filter module processes JPEG, PNG… format, we work on video file, so it’s much bigger and video processing is too much longer. 
> 
> As in nginx mp4 module ( we use h264) too, client just need to receive moov atom data to start playback, my module should be able to produce moov atom and send those bytes to client while processing other part of video file. Maybe I ask is there any recommend way to do this? 
> 
> Thanks.
> 
> --
> Hưng
> Email: hungnv at opensource.com.vn
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20150306/9fe9b6d5/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IMG_3549.JPG
Type: image/jpeg
Size: 2125010 bytes
Desc: not available
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20150306/9fe9b6d5/attachment-0001.jpe>


More information about the nginx-devel mailing list