Pexeus / LTE-Car

42 stars 11 forks source link

Streaming error USB camera #14

Open UshnaGul opened 4 months ago

UshnaGul commented 4 months ago

I have a usb camera that isn't directly identified as a camera by the pi but it streams on /dev/video0. I updated the command to the following: ffmpeg -f v4l2 -framerate ${fps} -video_size ${config.video.width}x${config.video.height} -i /dev/video0 -c:v libx264 -preset ultrafast -b:v ${bitrate} -tune zerolatency -pix_fmt yuv420p -f mpegts udp://${config.host}:${config.port_udp}

I am able to test it using the ffplay command but I am not able to see the video feed on the website. The data is being transmitted and i can see the fps and bitrate in the corner of the screen.

fantasaga commented 4 months ago

Try installing fswebcam to see if your USB camera works: sudo apt-get install fswebcam and test your webcam: fswebcam image.jpg and see if anything shows up in your home directory.

UshnaGul commented 4 months ago

The camera works fine. I have used VLC player and ffmpeg command to test it already. I can play the stream over a network using ffplay on the remote computer. I am not sure if the output format is correct for the video decoder used in this project :(

Pexeus commented 4 months ago

I honestly have no idea whats the problem. I really just messed around with the decoder until it started working. the FPS/Bitrate is calculated outside the decoder so that would make sense. Maybe just try and find another decoder and build that one into the client