title: Pipe ffmpeg output to named pipe
body: <p>I'm trying to get ffmpegs output to a named pipe, where I could read from another shell. I do not need the video stream piped, just the informations below to get a state of the conversion process back. I am not able to achieve the piping behavior in any way, but I can write the data to a file with the following command:</p>
  
  <pre><code>ffmpeg -i vid.mov -vcodec h264 -acodec aac -strict -2 -y vid.mp4 &gt; fflog.txt 2&gt;&amp;1
  </code></pre>
  
  <p>This leads to the following output in fflog.txt</p>
  
  <pre><code>Stream mapping:
  Stream #0:1 -&gt; #0:0 (h264 (native) -&gt; h264 (libx264))
  Stream #0:0 -&gt; #0:1 (aac (native) -&gt; aac (native))
  Press [q] to stop, [?] for help
  frame=   50 fps=0.0 q=0.0 size=       0kB time=00:00:03.20 bitrate=   0.1kbits/s
  frame=   73 fps= 70 q=28.0 size=     230kB time=00:00:04.05 bitrate= 465.4kbits/s
  frame=  100 fps= 65 q=28.0 size=     462kB time=00:00:05.44 bitrate= 695.3kbits/s
  </code></pre>
  
  <p>Afterwards I can get lines via</p>
  
  <pre><code>tail -f -1 fflog.txt
  </code></pre>
  
  <p>out of the file. But the lines are not escaped correctly, I think. Vi shows me the following:</p>
  
  <pre><code>frame=   50 fps=0.0 q=0.0 size=       0kB time=00:00:03.20 bitrate=   0.1kbits/s
  ^Mframe=   73 fps= 70 q=28.0 size=     230kB time=00:00:04.05 bitrate= 465.4kbits/s
  ^Mframe=  100 fps= 65 q=28.0 size=     462kB time=00:00:05.44 bitrate= 695.3kbits/s
  ^Mframe=  125 fps= 61 q=28.0 size=     608kB time=00:00:06.48 bitrate= 767.5kbits/s
  </code></pre>
  
  <p>So the questions are:</p>
  
  <ol>
  <li>How to convert the CRLF to UNIX like LF to return data correctly via tail -n?</li>
  <li>Or even better: How to pipe the ffmpeg results correctly to a mkfifo named pipe?</li>
  <li>Or the most general: Is there a different way to achieve my goal in a more clever manner?</li>
  </ol>