To view the method mentioned above in action, visit:
https://www.youtube.com/watch?v=B-ry-f3Mpx4
Printable View
To view the method mentioned above in action, visit:
https://www.youtube.com/watch?v=B-ry-f3Mpx4
Do not use the -sameq option when using x11grab. See sameq does not mean "same quality".
So, how to do screencast with ffmpeg with simultaneous capturing internal(which goes to speakers) and with external(which recorded by microphone) sound?
using pavucontrol and all streams. you can create loopbacks so it records both internal audio and mic using pactl, see here for a hint: http://ubuntuforums.org/showthread.p...ghlight=twitch
when trying this
i get thisCode:ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1280x720 -i :0.0 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -crf 0 -threads 0 output.mkv
What gives?Code:[matroska @ 0x1668bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 1 >= 1
av_interleaved_write_frame(): Invalid argument
I don't have a "real" solution, but you can output the audio separately and then mux it afterwards. Untested example:
Note that "-threads 0" is default so you don't need to include it.Code:ffmpeg -f x11grab -r 30 -s 1280x720 -i :0.0 -vcodec libx264 -preset ultrafast -crf 0 output-v.mkv -f alsa -ac 2 -i pulse -acodec pcm_s16le output-a.wav
ffmpeg -i output-v.mkv -i output-a.wav -c copy output.mkv
Hello!
I've got a bit of a problem with recording - my video & audio get increasingly desynchronized. The longer the video, the longer the gap. For example, in one of the videos I recorded, a couple of minutes in, the video is behind audio by a couple of seconds, @ 1 hour mark - almost a minute, at 2 hour mark - a bit more than two minutes.
I run the capture with
I tried running it with -vsync, with aresample=async=1000 audio filter, and tried with both at the same time. Tried recording both audio stream without mixing them on the fly. Tried recording only one audio stream. I still get the same going out of sync problem. Could anyone help me? 'Cause I am out of ideas.Code:./ffmpeg -f alsa -ac 2 -i pulse -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1280x720 -i +foo,bar -filter_complex amix=inputs=2:duration=first:dropout_transition=3 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -x264opts crf=0 -threads 0 /foo/bar.mkv
I seem to have the same problem. Video and audio got out of sync too on my ~40 min video.
i would suggest turning down your frames per second. give that a try