I am looking for a python script to be created. This project is for a raspberry pi 2 that is currently using raspvid to caputre video and pipe the output to gstreamer1.0. I would like to combine or duplicate the raspvid output to an ffmpeg pipe also.
Here is the scenario
command
raspivid -t 0 -w 1080 -h 720 -fps 30 -b 1700000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay ! udpsink host= {raspberrypi local IP address} port=9002 \ ! udpsink
This command will send excellent video to a client on the lan with gstreamer installed.
client command
gst-launch-1.0 udpsrc port=9000 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink
The second part of this will be to combine the output of raspvid and also send or "pipe" the output to ffmpeg.
Working ffmpeg setup (viewed on local host apache webserver)
ffmpeg -i - -vcodec copy -an -f flv -metadata streamName=myStream tcp://0.0.0.0:6666
Client end visits local ip address on LAN of raspberry pi and jwplayer servs the webpage.
I tried using raspvid to start the raspberry pi camera and "TEE" the video output to both ffmpeg to view on the webserver and through the gstreamer client with no luck.
This python script would use the Picamera library in python to split the cameras ouput and provide gstreamer with video input and ffmpeg with input as well. The goal is to have the script take input from raspvid and pipe the video output to both ffmpeg and gstreamer.
Picamera is thought to be the best library to handle the camera though full python control. Also, the script should be able to take arguments to adjust raspvid output/ffmpeg parameters and gstreamer parameters.
------> gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay ! udpsink host= {raspberrypi local IP address} port=9002 \ ! udpsink
camera ---> raspvid video output
------> ffmpeg -i - -vcodec copy -an -f flv -metadata streamName=myStream tcp://0.0.0.0:6666
(Please open above text in notepad and expand to see diagram)