title: Capture webcam using ffmpeg-python library
body: <p>Hi I'm attempting to capture a webcam stream with python using the ffmpeg-python wrapper library (<a href="https://github.com/kkroening/ffmpeg-python" rel="nofollow noreferrer">https://github.com/kkroening/ffmpeg-python</a>)
  I have a working ffmpeg command which is:</p>
  
  <pre><code>ffmpeg -f v4l2 -video_size 352x288 -i /dev/video0 -vf "drawtext='fontfile=fonts/FreeSerif.ttf: text=%{pts} : \
  x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1'" -an -y -t 15 videotests/out_localtime8.mp4
  </code></pre>
  
  <p>This captures 15s of video in resolution 352x288, and writes a timestamp in the bottom centre of the video.</p>
  
  <p>To play with the ffmpeg-python library, I'm simply attempting to only get the drawtext filter working, here is my script:</p>
  
  <pre><code>#!/usr/bin/env python
  
  import ffmpeg
  stream = ffmpeg.input('videotests/example.mov')
  stream = ffmpeg.filter_(stream,'drawtext',("fontfile=fonts/FreeSerif.ttf:text=%{pts}"))
  stream = ffmpeg.output(stream, 'videotests/output4.mp4')
  ffmpeg.run(stream)
  </code></pre>
  
  <p>The error is </p>
  
  <pre><code>[Parsed_drawtext_0 @ 0x561f59d494e0] Either text, a valid file or a timecode must be provided
  [AVFilterGraph @ 0x561f59d39080] Error initializing filter 'drawtext' with args 'fontfile\\\=fonts/FreeSerif.ttf\\\:text\\\=%{pts}'
  Error initializing complex filters.
  Invalid argument
  </code></pre>
  
  <p>The above appears to at least reach ffmpeg but the format of the arguments is incorrect, how to correct them?</p>
  
  <p>Alternatively, when I attempting to split the argument to just pass one of them, I get a different error, as follows: </p>
  
  <pre><code>stream = ffmpeg.filter_(stream,'drawtext',('text=%{pts}'))
  </code></pre>
  
  <p>Error is</p>
  
  <pre><code>subprocess.CalledProcessError: Command '['ffmpeg', '-i', 'videotests/example.mov', '-filter_complex', "[0]drawtext=(\\\\\\\\\\\\\\'text\\\\\\\\\\\\=%{pts}\\\\\\\\\\\\\\'\\,)[s0]", '-map', '[s0]', 'videotests/output4.mp4']' returned non-zero exit status 1.
  </code></pre>
  
  <p>How come there are so many backslashes? Any advice on how to proceed please.</p>
  
  <p>Thank you</p>