0

i want to convert mp4 video into hls multi resolution (360 , 720) and add watermark image inside the output segments

i did two result but missing the watermark image with the multi scale

//one hls with water mark image
ffmpeg \
-i input.mp4 \
-i watermark.png \
-filter_complex "[0:v][1:v] overlay=10:10:format=auto,format=yuv420p" \
-c:a copy -b:a 128k -c:v libx264 -crf 23 \
-f hls \
-hls_time 3 \
-hls_flags independent_segments \
-master_pl_name "output.m3u8" "output-%v.m3u8"


//multi hls with watermark text
ffmpeg \
-i ../input.mp4 \
-map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0 \
-c:v:0 libx264 -crf 28 -preset faster -maxrate:v:0 600k -vf "drawtext=fontfile=font.ttf:text='Your Watermark Text':x=10:y=10:fontsize=24:fontcolor=white, scale=-1:360"  -b:a:0 64k \
-c:v:1 libx264 -crf 28 -preset faster -maxrate:v:0 3000k -vf "drawtext=fontfile=font.ttf:text='Your Watermark Text':x=10:y=10:fontsize=24:fontcolor=white, scale=-1:720" -b:a:0 64k \
-var_stream_map "v:0,a:0,name:360p v:1,a:1,name:460p" \
-f hls \
-hls_list_size 0 \
-threads 0 \
-hls_playlist_type event \
-hls_time 3 \
-hls_key_info_file ../keys/enc.keyinfo \
-hls_flags independent_segments \
-master_pl_name "output.m3u8" "output-%v.m3u8"

0

Your Answer

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

Browse other questions tagged or ask your own question.