Slashdot Mirror


Ask Slashdot: Synchronizing Sound With Video, Using Open Source?

An anonymous reader writes: I have a decent video camera, but it lacks a terminal for using an external mic. However, I have a comparatively good audio recorder. What I'd like to do is "automagically" synchronize sound recorded on the audio recorder with video taken on the video camera, using Free / Open Source software on Linux, so I can dump in the files from each, hit "Go," and in the end I get my video, synched with the separately recorded audio, in some sane file format. This seems simple, but maybe it isn't: the 800-pound gorilla in the room is PluralEyes, which evidently lots of people pay $200 for --and which doesn't have a Linux version. Partly this is that I'm cheap, partly it's that I like open source software for being open source, and partly it's that I already use Linux as my usual desktop, and resent needing to switch OS to do what seems intuitively to be a simple task. (It seems like something VLC would do, considering its Swiss-Army-Knife approach, but after pulling down all the menus I could find, I don't think that's the case.) I don't see this feature in any of the Open Source video editing programs, so as a fallback question for anyone who's using LiVES, KDEnlive, or other free/Free option, do you have a useful workflow for synching up externally recorded sound? I'd be happy even to find a simple solution that's merely gratis rather than Free, as long as it runs on Ubuntu.

103 comments

  1. A Clapboard by Anonymous Coward · · Score: 4, Informative

    What you want is a simple Hollywood style clapboard. Use any two track + video editor and visually line up the audio spike to the video frame where the board is closed.

    1. Re:A Clapboard by cayenne8 · · Score: 4, Informative
      Yep, the good old fashioned way of doing this is looking for the "CLAP" on the waveform and lining it up with the video.

      However, if you want something very polshed and fancy and automatic....take a look at Davinci Resolve 12 Beta.

      This is the free version that contains about 98% of the $1K paid version...what's missing likely you won't miss either....it is now a full blow NLE that compete with Premier and FCPX and others...

      You can do some amazing sync'ing of multi-clip video and sound with this thing..take a look at the demos on site.

      Unfortunatley, the Linux version is only available for Paid version, but hell, who doesn't have a mac or windows box laying around? I mean, if you have money for a decent video set up, you've already poured out some decent cash (camera, lights, software....hell, lenses ALONE)....surely you have laying around a win/osx box or can buy one.

      But, do give Davinci Resolve 12 a look...they also have out Fusion, which is IMHO, going to be a competitor to Adobe After Effects too for SPFX....worth looking into too.

      --
      Light travels faster than sound. This is why some people appear bright until you hear them speak.........
    2. Re: A Clapboard by Anonymous Coward · · Score: 0

      well op says that he has a decent video-camera, but as any half-decent cam has two xlr-inputs, i seriously doubt that.

    3. Re:A Clapboard by hvdh · · Score: 1

      There may also be a need to adjust the speed of one track. I recorded a few songs on a concert with video from a compact digicam and audio from my smartphone (because the camera only records audio at 16kHz). When lining up the start of a song, at the end it was asynchronous by a few seconds. Audio was iirc 0.7% faster or slower than video, and this was the same for all recordings. I resampled the audio using Audacity before merging it with some video editor.

    4. Re:A Clapboard by Anonymous Coward · · Score: 0

      [splutter] This may sound stupid, but I never realised that's what the clapper board was for.

    5. Re:A Clapboard by Anonymous Coward · · Score: 0

      But, do give Davinci Resolve 12 a look...they also have out Fusion, which is IMHO, going to be a competitor to Adobe After Effects too for SPFX....worth looking into too.

      For those who've never heard of Nuke from The Foundry maybe https://www.thefoundry.co.uk/products/nuke/ . Fusion has been around for a while before Blackmagic got hold of it. There is also Flame, which is now an Autodesk product. Nuke though is the leader in node based compositing apps these days it seems (in terms of function and number of users) since Apple stupidly bought, and then killed off, Shake.

    6. Re: A Clapboard by Will.Woodhull · · Score: 1

      While I do have a good video camera that will accept a microphone, more than 90% of the time I use a separate device for audio recording. It is very rare that a microphone attached to the camera can be optimally positioned. A separate audio recorder is the answer to many vexing problems.

      I don't have a clapper board and if I did, I usually would still not have an assistant around to do the "take 3 (snap)" bit. But asking your subject to hold up his hands in the camera's view and clap smartly works. They also need to slowly count silently to three after the clap before beginning their spiel (the better to isolate the spike--- also makes it easier to clip the leading junk).

      I'm somewhere in the lower "pro-am" range with video production-- some work for charities but nothing I would attempt to sell. And no weddings! I do 720p at 24fps using the H.264 video and mono 128 mp3 audio, mp4 wrapper. I use FOSS post-production tools, currently mostly the Blender NLE. I hope to hear some more experienced videophiles chime in here with their thoughts on what works well for them.

      --
      Will
    7. Re: A Clapboard by Mal-2 · · Score: 1

      What about using a wireless microphone setup and running it through the camera's inputs? You'd still get the benefits of a separate device without cords to trip over, but all recording would be done on one device, with one clock. I can only imagine this becoming a problem if you seek to keep every microphone on a separate track, rather than a real-time mix down to stereo or mono.

      --
      How is the Riemann zeta function like Trump rallies? Both have an endless number of trivial zeros.
    8. Re: A Clapboard by Will.Woodhull · · Score: 1

      A wireless mic would solve a lot of problems.

      I probably will not buy a wireless mic since I've got a method that works. Also there are occasions when I want the sound track of interview to continue while I splice in a different video clip, and I think that would be more difficult if I was recording the audio on the camera.

      --
      Will
    9. Re: A Clapboard by macs4all · · Score: 1

      While I do have a good video camera that will accept a microphone, more than 90% of the time I use a separate device for audio recording. It is very rare that a microphone attached to the camera can be optimally positioned. A separate audio recorder is the answer to many vexing problems.

      Actually, if you have seen any of the pro-level portable cameras, most of them have a separate wireless transmitter module that can accept a balanced mic/line level through an XLR, and usually a 1/4" (TRS-balanced?) input as well. This gets transmitted back to the camera, in lieu of the built-in mic signal.

    10. Re: A Clapboard by macs4all · · Score: 1

      A wireless mic would solve a lot of problems.

      I probably will not buy a wireless mic since I've got a method that works. Also there are occasions when I want the sound track of interview to continue while I splice in a different video clip, and I think that would be more difficult if I was recording the audio on the camera.

      Are you planning on doing your editing IN the camera?!? If not, what you say makes no sense.

      Just use a NLE suite (I know they all suck on Linux; but, that's what you want), and if you can't "eyeball" the sync (your brain is QUITE sensitive to even small video/audio sync mismatches; so you SHOULD be able to pretty quickly get to an acceptable result), then do what another poster said, and use a "clapboard". Or just frickin' have someone stand in front of the damned camera (fairly closely) and clap their damned hands, FFS!

      The advantage to everything being digital nowadays, is that, even with consumer-grade audio and video equipment, once you get stuff in sync at the beginning, pretty much everything STAYS in sync, even without SMTPE timecode, etc.That might not be true of an hour-long clip; but it works for anything I've ever tried.

    11. Re: A Clapboard by Will.Woodhull · · Score: 1

      I've been trying without success to make sense of the post I'm replying to. My best guess is that the poster is unaware that he does not know as much about the tools available in Linux as he thinks he does. And that his reading comprehension was, for some reason, not very good when he was looking at earlier posts.

      Blender runs on Linux and contains a very good NLE (and a fantastic suite of CG tools as well). Audio clips brought into Blender's NLE can be displayed as waveforms, which makes synching the spike of the clap to the exact frame when hands come together very easy. Blender can handle any reasonable number of simultaneous audio clips (think of separate voice-over, action, and background music), as well as any reasonable complexity of overlaid video clips.

      Audacity also runs on Linux and is an excellent tool for removing background noises from an audio clip. I have also used it to shift the pitch of speakers, and somewhat to extend and/or compress parts of an audio clip to better fit a video sequence.

      Combined with a $300 digital videocam and a $100 digital audio recorder, you've got everything you need to make good quality 720p videos. That is not good enough to get into the wedding market, but it is sufficient for real estate sales, vacation travelogs, news and views interviews, "how to" stuff for YouTube, etc.

      One last point: any live-action audio, such as recording an interview, should be cleaned up in Audacity or a similar audio editor. Since the audio will need to be handled separately from the video, there is no particular advantage in going the extra expense of wireless mic to videocam recording. And I suspect it would be easier to handle two different streams from the start than to split a combined audio/video stream into its components (think splitting MPEG4 into its component H.264 and AAC). But of course this depends on the encodings the camera uses.

      Rather than spending more on a fancier videocam, I'd prefer to spend it on a second audio recorder (boom mic plus lapel mic) and/or entry level videocam (one set up for head shots and the other at middle distance.)

      --
      Will
  2. Clap Clap Clap by lars3232 · · Score: 4, Informative

    That is what the movie claps you see in documentaries are for. You produce a clap with your hand, resulting in a spike in your external mic and in the video cameras mic. That way, you know where to sync the two in your favorite video editing tool and you're fine. No need for special software or something similar.

  3. Sorry but you are screwed by Sycraft-fu · · Score: 2, Informative

    Unless the devices themselves have some kind of common sync like wordclock or the like, they will drift out of sync. So sync the audio at any given point, it'll be out of sync later. That's why studios have all kind of gear to slave everything to a master clock.

    So you either have to have something that can do an advanced auto-sync and make sure the sync gets corrected in multiple places, or you'll need to do it manually. Depending on how long the recording is that may not be too bad and you may not need to adjust it that many times, but it is really all you can do.

    Now of course if you gear has some kind of clock input and output you can slave it together, but I'm guessing it doesn't.

    Finally your request for Linux stuff makes it really hard. The Linux video editing scene is, well, really really bad. There are no good tools that I've come across. GRanted I haven't looked in awhile but last time I did all I found were things that were incomplete, or buggy, or not very useful (or all 3).

    Something like Sony Vegas Movie Studio would do the trick and make it pretty easy to do what you needed manually, but it does cost money and isn't for Linux.

    1. Re:Sorry but you are screwed by Anonymous Coward · · Score: 0, Informative

      This is not correct.

    2. Re:Sorry but you are screwed by Anonymous Coward · · Score: 1

      Yes sync in a longer take would be an issue, but I doubt his equipment has a clock or genlock input. So without getting into the vagaries of wordclock, blackburst, or AES11 I suggested a simple clapboard. It'll do the trick well enough for what hes doing. He could also run LTC into a spare audio track on both recorders, but I doubt he has a SMPTE generator or software to lock the two tracks together. Besides, modern digital recorders (both audio and video) have pretty stable clocks nowadays. I mean, it could be worse... he could be running analog tape. I remember locking several 2" analog machines with a bunch of Lynx modules and a distripalyzer, slaved to the console automation. What a mess.

    3. Re:Sorry but you are screwed by Kjella · · Score: 2

      Sorry but you are screwed. Unless the devices themselves have some kind of common sync like wordclock or the like, they will drift out of sync. So sync the audio at any given point, it'll be out of sync later. That's why studios have all kind of gear to slave everything to a master clock.

      Uh, the fact that he links to a piece of proprietary software which can do it in the summary should be a pretty good hint that he's not screwed. He might not be able to do it on Linux, but clearly you know even less about it than the submitter.

      --
      Live today, because you never know what tomorrow brings
    4. Re:Sorry but you are screwed by Anonymous Coward · · Score: 0

      If the sound recorder is digital (DAT, hard disk, or solid state) or has a sync crystal (e.g. Nagra), there should be little or no drift with any video format or with a crystal-controlled film camera over any reasonable-length take. The only time you should see drift is with a non-crystal analog recorder due to tape stretching and such. Digital recorders vary in quality, but the good ones (e.g. the Sound Devices digital recorders) should not have issues.

    5. Re:Sorry but you are screwed by Anonymous Coward · · Score: 1

      Shh, he's still splicing things together with a reel-to-reel tape recorder, obviously.

    6. Re:Sorry but you are screwed by cayenne8 · · Score: 1

      If worse comes to worst...he could run windows in a VM on Linux..and use Pluraleyes, or even Davinci Resovle as I'd suggested....

      --
      Light travels faster than sound. This is why some people appear bright until you hear them speak.........
    7. Re:Sorry but you are screwed by Vlijmen+Fileer · · Score: 1

      That sounds pretty buzzword compliant.

    8. Re:Sorry but you are screwed by Ol+Olsoc · · Score: 2

      Unless the devices themselves have some kind of common sync like wordclock or the like, they will drift out of sync. So sync the audio at any given point, it'll be out of sync later. That's why studios have all kind of gear to slave everything to a master clock.

      Unless it is a rather long edit, they'll stay in sync just fine. The clapboard method isn't automagic, but unless the recording has individual edits that are going to be 20 minutes or longer, its going to be an exercise in wasted money. I've even used background sounds in videos and audios to sync together. Not at all recommended, because its a pain in the ass, but remarkably effective.

      --
      The shepherds did so well protecting the flock that the sheep no longer believed that wolves existed.
    9. Re:Sorry but you are screwed by Anonymous Coward · · Score: 3, Informative

      He is correct. AV is my job, and I do a lot of it on Linux.

      My multi-track audio recorder and my video claim to run at the same speed - but there is variance between any two clock sources that are not linked.

      I use Harrison Mixbus (an excellent Linux/Mac/Windows DAW) and XJAdeo, both slaved to the Jack clock. You can shuttle audio and the video tracks your position according to the audio elapsed time.

      The two clocks drift apart very slowly. For the purposes of syncing live music footage, you only need to make a small correction to the audio every five minutes or so to keep things together.

      If you don't want to pay for Mixbus, you can use Ardour - it's getting very useable these days.

    10. Re:Sorry but you are screwed by kesuki · · Score: 1

      audio/video drift sync is totally machine correctable. http://forum.videohelp.com/threads/49752-Fixing-Audio-Drift-Without-Postprocessing

    11. Re:Sorry but you are screwed by Anonymous Coward · · Score: 0

      If you're a pro, what aren't you using timecodes for sync?

    12. Re: Sorry but you are screwed by Anonymous Coward · · Score: 0

      depends on the cam - cheap toys like a gopro tend to drift a lot, but with better gear you can usually get 1/2-1 hour of footage without drifting apart 1 frame or more.

    13. Re:Sorry but you are screwed by Anonymous Coward · · Score: 0

      If you have more than one clapboard (start+end) you can sync at two points and then adjust the speed of the sources to match each other.

    14. Re:Sorry but you are screwed by Anonymous Coward · · Score: 0

      If the sound recorder is digital (DAT, hard disk, or solid state) or has a sync crystal (e.g. Nagra), there should be little or no drift with any video format or with a crystal-controlled film camera over any reasonable-length take. The only time you should see drift is with a non-crystal analog recorder due to tape stretching and such. Digital recorders vary in quality, but the good ones (e.g. the Sound Devices digital recorders) should not have issues.

      I worked with RF test equipment for a time. The devices we built, and the test equipment itself, all contained crystal-controlled clocks internally. When it came to testing, all of the devices were connected to the 10 MHz clock standard receiver receiving WWV. https://en.wikipedia.org/wiki/WWV_%28radio_station%29

    15. Re:Sorry but you are screwed by Will.Woodhull · · Score: 1

      This works well with speech, where the audio frequency shift is minor and much less important than the lip synch. I'm not sure how well it would work with music. As I think someone else has already mentioned, you might have to resample the audio track with Audacity to get a singer's lip synch right without screwing up their pitch.

      --
      Will
    16. Re:Sorry but you are screwed by aitikin · · Score: 1

      burning accidental mode, this is a valid point though.

      --
      "Don't meddle in the affairs of a patent dragon, for thou art tasty and good with ketchup." ~ohcrapitssteve
    17. Re:Sorry but you are screwed by aitikin · · Score: 1

      I'm not sure how well it would work with music.

      Most time stretching (or compressing) these days can do an excellent job of minor adjustments without effecting pitch or formant.

      --
      "Don't meddle in the affairs of a patent dragon, for thou art tasty and good with ketchup." ~ohcrapitssteve
  4. Me too! by Anonymous Coward · · Score: 0

    I'd love to find that same tool. Lately, I've been shooting up to 4 cameras and 2 audio-only sources, and while Sony Vegas (commercial software) has a tool to synchronize media based on embedded time-stamps ( or timecode if one's using pro cameras), I haven't been able to get it to work (probably my own stupidity). Still, it relies on having the clocks sync'ed between cameras.

    I'd also love to find a tool/plug-in which would automatically trim out all my quick pans, zooms, focuses from my close-up shots on the editing timeline. That would save a lot of time.

    1. Re:Me too! by Anonymous Coward · · Score: 0

      > Lately, I've been shooting up to 4 cameras and 2 audio-only sources

      Shooting up heroin in hard core, but shooting up cameras is badass.

    2. Re: Me too! by Anonymous Coward · · Score: 0

      Is not in. Learn to, troll!

  5. Avidemux by Anonymous Coward · · Score: 1

    I haven't used it in a long time, but would Avidemux do the trick?

  6. Avidemux by apcullen · · Score: 0

    See Subject. It's not completely automagic, but it can probably do what you want.

  7. FFmpeg by Anonymous Coward · · Score: 1

    I think FFMPeg can mux audio and video from separate files. If not, search for muxing tools, and you'll have your answer. Of course, bear in mind that sample rates can drift. so the longer the video, the less likely this is to work without resampling. And you'll need to edit the start points to be precisely the same.

    1. Re:FFmpeg by Anonymous Coward · · Score: 0

      Muxing does not solve syncing if you have drift or offset presentation/frame timestamps.

  8. Open Broadcaster Software by JohnnyComeLately · · Score: 4, Informative

    Your issue is very similar to what Twitch streamers go through with delay between audio and video. I'd suggest checking out OBS and there are quite a few how-to videos on YouTube to show you how to sync.

  9. Blender Video Sequence Editor by Anonymous Coward · · Score: 1

    The video editor / compositor in Blender is quite nice. I'm sure with a little setup in Blender (and using a ClapperBoard at the start of every one of your videos) you could automate this process down to just having to drag an audio clip back and forth to match a spike in the audio with a frame of video.

    If you REALLY have to do a LOT of videos and don't want to take the time to do it manually, then maybe you should think about dropping the $200 for PluralEyes. I have never seen or heard of any free / open source program that will do this automagically.

    Actually I'm not even sure what visual / audio processing algorithms / methods PluralEyes would use to be reliable enough to do this every time - Unless they also require you to use a clapperboard...

    1. Re:Blender Video Sequence Editor by spauldo · · Score: 1

      Seconded for Blender.

      I do my (admittedly, not much) video editing in Blender.

      Blender's interface is weird, but there's a tutorial series on Youtube about using the video editor for non-Blender users by a guy going by "Mikeycal Meyers." There's an old series and a new series - just watch the new one.

      Plus, if you know anything about 3D, you can make animations and whatnot. Blender's almost a whole-pipeline-in-a-box type tool - Blender, an audio program, and Photoshop/Gimp are enough to make an animated movie. That's a lot more involved, though, and you don't have to use those features if you don't want them.

      As far as sync goes, I do mostly woodworking stuff, so I sync the audio with the tools. Hitting a chisel with a mallet is just about as good as a clapboard, and if there's going to be no tool use in a segment, I just clap my hands before I start. I rarely do more than about five minutes continuous video, though, so I don't have the clocking issue someone else mentioned.

      --
      Those who can't do, teach. Those who can't teach either, do tech support.
  10. PiTiVi by Anonymous Coward · · Score: 0

    The PiTiVi editor will do something like this, it's free and open source. I think OpenShot will do something similar. The nice thing about both programs is you can break audio/video files up and move them around if you decide you want to edit either audio or visuals later.

    1. Re:PITIVI by Anonymous Coward · · Score: 0

      http://www.pitivi.org/?go=download

  11. Sync to the audio by linuxwrangler · · Score: 5, Informative

    Don't sync to the video, sync to the audio. Your video recorder records the audio "reference" track and you just sync your externally recorded audio to the reference track. Kdenlive has this feature. Other editors may a well.

    --

    ~~~~~~~
    "You are not remembered for doing what is expected of you." - Atul Chitnis
    1. Re:Sync to the audio by TechyImmigrant · · Score: 2

      Don't sync to the video, sync to the audio. Your video recorder records the audio "reference" track and you just sync your externally recorded audio to the reference track. Kdenlive has this feature. Other editors may a well.

      I don't do video stuff, but I had the same thought. Record crappy audio in the camera and it would be a simple correlation algorithm to sync to the good audio.

      --
      I should use this sig to advertise my book ISBN-13 : 978-1501515132.
    2. Re:Sync to the audio by Fone626 · · Score: 5, Informative

      The above is totally correct, I use a separate recorder all the time so that I get better quality audio than my video recorder will supply, and then use Kdenlive to align the audio to the camera's reference audio.

      I've actually made a video that includes how to do it (among other features), and the video itself uses the Align Audio to Reference feature:
      https://www.youtube.com/watch?v=eIO73t228k0

      Here's a short text version:
      https://userbase.kde.org/Kdenlive/Manual/Timeline/Right_Click_Menu

    3. Re:Sync to the audio by Anonymous Coward · · Score: 0

      Simple correlation algorithm: we are on a computer with frame-accuracy, and realtime playback capabilities - line up the initial transients and nudge frame-by-frame with a subjective listen to make sure it's perfect. No algorithm is simpler nor more accurate.

    4. Re:Sync to the audio by Ol+Olsoc · · Score: 1

      Don't sync to the video, sync to the audio. Your video recorder records the audio "reference" track and you just sync your externally recorded audio to the reference track. Kdenlive has this feature. Other editors may a well.

      You can get 1 video frame off accuracy this way. I did the old clapboard method a gazillion times with no discernable sync issue. Keep the clapboard at the images point so that an echo won't give you an issue, but even that is overkill for most applications.

      If I was going to get at all fancy with it, I'd build a clapboard with an led on it that would light the moment the clap noise happened, to get a visual reality check. But that's even overkill.

      --
      The shepherds did so well protecting the flock that the sheep no longer believed that wolves existed.
    5. Re:Sync to the audio by wonkey_monkey · · Score: 1

      You can get 1 video frame off accuracy this way.

      Why?

      Also bear in mind you'll be 1 frame off sync for every 11 metres your clapper is from the camera...

      I think this is why humans notice less when sound is delayed than when it is in advance - because that's the normal way of things.

      --
      systemd is Roko's Basilisk.
    6. Re:Sync to the audio by Ol+Olsoc · · Score: 1

      You can get 1 video frame off accuracy this way.

      Why?

      Also bear in mind you'll be 1 frame off sync for every 11 metres your clapper is from the camera...

      I think this is why humans notice less when sound is delayed than when it is in advance - because that's the normal way of things.

      Another autocorrect or keyboard bounce attack 1 video frame of accuracy this way was what I tried to type.

      Yes, the speed of sound and pickup placement is important if we are trying to be as accurate as the video will allow us to be.

      --
      The shepherds did so well protecting the flock that the sheep no longer believed that wolves existed.
    7. Re:Sync to the audio by ottothecow · · Score: 1
      Did you guys even read the post? That is exactly how the $200 software he mentions does it.

      It will sync up the crappy audio from the camera with the fancy audio from the recorder (and also can sync multiple video streams based on their audio).

      His problem is that it costs $200 and doesn't run on linux. Also, probably that he has a single-camera setup and thus the features that sync video frames are not really necessary for him.

      He isn't asking for some magical software that lip reads his video and syncs the audio (or even knows how to find the frame where a clapboard closes and sync it with the audio spike). He just wants something that will line up the audio. And, as others have mentioned, there may be clock-sync drift issues...would be nice if the software fixes that too.

      --
      Bottles.
    8. Re:Sync to the audio by TechyImmigrant · · Score: 1

      I read the post. I didn't get the mechanism of the $200 software. I figured it was being clever and matching on-screen movements to sound or something.

      The logical thing to do is to start programming a solution if you don't like the $200 solution and you don't like the free options.

      --
      I should use this sig to advertise my book ISBN-13 : 978-1501515132.
    9. Re:Sync to the audio by Hognoxious · · Score: 1

      I haven't done the specific thing he's suggesting, but I've had PVR recordings that were out of sync. I just used one of mencoder's 27 million options and used trial and error to get the right input value.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    10. Re: Sync to the audio by Anonymous Coward · · Score: 0

      Funny story, guitar players will complain about a 5 millisecond latency in their digital audio interface but don't have any problem standing 3 meters from their amp. Irrational, but persistent!

  12. phasing by Anonymous Coward · · Score: 0

    It's not clear how many pieces of video you want to sync, but it is pretty straightforward in any video editing program to sync up uncut chunks of video with uncut audio. Simply put the video (with audio from your camera) into the timeline, then add an audio track and insert your microphone audio roughly in sync. If you have a clap or marker at the beginning this is easier, but even without you can usually find some sound or spoken phrase to identify a "sync point". When you cut it in close to the correct spot and play the sound you will hear it double up or "echo". Now adjust the microphone audio forward or backward until the "echo" turns into more like a reverb sound, eventually you will find that the two audio tracks line up and sound normal or at least "phasey" like a flange effect. This is how professional audio editors synchronize sound that has no timecode or slate. It may sound complicated, but it is very easy and fast. I use Plural Eyes when I have lots of complicated little clips, but if I have a dozen big chunks of video to synchronize, I just do it manually -- it's simpler than setting up Plural Eyes.

    NOTE: You MAY end up with sync drift depending on what sample rate you recorded your audio at since it doesn't sound like you have an audio recorder that is capable of recording audio at "pulled down" (24p vs 23.9p) speed.

  13. mencoder by carlhaagen · · Score: 4, Informative

    mencoder will do exactly what you need, muxing separate video and audio tracks into one container file of your choice, with tunable offsets for each track.

    1. Re:mencoder by Anonymous Coward · · Score: 0

      This is exactly what I was thinking, although I've found that building your own mencoder will give you a *lot* more filters and options than the pre-cooked version of mencoder that come with Ubuntu/Mint. But you can slice and dice very nicely with it. I don't usually try to cut slices with an accuracy more than 1/10 of a second, but you could (easily) cut slices to 1/1000 of a second (although the video is 60 ish frames per second, so going smaller than 1/60 of a second would be a bit silly).

  14. Use a production slate by Anonymous Coward · · Score: 0

    You can sync up the motion to the sound in post edit

    https://en.wikipedia.org/wiki/...

  15. Try Blender by Anonymous Coward · · Score: 0

    Blender has quite good capabilities for non-linear video editing, and the audio-video syncing will be a breeze. I was able to do a short (3m) product demo movie without having any prior experience with Blender, just by watching a couple of tutorials on youtube.

  16. A/V sync command line by mungewell · · Score: 5, Informative
    I had a recent project which needed to sync Audio from recorder with video from several cameras. I found this project on GitHub which has a command line tool to measure the delta between the high quality audio from recorder and the low quality from the cameras, and then I could just put this offset in my video editor when inserting the clips.

    https://github.com/allisonnico...

  17. OpenShot by Iarwain+Ben-adar · · Score: 2

    I've done this with OpenShot. It's fairly easy and intuitive to use. Save often -- it crashed frequently for me, but when it worked, it worked well.

  18. Not as simple as you think by Anonymous Coward · · Score: 0

    It might "seem intuitively to be a simple task" to you but if there is a $200 piece of software that does that and nothing else (and lots of people buy it) it's obviously not that simple. Either do it manually in a normal editor, write (and open-source) your own version, or pay for the commercial version.

    1. Re:Not as simple as you think by NotInHere · · Score: 1

      If you want the software to "automagically" do its job, it is indeed not a simple task. You'd need to correlate what you hear with what you see, this is generally hard. But if you let the user to the "hard work" and associate e.g. the image of clapping hands with the clap sound, or other visual occurences with their audio counterpart, the software only has to calculate an interpolation, with the easiest setup being splines.

  19. The solution may already be in your hands. by Anonymous Coward · · Score: 0

    Do you have a video editor that shows the audio waveform?

    Start your audio and video recordings. Stand in front of the camera (optional) and clap your hands.

    Load both recordings into your editor, look at the waveforms, and line up the spike in them from when you clapped.

    If you stood in front of the camera, you can use the visual cue of your hands to line things up if the camera audio is bad ... this is why clapboards you see on film sets have the stripes. It's to make them easier to see.

  20. I'm not sure about doing it live, but... by waspleg · · Score: 3, Informative

    I use avidemux and audacity to add Rifftrax to movies. Basically copying out the existing audio, merging the rifftrack with the movie audio in to one track and then putting it back in as a separate audio track so the original audio is there too if you want to watch the movie without jokes (pretty rare for me actually, but it's nice to have options ;)).

    Someone else already suggested OBS, I've used that too for recording gaming video. It can be pretty intensive and it takes some fiddling to make it workable but it's not bad.

  21. Re:stop being cheap by Anonymous Coward · · Score: 0

    Okay, so are you going to buy him the copy of Windows he needs to run it, since as he said, it doesn't run on Linux?

  22. Oh I forgot by waspleg · · Score: 1

    If you're doing this for surveillance, I use iSpy you can define a range of your camera that if it detects motion will start recording and you can choose how far in advance the buffer is and how long it waits before it stops. It can be triggered by audio too, I've found it to be very nice for watching maintenance at my apartment and people trying to break in to our cars.

    They do charge for remote access features but you can "roll your own" for that if you need it (I didn't). It can use an external mic as a source or one on the camera either way.

    1. Re:Oh I forgot by Trogre · · Score: 1

      The FOSS program motion works well for this too. I have it set to contact me when it detects movement, along with a few frames of the captured video.

      --
      "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
  23. Kdenlive works reasonably well by Greyfox · · Score: 1

    I've done that a couple of times with kdenlive for some amateur skydiving videos. It probably wouldn't work so well for production quality stuff, but it works fine for what I'm doing. Most of my videos are less than 10 minutes, though.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  24. Open Source Syncing of Video with Audio by wizzerking · · Score: 1
  25. timecode by Anonymous Coward · · Score: 0

    This is normally done with timecode. You "jam-sync" the sound recorder with the camera at the start of the day, using time-of-day timecode on each. They should stay reasonably close. For greater precision, you need the slate, as mentioned above, since timecode only gives you one-frame accuracy, and sound that is half a frame out-of-sync is still noticeable. Anyway, pretty much anything that can be used to edit video should be able to sync picture and track if they both have good timecode on them, and you can manually use the slate to fine-tune it.

  26. webpage by Anonymous Coward · · Score: 0

    It's actually not that hard with the new video tag and RT5 standard.

    Setup a webserver (I recommend nodejs), build a simple website, add in the well documented javascript to activate your camera/mic and then record it to a file. When done save it.

    Voila.

  27. Ffmpeg by Anonymous Coward · · Score: 0

    http://stackoverflow.com/questions/12938581/ffmpeg-mux-video-and-audio-from-another-video-mapping-issue

  28. Re:stop being cheap by Overzeetop · · Score: 1

    There's a reason so many are "stuck" using Windows, no matter how onerous Microsoft gets (or OSX, no matter how walled garden Apple is) - some industry standard software simply doesn't run on other systems. Compared to the cost of someone to do the work for you, buying a dedicated Windows machine and the software to run it is less than a single edit session.

    Or, as they say, use a clapperboard and do it yourself.

    --
    Is it just my observation, or are there way too many stupid people in the world?
  29. Clap, tap by Trogre · · Score: 1

    I can't help with the automagic part, but...

    I capture with this method too, except when working with pre-recorded studio performances. I highly recommend rolling the audio and video capture device for a few seconds before "action" to give you time to clap or tap an object in front of the camera, as close to the sound source (not necessarily the microphone) as is practical. you will then have a definitive reference point in your audio and video streams against which you can synchronize in your editor of choice. There are many FOSS editors that can help with this. The one I am currently using is OpenShot.

    --
    "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
  30. Uh the fact that I mention that in my post by Sycraft-fu · · Score: 1

    should be a pretty good hint that you didn't read it and just responded to the title.

    He's screwed for what he wants: No cost Linux software that does auto-sync. There is none.

    1. Re: Uh the fact that I mention that in my post by Anonymous Coward · · Score: 0

      Da Vinci resolve in a VM is pretty close to his requirements.

  31. Re:stop being cheap by Ol+Olsoc · · Score: 1

    There's a reason so many are "stuck" using Windows, no matter how onerous Microsoft gets (or OSX, no matter how walled garden Apple is) - some industry standard software simply doesn't run on other systems. Compared to the cost of someone to do the work for you, buying a dedicated Windows machine and the software to run it is less than a single edit session.

    Or, as they say, use a clapperboard and do it yourself.

    Just one of the big reasons I use OSX. Even iMovie can make a surprisingly professional movie. A lot of times when under insane time pressure, I used it instead of FCP.

    And I used a clapboard. Quick and efficient. And it works.

    caveat: if I were to be making a long single cut video, I'd find a professional tool to keep everything in sync. But that never happened.

    --
    The shepherds did so well protecting the flock that the sheep no longer believed that wolves existed.
  32. A Different Persepective by ottawanker · · Score: 1

    Have you thought about modding the device to add a mic input? If you check the web, someone might have already done it, or the schematic might be available, or it might be obvious if you take it apart.

  33. Cinelerra by MoonSweep · · Score: 1

    I'm no expert at video editing, but did you look at Cinelerra ? It exists for years (I mean, before VLC existed, before mplayer, even before Xine if I remember correctly... Who remembers aviplay ?) and apparently it is still (kind of) maintained.

    For Debian it's available on Christian Marillat's multimedia repository.

  34. reaper under wine? by BabaG1 · · Score: 1

    reaper has added video editing capability recently. while windows/osx only, the devs have made efforts to make it run well under wine. should allow for syncing/editing your audio into your video. i believe it acts largely as a front end for ffmpeg for a purpose like this. there should be a lot of help at the reaper forum. the demo is fully functional and not time-limited. BabaG

  35. VDub by Khyber · · Score: 1

    If you haven't tried VirtualDub you need to go do so. That nobody here even speaks of it is mounting testament to the declining mental health of this community.

    --
    Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    1. Re:VDub by serviscope_minor · · Score: 2

      That nobody here even speaks of it is mounting testament to the declining mental health of this community.

      The fact that we successfully read TFS and so aren't listing software that doesn't work on Linux is in fact a testament to our mental health.

      --
      SJW n. One who posts facts.
  36. I have done this. by Anonymous Coward · · Score: 0

    This can all be done with open source tools.

    Use Audacity with the noise removal filter to clean up the audio clip, if needed.
    Use Audacity to save the audio clip in a format that can be imported into Kdenlive or Openshot.

    If the video needs to be stabilized use Transcode before using a video editor. Here is an example using the file MVI_0611.MOV:
    transcode -J stabilize -i ./MVI_0511.MOV -y null,null -o dummy; transcode -J transform -i ./MVI_0511.MOV -y raw -o ./MVI_0511S.mov

    Import the video clip using Kdenlive or Openshot. Mute the audio from the video clip.
    Add the audio clip to the video clip with the video editor and drag the clips down to the empty rows at the bottom of the interface.
    Align the audio from each clip. Set an audio reference point and align to it using the video editor. Alternatively, stretch or compress the audio using Audacity and reinsert the changed clip into the video editor.
    Render the file in the format of your choosing.

    Good luck!

  37. compositing and editing audio/video by Anonymous Coward · · Score: 0

    You have non-free: lightworks (free version) and pro version 350 Us$

    in free bst product AMHA: shotcut.

    otherway: avconv in command line: http://www.shotcut.org/, ( a little problem between interlace and progressive format).

    bst regards.

  38. In order to figure out the offset by Anonymous Coward · · Score: 0

    user mplayer. The keys - and = will adjust A-V sync by tenths of a second in real time while the video is playing.

  39. PITIVI by Anonymous Coward · · Score: 0

    Have you looked at pitivi?

    http://arjunpe.blogspot.com/2012/06/how-to-combine-video-and-audio-files-in.html

  40. Blender 3D + Jack transport protocol + Ardour by Anonymous Coward · · Score: 0

    Given that both blender's video editor and ardour DAW support jack transport protocol, syncing sound and image becomes almost trivial.

  41. Don't be a little bitch by atari2600a · · Score: 2

    Hit record x2, CLAP, sync in post. You really can't zoom in & line up two tracks like the big boys?

  42. Don't be a dick by wonkey_monkey · · Score: 0

    Could you not have just answered the question like a normal person instead of being a douchebag about it? Or were you worried you weren't going to feel superior to anyone today?

    --
    systemd is Roko's Basilisk.
  43. Performance by Anonymous Coward · · Score: 0

    What hardware do you use and what sort of performance do you get with KDEnlive? Do you use ffmpeg?

    I 'm trying to work with 4K GoPro video and perfomance sucks a 264 to 265 transcode is only 4fps. Eight times real time on a quad core processor sucks.

  44. Don't Be A Hipster by Anonymous Coward · · Score: 0

    Could you not be the stereo typical white knight wannabe SJW trying to protect the feels of the pathetic?

    Seriously, this is the internet, take your "re-invented" emo shit to your momma. Don't be a fucking hypocrite about someone else feeling superior. You're pathetic.

    1. Re:Don't Be A Hipster by Anonymous Coward · · Score: 0

      Calling out a douchebag for what he or she is just making an observation, not being a SJW. If you don't want to have your feelings hurt being called a douchebag try not being one.

  45. Way to turn this into a flamewar, jackasses. by Anonymous Coward · · Score: 0

    Thanks to those who offered support without the need to retaliate against differing opinions.

  46. Glad the sync problem isn't just me by frog_strat · · Score: 1

    I have a little Sony handycam and made a video of a headless 8 string acoustic guitar I built. Using the Blender video sequence editor, the audio kept drifting. So I just split the audio into two minute chunks and sync'd each one. I figured I was doing something wrong, but it appears this is a widespread problem.

  47. Clocks drift at varying rates by freelunch · · Score: 1

    Different device clocks drift at different rates, mostly due to heat. Oven-controlled crystal oscillators are employed in more expensive devices to provide more reliable clocking.
    Sources that are simply synchronized at the start will typically quickly drift and lose sync. Unfortuantely the drift is often not linear. So if you sync them at the start, and then stretch or shrink one source via re-sampling, they may sync at the start and end, but not in the middle.
    A good solution for the OP's problem would compare the audio streams, identifying common reference points. The sources would then be adaptively corrected, matching those reference points. I've always thought that would be a very fun project, and useful to many people, but haven't been able to align my clocks to make it happen.

  48. Automagic by Anonymous Coward · · Score: 0

    There is an open source solution I used a few months back called shenidam. It's a little slow, but it works! The best use case is onboard camera audio and separate sound. You give shenidam source video and separate audio, and it matches and muxes automagically. The result: a video file with separate audio synced perfectly. Check out the website and source code on github.

    1. Re:Automagic by mantlepro · · Score: 1

      Oops! Posted this before logging in. Anyway, hope you find a good solution that fits your needs. To get Shenidam working, development packages and boost libraries must be installed before it complies successfully. Once it works, you can write a bash script and do things in batches and bring in other utilities like avconv / ffmpeg / sox, etc. as needed to for instance, convert a left-channel-only audio to true mono / stereo.

  49. Tempo and Pitch by Anonymous Coward · · Score: 0

    I've run into a problem with the sound getting out of sync the further a video goes. It can be a problem with the audio having a longer playtime than the video. Using a program like Audacity, we can change the Tempo without changing the Pitch, thus squeezing the audio down into a shorter play time without making the sounds play faster and resulting in a chipmunks effect. Fine tuning it can be a real pain though.

  50. FOSS tool "praat" can do it by Anonymous Coward · · Score: 0

    I record presentations where the camera audio is usually quite horrible, so I also record audio with an XLR interface on my laptop. I use the file modification times to calculate a rough time offset (the camera is easily 2 seconds off, FAT32 and manually synced clock). Once I have a rough estimate, I roughly cut out the audio into wav files using ffmpeg and then praat can find the exact offset.

    Download praat from: http://www.fon.hum.uva.nl/praat/

    #!/bin/bash
    cat > "correlate_audio_offset.praat" <<~~~
    form Cross Correlate two Sounds
            sentence Input_sound_1
            sentence Input_sound_2
            real start_time 0
            real end_time 30
    endform

    Open long sound file... 'Input_sound_1$'
    Extract part: 0, 60, "no"
    Extract one channel... 1
    sound1 = selected("Sound")
    Open long sound file... 'Input_sound_2$'
    Extract part: 0, 60, "no"
    Extract one channel... 1
    sound2 = selected("Sound")

    select sound1
    plus sound2
    Cross-correlate: "peak 0.99", "zero"
    offset = Get time of maximum: 0, 0, "Sinc70"

    writeInfoLine: 'offset'
    ~~~

    praat correlate_audio_offset.praat camera_audio_original.wav laptop_audio_original.wav

  51. Kdenlive works by Anonymous Coward · · Score: 0

    I do this audio sync in kdenlive for every video I make. Takes about 30 secs to align either the better sound track to video or the reverse. You pick which is stationary.

  52. Re:stop being cheap by sh00z · · Score: 1

    Precisely. I read this post, and heard the voice of Christine Baranski in my head..."So needy." If you're cheap, and really want to promote open source software, write it yourself. You say it's a simple task; just do it, and then share. If you're not willing to pay for the simplicity and ease of something like iMovie (free with every Mac since 1998 or so, so the barrier to entry is below $100), you need to pony up.