1

So I'm trying to add text and a logo onto all my video qualities with HLS and I am receiving the error Too many inputs specified for the "split" filter. I am not sure how to correct it so that my command is working.

ffmpeg -y -hide_banner -i /var/www/area51-process1.example.com/html/v/he2IqMmhZLG-f205e4f3-2351-447d-a16c-52855da761e9.mp4
-i /var/www/area51-process1.example.com/html/includes/assets/watermark_logo.png
-filter_complex "[0:v]drawtext=fontfile=/var/www/area51-process1.example.com/html/includes/helveticaneue/HelveticaNeueMed.ttf:text=@mustsee:[email protected]:fontsize=(h/32):x=w-tw-25:y=h-th-10,format=yuv420p[wm];[1:v]scale2ref=oh*mdar:ih[logo];[logo]overlay=main_w-overlay_w-10:main_h-overlay_h-65;[wm][logo]split=5[s0][s1][s2][s3][s4];[s0]scale=854:450[480p];[s1]scale=640:338[360p];[s2]scale=1280:-2[720p];[s3]scale=1920:-2[1080p];[s4]scale=2560:1350[1440p]"
-map "[480p]" -map "[360p]" -map "[720p]" -map "[1080p]" -map "[1440p]" -maxrate:v:0 4000000 -bufsize:v:0 4000000 -maxrate:v:1 3000000 -bufsize:v:1 3000000 -maxrate:v:2 8000000 -bufsize:v:2 8000000
-maxrate:v:3 14000000 -bufsize:v:3 14000000 -maxrate:v:4 20000000 -bufsize:v:4 20000000 -map 0:a -c:a libfdk_aac -ac 2 -async 1 -ar 48000 -b:a 128k -c:v libx264 -preset superfast -crf:v:0 24
-profile:v:0 high -crf:v:1 25 -profile:v:1 high -crf:v:2 23 -profile:v:2 high -crf:v:3 22 -profile:v:3 high -crf:v:4 21 -profile:v:4 high  -g 100 -keyint_min 100 -force_key_frames "expr:gte(t,n_forced*2)" -sc_threshold 0 -flags +global_header
-movflags +faststart -max_muxing_queue_size 4096 -threads 0 -f tee "[select=\'v:0,a\':f=hls:start_number=0:hls_flags=single_file:hls_playlist_type=vod:hls_segment_type=fmp4:hls_time=4:hls_list_size=0:hls_segment_filename=/var/www/area51-process1.example.com/html/v/he2IqMmhZLG-f205e4f3-2351-447d-a16c-52855da761e9-480p-segment.mp4]/var/www/area51-process1.example.com/html/v/he2IqMmhZLG-f205e4f3-2351-447d-a16c-52855da761e9-480p.m3u8|[select=\'v:1,a\':f=hls:start_number=0:hls_flags=single_file:hls_playlist_type=vod:hls_segment_type=fmp4:hls_time=4:hls_list_size=0:hls_segment_filename=/var/www/area51-process1.example.com/html/v/he2IqMmhZLG-f205e4f3-2351-447d-a16c-52855da761e9-360p-segment.mp4]/var/www/area51-process1.example.com/html/v/he2IqMmhZLG-f205e4f3-2351-447d-a16c-52855da761e9-360p.m3u8|[select=\'v:2,a\':f=hls:start_number=0:hls_flags=single_file:hls_playlist_type=vod:hls_segment_type=fmp4:hls_time=4:hls_list_size=0:hls_segment_filename=/var/www/area51-process1.example.com/html/v/he2IqMmhZLG-f205e4f3-2351-447d-a16c-52855da761e9-720p-segment.mp4]/var/www/area51-process1.example.com/html/v/he2IqMmhZLG-f205e4f3-2351-447d-a16c-52855da761e9-720p.m3u8|[select=\'v:3,a\':f=hls:start_number=0:hls_flags=single_file:hls_playlist_type=vod:hls_segment_type=fmp4:hls_time=4:hls_list_size=0:hls_segment_filename=/var/www/area51-process1.example.com/html/v/he2IqMmhZLG-f205e4f3-2351-447d-a16c-52855da761e9-1080p-segment.mp4]/var/www/area51-process1.example.com/html/v/he2IqMmhZLG-f205e4f3-2351-447d-a16c-52855da761e9-1080p.m3u8|[select=\'v:4,a\':f=hls:start_number=0:hls_flags=single_file:hls_playlist_type=vod:hls_segment_type=fmp4:hls_time=4:hls_list_size=0:hls_segment_filename=/var/www/area51-process1.example.com/html/v/he2IqMmhZLG-f205e4f3-2351-447d-a16c-52855da761e9-1440p-segment.mp4]/var/www/area51-process1.example.com/html/v/he2IqMmhZLG-f205e4f3-2351-447d-a16c-52855da761e9-1440p.m3u8"

update: After using the new code it works but the image is huge. what could be causing that?

enter image description here

1 Answer 1

2

The split filter expects exactly one input. Also, scale2ref requires two, as does overlay. As currently specified, the filters will rely on implicit routing which won't help with debugging or clarity.

Use

[0:v]drawtext=fontfile=/var/www/area51-process1.example.com/html/includes/helveticaneue/HelveticaNeueMed.ttf:text=@mustsee:[email protected]:fontsize=(h/32):x=w-tw-25:y=h-th-10,format=yuv420p[wm];[1:v][wm]scale2ref=oh*mdar:ih[logo][wm];[wm][logo]overlay=main_w-overlay_w-10:main_h-overlay_h-65,split=5[s0][s1][s2][s3][s4];[s0]scale=854:450[480p];[s1]scale=640:338[360p];[s2]scale=1280:-2[720p];[s3]scale=1920:-2[1080p];[s4]scale=2560:1350[1440p]

2
  • Thanks for the answer. It was driving me crazy. I just have one problem. The logo is showing very big across the whole screen. Please see image above. What might cause that? It's the same code used here. Is the scale2ref incorrect? Commented Oct 1, 2022 at 7:54
  • Never mind. I used code from another answer you provided scale2ref=w=oh*mdar:h=ih/20 and it's working great. thank you. Commented Oct 1, 2022 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.