rien / reStream

Stream your reMarkable screen over SSH.
MIT License
734 stars 56 forks source link

Recording audio from host pc: synchronize audio and video #26

Open vinipsmaker opened 4 years ago

vinipsmaker commented 4 years ago

I've spent an hour trying to record audio and sync'ing with the video. I'm gonna paste my findings here and possibly get back to this issue when I have the time.

Just put -f pulse -ac 2 -i default to ffmpeg command and it'll record the audio. However, ffmpeg is very picky about ordering of the args. You must put these options after output path.

Also, I've tried to use the arg -use_wallclock_as_timestamps 1, but it wasn't good enough. This thread has a few other methods to try: https://superuser.com/questions/1042988/ffmpeg-audio-out-of-sync-when-transcoding-demuxing-from-dv/1054478

I've also tried to replace ffmpeg with gst-launch, but I only managed to capture the first frame and that's another story anyway.

rien commented 4 years ago

Hi, I've been troubleshooting a bit and apparently ffplay is unable to work with multiple streams.

If you want to give multiple inputs to ffmpeg, the -i input_url should be the argument in the 'group' for that input. So -f pulse -i default should either be the first argument "group", or be placed after the -i -.

What is is specifically that you want to achieve and what is not working yet?

vinipsmaker commented 4 years ago

What is is specifically that you want to achieve and what is not working yet?

The A/V sync makes the whole endeavour unusable. I need to tune options to get usable A/V sync.