PDA

View Full Version : How I can put text on the streaming with ffmpeg?


hakursa
08-04-2016, 05:00 PM
Hello, I stream with this command with ffmpeg:
ffmpeg -re -i "http://CDN12_eu.sababatv.com:80/C18/smil:C18.smil/playlist.m3u8?token=d0b7bcc5-3c6b-46b3-9118-67a436fdefbb" -framerate 25 -vcodec h264 -video_size 720x480 -c:v libx264 -preset veryfast -maxrate 1000k -bufsize 2548k -pix_fmt yuv420p -c:a libmp3lame -b:a 96k -ar 44100 -f flv "rtmp://cdn.pubzony.com/stream/exampled?key=db6c5424&id=3055"

My question is if someone can join to this code the command to put a line of white text and black shadow on the center-top of the screen?

If someone can send the new code with this command inside (you can write in text: test test test test and I'll change it by myself), I'll be really thankful.

Thanks.

j3443694
08-05-2016, 04:09 AM
use "drawtext" in the ffmpeg

for example :
ffmpeg -i input.mp4 -vf drawtext="fontfile=/path/to/font.ttf: \
text='Stack Overflow': fontcolor=white: fontsize=24: box=1: boxcolor=black@0.5: \
boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2" -codec:a copy output.mp4

http://i.stack.imgur.com/Kvdxk.jpg

hakursa
08-05-2016, 12:59 PM
Hey, Thank you for your answer.
I already saw this code in stackoverflow, but I don't know how to combine this code with my code - that's why I posted the topic here.

Could you please do it for me?
Thank you a lot!