I´m trying to connect my ip camera with Youtube using ffmpeg to convert the stream from RTSP to RTMP.
rtsp_url="rtsp:/xxxxxx"
rtmp_url="rtmp:/xxxxxx"
ffmpeg -rtsp_transport tcp -i $rtsp_url -tune zerolatency -vcodec libx264 -pix_fmt + -c:v copy -c:a aac -strict experimental -f flv $rtmp_url
This works fine, but I have several problems that I don't know how to solve.
rtsp_url="rtsp:/xxxxxx"
rtmp_url="rtmp:/xxxxxx"
ffmpeg -rtsp_transport tcp -i $rtsp_url -tune zerolatency -vcodec libx264 -pix_fmt + -c:v copy -c:a aac -strict experimental -f flv $rtmp_url
This works fine, but I have several problems that I don't know how to solve.
- Sometimes, for different reasons, I lose the connection with the camera: stoppage during the night, coverage problems... and I don't want the process disconnect from Youtube. How could I do it? Could I put a default image while there is no connection to the camera?
- The last question would be. How can I guarantee that the Youtube player id associated with the process is always the same. It is quite inconvenient to have to update the player every time there is a connection problem.