[FFmpeg-user] Issue while burning text to a video , output is of hls and scaled

Aameer Rafiq Wani aameer.rafiq at gmail.com
Wed Feb 24 13:47:51 CET 2016

Hey Guys
I have been scratch my head on this. Let me start with my objective which
1. to use ffmpeg to convert a video for now in mp4 format (preferably any
format in future) to 4 different versions
360, 480, 720, 1080
I also have to maintain the aspect ratio , so i can change the height and
calculate width accordingly.
I was able to do this with this bash script:

#$VIDEO_ID = $1
#run script like this  e.g bash encoding_script.sh "3000"

echo "The ffmpeg encoding is starting "

#for -profile:v details are here- https://trac.ffmpeg.org/wiki/Encode/H.264,
for other options check, ffmpeg -h

mkdir -p ./videos/$1
ffmpeg -threads 4 -i $2 -profile:v baseline -level 4.0 -vf
scale="trunc(360*a/2)*2:360"  -start_number 0 -hls_time 10 -hls_list_size 0
-f hls videos/$1/index_$1_360_.m3u8

ffmpeg -threads 4 -i $2 -profile:v baseline -level 4.0 -vf
scale="trunc(480*a/2)*2:480"  -start_number 0 -hls_time 10 -hls_list_size 0
-f hls videos/$1/index_$1_480_.m3u8

ffmpeg -threads 4 -i $2 -profile:v baseline -level 4.0 -vf
scale="trunc(720*a/2)*2:720"  -start_number 0 -hls_time 10 -hls_list_size 0
-f hls videos/$1/index_$1_720_.m3u8

ffmpeg -threads 4 -i $2 -profile:v baseline -level 4.0 -vf
scale="trunc(1080*a/2)*2:1080"  -start_number 0 -hls_time 10 -hls_list_size
0 -f hls videos/$1/index_$1_1080_.m3u8

#creating a master playlist
echo "The ffmpeg encoding has ended\n"

cat << EOF > videos/$1/index_$1_master.m3u8

the next part of the problem is to add a indelible watermark  to the video
within a specified time interval. Now If I am correct I can achieve this in
many ways :

adding text over the video
adding subtitle over the video
or adding image over the video

the most promising among them seemed to be subtitles as if I am correct
would have allowed me to burn the text for at and for a specified time
interval but I wasnt able to achieve this I have tried many things like the
ones mentioned here in the stackoverflow question


and the corresponding chat:


so In short I wasn't able to build the ffmpeg player properly and neither
did some of the static builds work for me as is explained in the
stack-overflow question.
one stackoverflow user (http://stackoverflow.com/users/5726027/mulvya) with
some command over ffmpeg was kind enough and tried to help me but we were
not able to achieve the given objective.I even tried to build ffmpeg myself
couple of times but again wasnt able to get a working solution (for the
drawtext or subtitles with scaled hls video output ) So this is call for
help to all of you guys. I have been stuck on this for a while.Would really
appreciate any help in this regard.

Thanks for reading such a long email but I wanted to make sure I explain
the problem to maximize the chances of a working response.

email: aameer.rafiq at gmail.com
websites: aameer.github.io <aameer at github.io>
LinkedIn: http://in.linkedin.com/in/aameerwani
Current location: Bangalore  India.

More information about the ffmpeg-user mailing list