It’s very easy just to follow the steps.
Ingest the HLS stream → then map video stream from the input HLS stream → Scale it → Transcode it to RTMP.
Now, to ensure correct mapping from the HLS stream, first, check the index of each stream with
ffprobe -show_streams hls_url command.
Must checkout: How to create an RTMP proxy server