mpp icon indicating copy to clipboard operation
mpp copied to clipboard

Stream and record video at the same time by ffmpeg

Open tranhien1612 opened this issue 9 months ago • 2 comments

Hi, i am using the OrangePi5Plus and a camera to stream video via RTSP and record video by ffmpeg. The camera has /dev/device0.

With stream video via RTSP, i used mediantx and ffmpeg with mediantx_custom.yml file:

paths:
  stream:
    runOnInit: ffmpeg -f v4l2 -i /dev/video0 -c:v libx264 -preset ultrafast -b:v 600k -f rtsp rtsp://localhost:8554/stream
    runOnInitRestart: yes

And i record video by command:

ffmpeg -f v4l2 -input_format nv12 -video_size 640x512 -framerate 30 -i /dev/video0 -c:v libx264 -preset ultrafast -tune zerolatency -b:v 5M output.mp4

When i run one fuctions, the /dev/video is busy, so i don't run the next fuction. I don't know how to run 2 functions at the same time. how can i do 2 tasks at the same time? Pls, help me solve this problem!

tranhien1612 avatar Mar 06 '25 08:03 tranhien1612