Ruddle / RemoteCam

Your android camera streamed on your desktop: use as a source for OBS, or as a webcam with v4l2. Free✅, No Ads✅, Open Source✅
MIT License
477 stars 55 forks source link

Win10 can't download mjpeg stream as mp4 using ffmpeg #5

Closed 1506085843 closed 1 year ago

1506085843 commented 1 year ago

I use the Windows 10 operating system, I copied the ip address in the app and opened it on my computer's browser and it worked fine,and I use the following command in the cmd window: ffmpeg -i http://192.168.1.100:8080/cam.mjpeg -c:v libx264 -crf 23 output.mp4

20230824093239

It can't save the mjpeg as an mp4 video, I just get a 25kb output.mp4, it's not able to play, it's just a frame.

How should I operate so that the video shot on the mobile phone can be transmitted to the computer in real time and saved as mp4 ?

Ruddle commented 1 year ago

If I were you I would just use OBS to receive the stream, and use its UI to record. In the Readme you will find the right settings to receive the stream. I am sure there is an ffmpeg command that would work though, but I am no expert.

Ruddle commented 1 year ago

Ah ! can you try to add -f mjpeg to your command? : ffmpeg -f mjpeg -i http://192.168.1.100:8080/cam.mjpeg -c:v libx264 -crf 23 output.mp4

1506085843 commented 1 year ago

Thanks a lot, the command you provided above it worked! Now ffmpeg is indeed able to save mjpeg streams to mp4. But your project only supports video now? Do you consider transmitting the sound through the mobile phone, so that I can get the mp4 video with sound through the following ffmpeg command: ffmpeg -f mjpeg -i http://192.168.1.100:8080/cam.mjpeg -i /dev/video0 -c:v libx264 -crf 23 -c:a aac -b:a 128k output.mp4

liwenz commented 1 year ago

my obs can't show, but browse is ok my obs is diferent with yours.

camwifilobs camwifilbrowse

Ruddle commented 1 year ago

Careful only the last client gets a feed. You should close the browser tab and only open the OBS source. If it is not that, the problem on your OBS side.