Default Video Resolution
See original GitHub issueSo far, the implementation of this package is doing great! Question tho, how can we force resolution on 480p, 720p, or 1080p when streaming? Or upon recording of the .mp4
I was looking for parameters in the code below that might achieve the requirement. But no luck!
trans: { ffmpeg: "/usr/bin/ffmpeg", tasks: [ { app: 'live', vc: "copy", vcParam: [], ac: "aac", acParam: ['-ab', '64k', '-ac', '1', '-ar', '44100'], rtmp: true, rtmpApp: 'live-ac', hls: true, hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]', dash: false, dashFlags: '[f=dash:window_size=3:extra_window_size=5]', mp4: true, mp4Flags: '[movflags=faststart]', } ] }
I noticed that acParam
has parameters, should there be for vcParam
as well?
Thanks in advance!
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top GitHub Comments
After struggling with the same issue for a few days and trying out various ffmpeg options, here is what I have found. Hope it helps others.
vcParam
and notvcParams
. It was discussed above but adding it to summarize. The reason vcParams appears to work is because it gets ignored and the library uses default options."'scale=1280:-1'"
-->'scale=1280:-1'
-g
with a value about double of frame rate of source video so that the .ts files generated had proper length of 2 seconds (hls_time value in my case). My input source was 15 fps, so I set -g to 30.So here is the config that worked for me:
About the scale filter: https://trac.ffmpeg.org/wiki/Scaling