Giter Site home page Giter Site logo

Comments (10)

fsiddi avatar fsiddi commented on August 15, 2024

Latency could be due to ffmpeg or due to the time it takes your device to start recording. Someone with better ffmpeg knowledge could help here, but for our use case this is sufficient. I'll make a separate ticked issue to evaluate an ffmpeg replacement.

from push_to_talk.

tin2tin avatar tin2tin commented on August 15, 2024

Does this only happen on Windows? Is the recorded audio in sync on Linux and macOS?

from push_to_talk.

tin2tin avatar tin2tin commented on August 15, 2024

A bit of investigation:

https://trac.ffmpeg.org/wiki/DirectShow#BufferingLatency

There is also an option audio_buffer_size. Basically if you're capturing from a live mic, the default behavior for this hardware device is to "buffer" 500ms (or 1000ms) worth of data, before it starts sending it down the pipeline. This can introduce startup latency, so setting this to 50ms (msdn suggests 80ms) may be a better idea here. The timestamps on the data will be right, it will just have added (unneeded) latency if you don't specify this.

-audio_buffer_size 50

But it doesn't seem to have any effect on the short strips...

from push_to_talk.

tin2tin avatar tin2tin commented on August 15, 2024

It seems like it's around 2 sec. missing from the start, so maybe the strip should be moved to the right, so the right handle is at the the playhead position, in order to keep the audio will stay in sync with the images?

How much time is there for you guys between the end of the strip and the playhead?
(I counted sec out loud when hitting record and 1+2 where missing, and there is a 2 sec distance between right handle of the generated strip and the playhead)

from push_to_talk.

britalmeida avatar britalmeida commented on August 15, 2024

I have seen a similar problem before in a linux system and adding the "-fflags nobuffer" fixed the issue there. You could try experimenting with the ffmpeg flags.

from push_to_talk.

tin2tin avatar tin2tin commented on August 15, 2024

I've tried "-fflags nobuffer", "-movflags +faststart" and other things, but it seems ffmpeg takes a few sec to start both inside of Blender and outside(directly in cmd).

Maybe playing/generating color strip could be delayed until "size" is found in the stdout? I mean looking for the first instance of this line: "size= 1219kB time=00:00:06.51 bitrate=1532.8kbits/s speed=1.03x"

Is it correct that this delay is only on Windows?

from push_to_talk.

britalmeida avatar britalmeida commented on August 15, 2024

I can't tell if the delay only happens on Windows. It could be your specific audio recording hardware. Have you tried a different microphone or a different computer?

Unfortunately, I don't have any other suggestions than the flags you've already tried, besides trying a different solution than ffmpeg.

I'm not sure it would help to delay generating the color strip. It's technically possible, but I think people expect it to start recording immediately. The push to talk button is meant to work during playback and a bit of delay can really make for a crappy experience :(

I'll leave this issue open, since it's not solved, but I don't have concrete plans to test different audio recording solutions.

from push_to_talk.

tin2tin avatar tin2tin commented on August 15, 2024

I guess it could start as it is doing right now, with a red strip, but with the words: "Starting up", and then when the string "size" is detected in stdout, the start would be cut, the color would become green and the word would be "Recording"(and the generated strip would start at the time "size" is detected)? This way the sync should be preserved between the images and the recorded audio.

from push_to_talk.

britalmeida avatar britalmeida commented on August 15, 2024

What I meant is this feature really is designed to be a real-time experience. People are supposed to see their edit playing and then press the button just at the write time to record temp dialog and other sounds. A delay totally breaks this workflow. The delay should not be there.

I don't see the advantage of adding the "Starting up". If there is a delay, it's already obvious that something went wrong, because the strip is short. I don't see the usefulness of moving the strip around. It probably needs a re-take.

from push_to_talk.

tin2tin avatar tin2tin commented on August 15, 2024

I found no way to avoid the latency problem through ffmpeg command lines on Windows, however I found a way to "remote control" Audacity from Blender, so you start the recording in Blender, but it is actually Audacity doing the recording, and when finished you can do audio processing in Audacity, before sending the recording to Blender VSE: https://github.com/tin2tin/audacity_tools_for_blender

from push_to_talk.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.