title: Encode array of JPEG images to MPEG1
body: <p>I have this web worker code that I need to be able to use to convert an array of JPEG images into MPEG1</p>
  
  <pre><code>importScripts('ffmpeg-core.min.js')
  
  onmessage = function(e) {
      var images = e.data[0]
      console.log('Got frames: ' + images.length)
      var memfs = [];
      var args = ['-framerate', '30', '-i'];
      for (var i =0;i&lt;images.length;i++) {
          var n = 'img-'+pad(i, 3)+'.jpg' 
          memfs.push({name: n, data:images[i]}) 
          args.push('-i'); //adding those to args
          args.push(n);
      }
      // ffmpeg -i source.mp4 -s 640x360 -f mpegts -codec:v mpeg1video -bf 0 -codec:a mp2 -q 4 out.ts
  
      // var mpeg1Blob = ...
      // postMessage(mpeg1Blob)
  }
  </code></pre>
  
  <p>How can I make this convert the images into MPEG1. MPEG1 for <a href="https://github.com/phoboslab/jsmpeg" rel="nofollow noreferrer">https://github.com/phoboslab/jsmpeg</a></p>