I don't have much knowledge of FFmpeg. I have googled and made the following code for creating two quality hls transcoding for the video files. It is working fine.
I want to create 4 types of video quality. 720,480,320,240.
final arguments = '-y -i $videoPath ' +
'-preset ultrafast -g 48 -sc_threshold 0 ' +
'-map 0:0 -map 0:1 -map 0:0 -map 0:1 ' +
'-c:v:0 libx264 -b:v:0 2000k ' +
'-c:v:1 libx264 -b:v:1 365k ' +
'-c:a copy ' +
'-var_stream_map "v:0,a:0 v:1,a:1" ' +
'-master_pl_name master.m3u8 ' +
'-f hls -hls_time 6 -hls_list_size 0 ' +
'-hls_segment_filename "$outDirPath/%v_fileSequence_%d.ts" ' +
'$outDirPath/%v_playlistVariant.m3u8';
I am using flutter_ffmpeg (https://pub.dev/packages/flutter_ffmpeg) plugin to call this code.
Any help is appreciated.