VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Hi

    I've a problem getting multiple filters to work with ffmpeg. Either filter on its own works fine.
    This filter adds static text to the videos right hand bottom and works fine-

    ffmpeg -i "D:\fcp_source\PlasmaSrc1\palmbeach.mpg" -vf
    drawtext="fontfile=arial.ttf:text='test_text':\ x=1250: y=700: fontsize=24:fontcolor=red" -b 6000k -s 1366x768 -vcodec wmv2 -an -y "D:\fcp_source\PlasmaSrc1\palmbeach.wmv"

    This filter burns in a watermark image at the bottom left and also works perfectly-

    ffmpeg -i "D:\fcp_source\PlasmaSrc1\palmbeach.mpg" -vf "movie=TWC_70x70.png:f=png [img]; [in] [img] overlay=17:H-h-19:1 [movie]; [movie] scale=1366:768"
    -b 6000k -s 1366x768 -vcodec wmv2 -an -y "D:\fcp_source\PlasmaSrc1\palmbeach.wmv"

    I've tried combining the filters with a comma like this-

    ffmpeg -i "D:\fcp_source\PlasmaSrc1\palmbeach.mpg" -vf "
    drawtext=fontfile=arial.ttf:text='test_text':\ x=1250: y=700: fontsize=24:fontcolor=red, movie=TWC_70x70.png:f=png [img]; [in] [img] overlay=17:H-h-19:1 [movie]; [movie] scale=1366:768" -b 6000k -s 1366x768 -vcodec wmv2 -an -y "D:\fcp_source\PlasmaSrc1\palmbeach.wmv"

    but I receive an error of 'to many inputs specified for the movie filter'.
    What am I doing wrong and how can I do this?
    Trying to avoid two pases through ffmpeg.

    Regards


    Quote Quote  
  2. Member
    Join Date
    Sep 2007
    Location
    Europe
    Search PM
    "movie" is a filter name, you don't need to create a movie label. Here's a basic example of a filter chain that you perhaps can adapt. I am on Windows so have to give full file paths.

    Code:
    -vf "movie='f\:/x-test_videos/sting.pss':f=pss,scale=100:100 [img],[in]drawtext=fontfile='c\:/ttf-mgfx/adlibn.ttf':text='test_text':x=50:y=200:fontsize=48:fontcolor=red,[img] overlay=50:50,scale=720:576"
    The main source comes in at the preserved [in] label. Everything before the [in] label affects the "movie" source which you arbitrary labeled [img]. Everything after [in] affects the main source. At the second [img] label you overlay the "movie" source on the main source. You can add and/or change the order of the commands after the [in] label.

    Hope this helps a bit.
    Quote Quote  
  3. Thanks Chris
    That clarified things a lot. I should have mentioned that I have little understanding of ffmpeg commands and was basically cutting and pasting other peoples solutions...

    Anyway, with your guidance I have come up with the following command line which does what I want and may help someone else.

    ffmpeg -i "source.mpg" -vf "movie=source.png:f=png [img], [in]drawtext=fontfile=arial.ttf:text='test_text'=1267:y=719:fontsize=14:fontcolor=yellow,[img] overlay=17:H-h-19:1" -b 6000k -s 1366x768 -vcodec wmv2 -an -y "destination.wmv"

    This places a png image at the bottom left and some text at the bottom right. Screen reso is 1366x768.

    Many thanks Chris
    Appreciate your help.
    Quote Quote  
  4. hello friends!!

    I try the code and works perfect!

    but I want to do this

    ffmpeg.exe -threads 8 -async 2 -i 01.mpg -sws_flags area -vf yadif=0:-1,scale=0:0,crop=472:480:4:0,scale=480:272,setdar= 16:9 -vcodec libx264 -r 23.976 -vb 1000k -minrate 300k -maxrate 2500k -fpre "C:/FFmPeg/ffpresets/libx264-hq-pass2.ffpreset" -acodec libfaac -ab 64k -ar 48000 -ac 2 -pass 2 -passlogfile "C:/FFmPeg/log.log" -y teste.mp4

    and later where I apply your great tip?
    -vf "movie=logo.png:f=png [img], [in]drawtext=fontfile=arial.ttf:text='venda proibida documentário escolar!'=300:y=219:fontsize=14:fontcolor=yellow,[img] overlay=17:H-h-19:1"
    Last edited by gugaoforums; 6th Sep 2011 at 14:33.
    Quote Quote  
  5. Member
    Join Date
    Sep 2007
    Location
    Europe
    Search PM
    @Orinoco Womble

    Thanks for posting your working example! Seems to be useful already :)

    @gugaoforums

    Probably the best to put your first filter chain directly after the [in] label.

    yadif=0:-1,scale=0:0,crop=472:480:4:0,scale=480:272,setdar= 16:9

    -vf "movie=logo.png:f=png [img], [in]yadif=0:-1,scale=0:0,crop=472:480:4:0,scale=480:272,setdar= 16:9,
    drawtext=fontfile=arial.ttf:text='venda proibida documentário escolar!':x=300:y=219:fontsize=14:fontcolor=yellow , [img] overlay=17:H-h-19:1"

    This way you first deinterlace, crop and scale the source and then draw the text on it and overlay it with the logo.
    Quote Quote  
  6. Hello Chris!! thanks for share! works perfectly!!!

    Have some way to show the logo.png for each 15minutes.. and disapear.. the logo comes again.. and disapear..

    thanks for all!!
    Last edited by gugaoforums; 7th Sep 2011 at 02:07.
    Quote Quote  
  7. Way outside of my knowledge I'm afraid...
    Quote Quote  



Similar Threads