gsvideo: some advice needed
in
Contributed Library Questions
•
3 years ago
Hi :)
For an upcoming project, I want to implement "live streaming" using GSVideo. I'm developing on a Mac, but the application should run on Windows as well. The goal is to stream a webcamfeed to iDevices (iPhone, iPad, etc).
Capturing the webcamfeed and converting it to an MPEG-TS file is working. For live streaming to work properly, the MPEG-TS file needs to be segmented into smaller files (plus an M3U8 index file).
There's several roads I can walk for this:
- use Apple's mediastreamsegmenter commandline tool:
- pros: it works
- cons: it works on Mac OS X only (but there are Open Source implementations which I could perhaps use); it's difficult to package everything (both the Processing parts and the mediasegmenter) into a proper app; not sure how to connect GSVideo with the separate segmenter executable;
- use GSVideo to segment the output:
- pros: seems to be a best and cleanest solution (no need to fork a separate executable, no need to use temporary files)
- cons: how? I haven't been able to make this work: my first idea was to setup a GSPipeline writing a file, and every X seconds close the pipe and start a new GSPipeline() for the next outputfile; this doesn't seem to work properly (memory usage grows for each new pipe so my Mac starts swapping pretty fast);
BTW, this is the GSPipeline I'm using:
- osxvideosrc | video/x-raw-yuv, framerate=30/1,
- width=640, height=480 ! ffmpegcolorspace ! videorate ! x264enc ! mpegtsmux !
- filesink location=/tmp/output.ts
I'd be grateful for any useful tips and pointers on how to implement this :)
Regards,
Robert
1