I’m trying to stream from a Raspberry Pi Zero 2 W using the ov5647 camera and a usb microphone (lavalier).
I can get both streams running independently but I’m running into issues combining them because of timestamp issues.
I’m currently using ffmpeg but I have gstreamer installed too (although I haven’t really touched it yet).
Currently I’m recording using rpicam-vid and piping it directly into ffmpeg and then trying to have ffmpeg combine everything. If my understanding is correct, rpicam-vid does not include timestamps on h264 recordings so ffmpeg can’t combine the audio from my usb microphone. I’m trying to test by recording to a file and then watching it back. I can see the audio, but there’s no video.
rpicam-vid -t 0 -o - | ffmpeg -f alsa -ac 1 -ar 44100 -i plughw:0,0 -f h264 -i - -c:v copy -c:a aac test.mp4
I want to try to avoid reencoding things as much as possible since there’s not a lot of compute power on the raspberry pi zero. I’ve tried adding timestamps in ffmpeg with -flags +genpts (this wasn’t successful). I also tried using wallclock for timestamps (also didn’t yield results).
Any ideas on how I might be able to do this? I feel like I’m missing something here.