Skip to main content

Thread: screencasting audio/video sync problems


hi. i've been using recordmydesktop command line couple of years make lecture videos computer , it's been working pretty well. experimented ffmpeg's x11grab. both of utilities have flaked out on me: both, audio , video out of sync. weird thing video ends being few seconds ahead of audio when use recordmydesktop, video behind audio using ffmpeg's x11grab.

screencasts lectures within type text whiteboard on computer screen. test sync, i've made sample videos verbally each letter of word i'm typing it. recordmydesktop text appears on screen few seconds before i've started verbally spelling. ffmpeg, letters start show in test video after i've started verbally spelling.

i've researched , tried bunch of different switches both recordmydesktop , ffmpeg's x11grab, can't sync improve. meantime, discovered pretty horrid looking hack of bash script made uses ffmpeg records audio , video separately, joins them together. it's clunky thing , test once i'd figured out way stop script enter file name, while it's recording, under you'd output saved. weirdest of all, script gives me file in audio , video pretty in perfect sync.

script follows:
code:
#!/bin/bash  #vzybilly  #these temp files  aud="aud.mp3"  vid="vid.mp4"  #grab audio & pid  ffmpeg -f alsa -ac 2 -i plughw:0,0 $aud &  audpid=$!  #grab screen & pid  ffmpeg -f x11grab -s "1366x768" -r "24" -i :0.0 -threads 0 -sameq -an -f mp4 $vid &  vidpid=$!  #wait, till name given (that means stop)  read -p "stop giving output video name?" out  #stop audio , video pids  kill -n 2 $audpid  kill -n 2 $vidpid  echo "saving $out"  #combine target output file  ffmpeg -i $aud -i $vid -acodec copy -vcodec copy "$out"  #purge temp files  rm $aud  rm $vid
posted on these forums @ http://ubuntuforums.org/showthread.php?t=2003738

can either suggest improvements script or else provide other tips or leads getting recordmydesktop and/or ffmpeg's x11grab give me better synchronization between audio , video?

thanks,
james

i recommend method shown here: howto: proper screencasting on linux

records lossless video. advantage should capture "faster" , more reach desired fps (or increase fps smoother video). disadvantage should re-encode resulting file due potentially large file sizes of lossless videos.

script posted unfortunately uses -sameq. abused ffmpeg option not mean "same quality" , not designed used between formats not share same "quantizer scale". should ignore option since not think does. also, encoder script uses ambiguous since rely on default encoder .mp4 output. ffmpeg default change mpeg4 if libx264 not available. these not equal in terms of performance, quality, or format.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support Multimedia Software [all variants] screencasting audio/video sync problems


Ubuntu

Comments

Popular posts from this blog

Could not place because the source rectangle is empty

Thread: Using smartcard reader with vpnc

Adobe Font Folio 7.0 or just 7?