[FFmpeg-user] multiple HLS outputs with different stream maps

Viorel Dehelean synologic at gmail.com
Fri Jul 19 22:50:31 EEST 2019


Slight different command line, i'm trying to produce 2 separate abr streams
with different stream map structures, as well as doing transcoding but that
should not be of any circumstance:

./ffmpeg -ignore_unknown -async 1 -probesize 1M -analyzeduration 1000000 \
    -i "udp://<udp group>:1234?fifo_size=5000000&overrun_nonfatal=1"
-threads 0 -fflags +genpts \
    -filter_complex
"[0:v]yadif=0:-1:0[deinterlaced];[deinterlaced]split=4[v1][v2][v3][v4];[v1]copy[v1out];[v2]scale=w=1280:h=720:force_original_aspect_ratio=disable[v2scale];[v2scale]pad=width=1280:height=720:x=(ow-iw)/2:y=0:color=black[v2out];[v3]scale=w=800:h=450:force_original_aspect_ratio=disable[v3scale];[v3scale]pad=width=800:height=450:x=(ow-iw)/2:y=0:color=black[v3out];[v4]scale=w=480:h=270:force_original_aspect_ratio=disable[v4scale];[v4scale]pad=width=480:height=270:x=(ow-iw)/2:y=0:color=black[v4out]"
\
    -map [v1out] -x264opts:v:0 keyint=15:min-keyint=15:no-scenecut
-flags:v:0 +cgop -c:v:0 libx264 -profile:v:0 high -level 4.0 -preset
superfast -b:v:0 8000k -maxrate:v:0 10000k -minrate:v:0 4000k \
    -map [v2out] -x264opts:v:1 keyint=15:min-keyint=15:no-scenecut
-flags:v:1 +cgop -c:v:1 libx264 -profile:v:1 high -level 4.0 -preset
superfast -b:v:1 3000k -maxrate:v:1 3000k -minrate:v:1 1350k \
    -map [v3out] -x264opts:v:2 keyint=15:min-keyint=15:no-scenecut
-flags:v:2 +cgop -c:v:2 libx264 -profile:v:2 main -level 3.1 -preset
superfast -b:v:2 900k -maxrate:v:2 900k -minrate:v:2 450k \
    -map [v4out] -x264opts:v:3 keyint=15:min-keyint=15:no-scenecut
-flags:v:3 +cgop -c:v:3 libx264 -profile:v:3 baseline -level 3.0 -preset
superfast -b:v:3 450k -maxrate:v:3 450k -minrate:v:3 150k \
    -map a:0 -c:a:0 libfdk_aac -b:a:0 128k -metadata:s:a:0 language=ron \
    -f hls \
    -var_stream_map "v:0,agroup:audio v:1,agroup:audio v:2,agroup:audio
v:3,agroup:audio a:0,agroup:audio,name:Romanian,language:ron,isdefault:yes"
\
    -use_localtime 1 -hls_allow_cache 0 -hls_flags
delete_segments+omit_endlist+second_level_segment_index+second_level_segment_size+second_level_segment_duration+program_date_time
\
    -hls_start_number_source datetime -hls_time 6 -hls_list_size 10
-hls_segment_filename
/origin/35f4574f4aed42d083de1087851f8712/%v_stream_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts
\
    -master_pl_name playlist.m3u8
/origin/35f4574f4aed42d083de1087851f8712/variant_%v_manifest.m3u8 \
    -var_stream_map "v:0,a:0 v:1,a:0 v:2,a:0 v:3,a:0" \
    -use_localtime 1 -hls_allow_cache 0 -hls_flags
delete_segments+omit_endlist+second_level_segment_index+second_level_segment_size+second_level_segment_duration+program_date_time
\
    -hls_start_number_source datetime -hls_time 6 -hls_list_size 10
-hls_segment_filename
/origin/35f4574f4aed42d083de1087851f8712/mux/%v_stream2_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts
\
    -master_pl_name playlist2.m3u8
/origin/35f4574f4aed42d083de1087851f8712/mux/variant2_%v_manifest.m3u8


and i'm getting:


[hls @ 0x561859fcf900] Unable to map stream at v:1
[hls @ 0x561859fcf900] Variant stream info update failed with status
ffffffea
Could not write header for output file #1 (incorrect codec parameters ?):
Invalid argument
Error initializing output stream 1:0 --

On Fri, Jul 19, 2019 at 5:34 PM andrei ka <andrei.k.gml at gmail.com> wrote:

> oups, i had extra space in command line, actually it works fine with 2nd
> stream_map
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list