title: ffmpeg - How to pass http headers?
body: <p>I need to pass http headers (user agent and ip) to an ffmpeg command.</p>
  
  <p>I use the following command:</p>
  
  <pre><code>ffmpeg  -y -timeout 5000000 -map 0:0 -an -sn -f md5 - -headers "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" -headers "X-Forwarded-For: 13.14.15.66"  -i "http://127.0.0.1" 
  </code></pre>
  
  <p>And I run a local node.js server to see the headers I get:</p>
  
  <pre><code>'use strict';
  
  var express = require('express');
  
  var server = express();
  
  server.all('/*', function(req, res) {
    console.log(JSON.stringify(req.headers));
    res.sendFile('SampleVideo_1080x720_1mb.mp4', {root: '.'});
  
  });
  
  
  server.listen(80);
  </code></pre>
  
  <p>I keep getting an error saying "No trailing CRLF found in HTTP header." and the request is stuck.</p>
  
  <p>If I drop the headers - everything works normally.</p>
  
  <p>I also tried putting both headers in one string, but any line breaking character I used (\r\n, \r\n, etc.) didn't work.</p>
  
  <p>Can someone help me figure out how to write this command correctly with the headers included?</p>