0
Transcoding the input stream to the smaller twos:
ffmpeg -re -v info -i "rtmp://localhost/live/stream live=1" \
-c:v libx264 -b:v 500k -vf scale=540:-1 -preset faster -copyts \
-c:a aac -b:a 64k -ac 2 -flags +global_header \
-f flv "rtmp://localhost/live/500k live=1" \
-c:v libx264 -b:v 800k -vf scale=720:-1 -preset faster -copyts \
-c:a aac -b:a 64k -ac 2 -flags +global_header \
-f flv "rtmp://localhost/live/800k live=1"
Then I need relay them to AMS livepkgr HLS app:
ffmpeg -re -v info \
-i "rtmp://localhost/live/500k live=1" \
-c copy -copyts -flags +global_header \
-f flv "rtmp://localhost/livepkgr/500k?adbe-live-event=liveevent" \
-i "rtmp://localhost/live/800k live=1" \
-c copy -copyts -flags +global_header \
-f flv "rtmp://localhost/livepkgr/800k?adbe-live-event=liveevent"
The resulting streams are not keyframe aligned. Any chance to make then so with ffmpeg like FMLE encoder does? Thanks for an attention.
Add
-g
value
to each encode. – Gyan – 2016-02-13T06:08:08.433Thank you. -g seems deprecated. I have found -x264opts keyint=8:min-keyint=8:no-scenecut but the problem is not actually with putting the keyframe but getting it aligned in both streams. The ffmpeg transcoding above does not start the both streams at the same time, there is a slight shift. In case of FMLE the livepkgr app produces up to 3 streams aligned but ffmpeg does not. Should be a trick to tell the livepkgr app produce properly aligned streams files as it does in case when encoder is FMLE. – vayvanne – 2016-02-14T00:41:20.590