I use DDMS to get screenshots from my Android phone and I need an efficient way for converting them in video and streaming the video over the network.
I have a RawImage which is filled with the data of the screenshot:
RawImage mRawImage;
Until know I use SWT to create the image and save it:
PaletteData paletteData = new PaletteData(
mRawImage.getRedMask(),
mRawImage.getGreenMask(),
mRawImage.getBlueMask());
ImageData imageData = new ImageData(
mRawImage.width,
mRawImage.height,
mRawImage.bpp,
paletteData,
1,
mRawImage.data);
ImageLoader s = new ImageLoader();
s.data = new ImageData[] {imageData};
s.save("temp.jpg",SWT.IMAGE_JPEG);
- Can you propose a way to convert those images sequence to video and then stream the video?
I found NanoHTTPD which can be used for streaming but how can I convert and compress the images to video?
- Do you believe that I can do that using ffmpeg?
I found a good Tutorial for streaming your webcam using FFMPEG and video4linux2
.
Is it possible to send the bytes
from the RawImage
to the FFMPEG to be converted to a live video stream?
Actual code:
$ffmpeg -f video4linux2 -i /dev/video0 http://78.47.18.19:8090/cam1.ffm
Replace it with something similar to:
$ffmpeg -f video4linux2 -i **<add here java stream>** http://78.47.18.19:8090/cam1.ffm
Any suggestions?
Thanks
PS: I expect a solution which will help me convert the images to a compressed video and then stream the video over the network in order to play it with either HTML5 or a Flash Player