6

I've been lurking for a while now and I finally created an account because I'm stuck on this particular problem. I've got a raspberry pi 3 with a camera attached to it. I'm able to capture video as an input but I don't know how to include audio. Here is the script that I'm running to capture video:

#!/bin/bash
base="/tmp/capture"
rm -rf $base
mkdir -p $base

raspivid -n -w 720 -h 405 -fps 25 -vf -t 86400000 -b 1800000 -ih -o - \
| ffmpeg -y \
    -i - \
    -c:v copy \
    -map 0:0 \
    -hls_wrap 100 -hls_time 1 -hls_flags delete_segments -hls_list_size 10 -f hls "$base/live.m3u8" &

I've spent hours on ffmpeg's website going through the documentation and tried adding alsa audio as an input but ffmpeg outputs an error saying that the parameters or the order of the parameters were wrong.

Any clue on how I should fix this?

1 Answer 1

1

For capturing audio, first, add a microphone module or a camera with an inbuilt microphone.

I have already answered a similar question - https://raspberrypi.stackexchange.com/a/66491/60723

Follow the instructions, Note that those instructions are for USB camera but audio streaming will work for you if you are using a separate microphone module. If you are using a camera with an inbuilt microphone than both the solutions will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.