apivideo / browserLiveStream

Use webcam, browser and Node to stream live video. From api.video (https://api.video)
http://livestream.a.video/
MIT License
193 stars 48 forks source link

not maintaining given frame rate 30 #6

Open harivinod opened 3 years ago

harivinod commented 3 years ago

HI,

I would like to thank you for this great project, I have a requirement of 30 fps and I am using the video of size 240x240 . what I am observing is the working for the very first run after all setup. From 2nd run it is always going back to 15 frames max. is there a way to always honor the frames we provide in the options? Please let me know

the options i am using var ops=[ '-y', '-thread_queue_size', '5096', '-guess_layout_max', '0', '-i','-', '-s' ,'1280x720', '-c:v', 'libx264', '-c:a', 'mp2', '-r', '30000/1001', '-b:v', '512k', '-profile:v', 'high', '-level', '4', '-preset', 'ultrafast', '-tune', 'zerolatency' , '-pix_fmt', 'yuv420p',
'-refs', '4', '-weightp', '0' ,'-x264opts', 'keyint=60:keyint_min=15:intra_refresh=0:bframes=3:open_gop=0:nal-hrd=cbr:vbv-bufsize=10000:vbv-maxrate=5000', '-deblock', '1:1:1' ,'-threads', '8', '-me_range', '24' ,'-trellis' ,'2',
'-f', 'mpegts', '-flush_packets', '0', '-mpegts_flags', 'resend_headers', '-mpegts_service_id', '1' ,'-mpegts_pmt_start_pid', '480','-mpegts_start_pid', '481', '-f', 'mpegts', '-flush_packets', '0', 'udp://192.168.1.100:5000?pkt_size=1316​'

    ];

Thanks

dougsillars commented 3 years ago

I bet the limitation is coming from the camera, not FFMPEG.

have you modified the index.html requestMedia function (~line 300)? frameRate is set to the submitted value as 'ideal' but you can set a min value.