kyriesent/node-rtsp-stream

Fixed Video Dimensions

Ashwin-Ramesh2607 opened this issue · 2 comments

Hi, when I create the canvas element and set a size (example width=400 and height=400), I am able to set my layout on the HTML before the stream starts. Now when I start the RTSP stream, the dimensions of my RTSP stream override the size of the canvas. As a result, the stream occupies (960 * 540) on the HTML page, and it messes up the layout entirely. Can you please suggest a fix?

Use '-vf':'scale=400:400' to your ffmpegOptions

stream = new Stream({
 name: 'name',
 streamUrl: 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov',
 wsPort: 9999,
 ffmpegOptions: { // options ffmpeg flags
  '-stats': '', // an option with no neccessary value uses a blank string
//  '-r': 15, // options with required values specify the value after the key
'-codec:a': 'mp2',
   '-ar': 44100,    
    '-ac': 1,    
'-b:a':'128k' ,
'-vf':'scale=720:-1'
 }
})

@florinnichifiriuc Thanks, that worked like a charm. I like this solution, as opposed to resizing on the UI since lesser data is streamed this way.