VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 33
Thread
  1. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    Hi all !

    Don't know if I'm at the right place, but I reckon it's more of a programming matter than one of FFmpeg or video encoding, sooo...

    I want to recompile my FFmpeg with the libavfilter source. Because I want, long story short, to be able to watermark videos via FFmpeg, and the libavfilter is the new way to go about this. The thing is, being a multimedia guy but not much of a computer guy, I don't even understand what "recompile my FFmpeg with the libavfilter source" means. That gives you an idea how lost I am.

    So here's how it's supposed to work. I accessed a SVN where I took a bunch of files, including a README that explained the following :
    1) execute the checkout.sh script (the checkout.sh file was amongst the files I found on the SVN)
    2) change directory to ffmpeg (that would be "cd c:\ffmpeg") and run configure with --enable-avfilter
    3) make
    4) run it!

    So. I'm working with Windows XP, and almost all the pertinent documentation I found about .sh files was adapted to Linux. So I don't know how to execute that kind of file. It's supposed to update my FFmpeg and installing necessary avfilter files. Here's a transcript of the .sh file :
    Code:
    #! /bin/sh
    
    echo "checking out pristine ffmpeg"
    svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk/ ffmpeg -r25741
    
    echo "downloading the corresponding version of swscale"
    cd ffmpeg/libswscale
    svn up -r32571
    cd ../..
    
    echo "patching ffmpeg"
    for diff in $(ls $(pwd)/diffs/*.diff); do patch -d ffmpeg -p0 -i $diff; done
    
    echo "copying files to libavfilter"
    cp                      \
        vf_drawtext.c       \
        vf_fade.c           \
        vf_fps.c            \
        vf_negate.c         \
        vf_overlay.c        \
        vf_rotate.c         \
        vf_split.c          \
        vsrc_movie.c        \
        ffmpeg/libavfilter
    First problem of all, since I don't know how to execute the file directly, I tried entering every line manually. Didn't work, for the first real command (starting with "svn checkout") won't be recognized by the commend prompt. So, lost I am...

    I'm trying to be as clear as I can to make the job easier for you all, so sorry if the text gets a little longish...
    But any clue as to what to do, what programs to use or where to get more info would be greatly appreciated !

    And don't hesitate to tell me if the question sounds unclear or if any useful info is missing, I'll post back ASAP.

    Regards, and thanks a lot !
    Quote Quote  
  2. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    I've already seen that before... I don't like this Wiki very much.
    It says right off the start it is a Wiki for FFmpeg on Windows, and a few lines later, they say "Oh, well, in fact you'll need Ubuntu installed on your PC and then we'll tell you how to install it on Ubuntu. Oh, but if you insist on being a Windows-loser... err, user (which is slower and harder because it's not Linux) then go to this site 'cause WE won't help you much, cause that was our original goal but we gave it up 'cause Linux is just better."
    Well, ok, that's not exactly what they say, but that's how it sounds to my ears.
    Bah, doesn't matter. I'll see what I can get out of it. Thanks !
    Quote Quote  
  3. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by Klagar View Post
    I want to recompile my FFmpeg with the libavfilter source. Because I want, long story short, to be able to watermark videos via FFmpeg, and the libavfilter is the new way to go about this.
    Where did you get your existing ffmpeg binary from, and what version is it? Recent versions of ffmpeg for Linux have avfilter enabled as standard. I'm surprised there isn't a Windows binary available with avfilter enabled.

    Have you tried the links on this page:
    https://www.videohelp.com/tools/ffmpeg
    particularly the one pointing to sourceforge:
    http://sourceforge.net/projects/mplayer-win32/files/FFmpeg/

    Compiling software is a difficult process (from my own experience). I would certainly try and track down some ready made binaries before attempting to make your own.

    Here's a transcript of the .sh file:
    That script is designed to run on the 'bash' shell - so it won't work on a standard Windows machine.
    Quote Quote  
  4. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    Hi intracube !

    Honestly I don't even remember where I got my FFmpeg from, I looked for it for so long and finally got the binary of the last SVN version, that is, SVN-r25669.
    But you know what ? I think you're right. I believe I have libavfilter enabled. And you don't know how silly I feel right now ! Hahaha !
    Code:
    configuration: --enable-gpl --enable-version3 [...] --enable-memalign-hack
    libavutil     50.32. 6 / 50.32. 6
    [...]
    libavdevice   52. 2. 2 / 52. 2. 2
    libavfilter    1.54. 0 /  1.54. 0
    libswscale     0.12. 0 /  0.12. 0
    FFmpeg SVN-r25669
    libavutil     50.32. 6 / 50.32. 6
    [...]
    libavdevice   52. 2. 2 / 52. 2. 2
    libavfilter    1.54. 0 /  1.54. 0
    libswscale     0.12. 0 /  0.12. 0
    That DOES mean it is enabled, right ?
    I'm gonna run some tests.
    If it works, I go to the church and light a candle even though I'm not that much of a believer !
    Quote Quote  
  5. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    Ok I got the libavfilter to work, although now I'm missing some spiecific filters, including vf_overlay. I've searched everywhere for a way to include it in my FFmpeg, but either they require that I have VirtualBox with Ubuntu (cause I'm a Windows-b**ch :P) or that I download files that are no longer available on SourceForge, or that I take a thousand other steps that don't seem at first sight to have much related to what I want to do...
    Is there any way for me to find a working version of the latest FFmpeg with vf_overlay in it and working ? I am willing to look for information but I feel I'm losing my time right now since there are a bazillion solutions but none of them is adapted to my settings, my needs, my machine, my FFmpeg, my whatever. And I'm not expert enough to take the software and go like "Oh, sure, I'll make if work on my SNES, because I can !" like some people seem to be all about...

    Thanks as always, I just hope I get out of this mess eventually ! :S
    Quote Quote  
  6. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    Where I stand, one thing that prevents me from progressing is I can't put my hand on the file bash-2.05b-MSYS.tar.bz2 that was once located there : http://prdownloads.sourceforge.net/mingw/bash-2.05b-MSYS.tar.bz2?download
    Maybe someone still has it (or something similar) somewhere and could share it ?
    I'm following the hereby tutorial : http://www.gooli.org/blog/building-ffmpeg-for-windows-with-msys-and-mingw/
    Have no idea if it's the best solution, but I figure there's no ideal scenario for me since I refuse to use any Linux-related thingies...
    Quote Quote  
  7. another approach would be to use avisynth + ffmpeg to do your watermarking, since you "refuse to use any Linux-related thingys"

    you can make batch avs scripts, batch encode etc...

    You don't even have to use ffmpeg, you could use other applications depending on what your format goals were
    Quote Quote  
  8. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    Actually that's what we're currently doing.
    The thing is we have an infinity of videos to encode rapidly, and we could use a tool that does encoding and watermarking at the same time. That would allow us to free a LOT of human time that could be exploited elsewhere.

    And also, a lot of watermarking is done automatically, with no human intervention. So it'd be better if the machine in charge of that operation didn't have to use two or three softwares to do its work...

    Especially considering that such a solution DOES exist, I am just apparently too retarded (:P) to get it to work...
    Thanks for the suggestion, oftentimes that's exactly what one needs instead of banging its head eternally against some eluding issue...
    Quote Quote  
  9. You can download precompiled binaries with libavfilter.

    These have had libavfilter for a few months:

    http://ffmpeg.arrozcru.org/autobuilds/


    EDIT: it doesn't seem to have vf_overlay (I've never heard of it, and it's NOT in the official documentation either)
    http://ffmpeg.org/libavfilter.html
    Last edited by poisondeathray; 16th Nov 2010 at 14:59.
    Quote Quote  
  10. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    You are right, and it worked fine until there. For an unknown reason, there are many missing filters in the library. The one I need, I think, is vf_overlay, which is used to do watermarking.
    I use a command line I found on the web that includes the instruction :
    Code:
     -vf "movie=0:png:EA_Watermark_transparent.png [wm];[in][wm] overlay=0:0:1 [out]"
    and I get the errors :
    No such filter: 'movie'
    Error opening filters!

    And it's frustrating that they don't have THE ONE filter I actually need :( Everything would be quite fine, weren't of this.

    Unless I have made a mistake in my command's formulation ? But I doubt it. Many sources on the web seem to agree on this particular syntax.
    Quote Quote  
  11. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by Klagar View Post
    Where I stand, one thing that prevents me from progressing is I can't put my hand on the file bash-2.05b-MSYS.tar.bz2 that was once located there : http://prdownloads.sourceforge.net/mingw/bash-2.05b-MSYS.tar.bz2?download
    Maybe someone still has it (or something similar) somewhere and could share it ?
    This file contains bash.exe and sh.exe:
    http://sourceforge.net/projects/mingw/files/MSYS/BaseSystem/bash/bash-3.1.17-4/bash-3.....lzma/download

    My version of ffmpeg doesn't have the 'overlay' or 'movie' filters, either.
    Quote Quote  
  12. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    mplayer/mencoder might also be an option, (it's available for Windows). I've just followed this:
    http://wiki.showmedo.com/index.php/Video_editing_Ubuntu#Logo

    and managed to produce this:
    Click image for larger version

Name:	mtw_overlay_test_02.jpg
Views:	2365
Size:	45.6 KB
ID:	4234
    Quote Quote  
  13. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    @intracube : Thanks so much for the files ! I'll keep on trying to rebuild my version and see what happens...
    Though you're giving me a pause here. You say you don't have the overlay and movie filters either ? Do you mean you're able to do the watermarking thing anyways ? That would trouble me...

    @poisondeathray : Thanks a lot for the links. I had already seen the first one, and partly followed it, but it counted among the solutions I couldn't follow because of lack of files. But with what intracube gave me, that might become a viable solution. I'll see to it. The second link, I haven't seen before. I'll make sure to read it !

    Thanks again as always, I'll keep you posted about the results soon !
    Quote Quote  
  14. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by Klagar View Post
    Do you mean you're able to do the watermarking thing anyways ?
    Not with ffmpeg. With mplayer/mencoder using the bmovl filter.
    Quote Quote  
  15. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    Still trying to recompile FFmpeg.

    1. I take the files from svn://svn.ffmpeg.org/soc/libavfilter ; I copy them all in c:/ffmpeg/libavfilter/ ;
    2. I run msys.bat located in c:/msys/1.0/ and enter the command :
    Code:
    myComputer@mycomputer /c/ffmpeg/libavfilter
    $ checkout.sh
    Here's what I get :
    Code:
    $ checkout.sh
    checking out pristine ffmpeg
    ./checkout.sh: line 4: svn: command not found
    downloading the corresponding version of swscale
    ./checkout.sh: line 8: svn: command not found
    patching ffmpeg
    patching file configure
    Hunk #1 FAILED at 170.
    Hunk #2 FAILED at 885.
    Hunk #3 FAILED at 1030.
    Hunk #4 FAILED at 1405.
    Hunk #5 FAILED at 2666.
    Hunk #6 FAILED at 2750.
    6 out of 6 hunks FAILED -- saving rejects to file configure.rej
    patching file libavfilter/Makefile
    Hunk #1 FAILED at 3.
    Hunk #2 FAILED at 25.
    Hunk #3 FAILED at 46.
    3 out of 3 hunks FAILED -- saving rejects to file libavfilter/Makefile.rej
    patching file libavfilter/allfilters.c
    Hunk #1 FAILED at 45.
    Hunk #2 FAILED at 66.
    2 out of 2 hunks FAILED -- saving rejects to file libavfilter/allfilters.c.rej
    can't find file to patch at input line 5
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |Index: doc/filters.texi
    |===================================================================
    |--- doc/filters.texi   (revision 25741)
    |+++ doc/filters.texi   (working copy)
    --------------------------
    File to patch:
    And I don't know what to enter as file to patch.
    I had to tweak my checkout.sh to get this far, here's its actual content :
    Code:
    #! /bin/sh
    
    echo "checking out pristine ffmpeg"
    svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk/ ffmpeg -r25741
    
    echo "downloading the corresponding version of swscale"
    cd c:/ffmpeg/libswscale
    svn up -r32571
    cd ../..
    
    echo "patching ffmpeg"
    for diff in $(ls c:/ffmpeg/libavfilter/diffs/*.diff); do patch -d ffmpeg -p0 -i $diff; done
    
    echo "copying files to libavfilter"
    cp                      \
        vf_drawtext.c       \
        vf_fade.c           \
        vf_fps.c            \
        vf_negate.c         \
        vf_overlay.c        \
        vf_rotate.c         \
        vf_split.c          \
        vsrc_movie.c        \
        ffmpeg/libavfilter
    I just don't know what else to try. It seems so easy when other people on forums do it...
    Quote Quote  
  16. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by Klagar View Post
    Still trying to recompile FFmpeg.
    Code:
    $ checkout.sh
    checking out pristine ffmpeg
    ./checkout.sh: line 4: svn: command not found
    downloading the corresponding version of swscale
    ./checkout.sh: line 8: svn: command not found
    The script is saying it can't find the program 'svn'. Either you haven't installed it on your system, or it isn't in your path, (the script doesn't know where to find it).
    http://subversion.apache.org/packages.html
    It's trying to download the ffmpeg sources, but you say you've done that manually.

    I'm not sure where you've got checkout.sh from, or what you're trying to do exactly, but the 'patch' program is also failing and asking you which files you want to patch. This is a wild guess, but if you're trying to add additional filters to ffmpeg, changes to allfilters.c and the libavfilter Makefile need to be made before compiling. The error might relate to that.
    See the second post here:
    http://ffmpeg.arrozcru.org/forum/viewtopic.php?f=8&t=1400
    Quote Quote  
  17. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    Ok I figured out something. I can't for my life remember exactly what I did. I tried many things from installing VirtualBox + Ubuntu to kicking my hard drive till I hallucinated it was bleeding, and then I changed a couple parameters in checkout.sh and in makefile and in allfilters.c and other files, and I succeeded compiling my FFmpeg. Now when I run ffmpeg -filters, I get :
    Code:
    Filters:
    anull            Pass the source unchanged to the output.
    anullsrc         Null audio source, never return audio frames.
    anullsink        Do absolutely nothing with the input audio.
    aspect           Set the frame aspect ratio.
    [...]
    vflip            Flip the input video vertically.
    overlay          Overlay a video source on top of the input.
    split            (null)
    buffer           Buffer video frames, and make them accessible to the filterchain.
    color            Provide an uniformly colored input, syntax is: [color[:size[:rate]]]
    [...]
    I think overlay and split are the two important things here. I hope I'm right.
    Well for now another issue has arisen : when I enter a command line that has -vcoder libx264, I get the error :
    Unknown encoder 'libx264'
    WMVs seem to encode normally. I haven't tested yet on other formats.
    Someone know a quick way to put back libx264 in the software so I may think about something else at last ??? :S
    We're approaching the end of this and I feel happy !
    Quote Quote  
  18. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by Klagar View Post
    Well for now another issue has arisen : when I enter a command line that has -vcoder libx264, I get the error :
    Unknown encoder 'libx264'
    It looks like ffmpeg didn't compile with libx264. It can usually be enabled by appending a flag to ./configure
    libx264 should already be in the ffmpeg source tree that you got via svn, so only follow steps 3 onwards at the 'Install ffmpeg' section of this page:
    http://www.saiweb.co.uk/linux/ffmpeg-install-with-libx264-h264

    Before you go to the trouble of re-compiling, it's worth checking to see if any other video/audio codecs you might want are missing. My version of ffmpeg seems to have the following as 'optional extras':
    --enable-libmp3lame --enable-libvpx --enable-libx264 --enable-libvorbis --enable-libtheora --enable-libxvid --enable-postproc --enable-libschroedinger --enable-libdirac --enable-libgsm --enable-avfilter
    Append them immediately after ./configure
    Quote Quote  
  19. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    In what folder must I put the libx264 files ?
    I followed the steps in the link you gave me (thanks, btw) and I could install x264.exe neatly. But when I go to the ffmpeg folder and run ./configure --enable-libx264 it keeps telling me ERROR : libx264 not found.
    I tried moving all the files from the x264 folder into my ffmpeg root folder, but to no avail.
    Quote Quote  
  20. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    Other note, that might be the issue here...
    In fact when I was done installing x264, I couldn't run ldconfig cause it gave me the error : sh: ldconfig: command not found.
    Quote Quote  
  21. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by Klagar View Post

    So. I'm working with Windows XP!
    Are you now using a Linux OS?
    Quote Quote  
  22. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    Nop, I tried installing Ubuntu on VirtualBox, but the tutorials made it clear that I needed the 64 bits version, and this version won't install at all, although the 32 bits does. I tried following the steps with the 32 bits anyways, but to no avail. So I came back to Windows.
    Quote Quote  
  23. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by Klagar View Post
    So I came back to Windows.
    The link in post #20 says:-

    http://www.saiweb.co.uk/linux/ffmpeg-install-with-libx264-h264
    Quote Quote  
  24. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    I saw that, and also saw that the title said :
    ffmpeg installation on RHEL 4
    But oftentimes tutorials say that the steps are nearly the same for Linux and Windows, and so I gave it a try. And being less than a beginner at Linux I don't know what is supposed to be a Linux-exclusive command and what is only a command that works with a particular software even though not "windows-standard".
    Also, I thought maybe intracube had just found a method that happened to work on Windows as well as the intended Linux. I like to try before assuming it won't work.
    So I now presume that method just won't work. So I'm back at the start for that step ? Too bad, seemed full of promise...
    Last edited by Klagar; 22nd Nov 2010 at 13:31. Reason: More details
    Quote Quote  
  25. Member
    Join Date
    Sep 2007
    Location
    Europe
    Search PM
    Todays win32 autobuild (SVN-r25793) includes the overlay filter.

    http://ffmpeg.arrozcru.org/autobuilds/

    Look at the libavfilter.html in the doc folder for the details and examples. Don't ask me how to use it. It's rather new to me too.
    Quote Quote  
  26. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    Well now I'm just trying again to reinstall the whoooole thing using the steps provided here : http://ffmpeg.arrozcru.org/forum/viewtopic.php?f=8&t=1400
    It works great, except that libx264 refuses to install. As I ./configure --enable-libx264 (with other parameters I shall omit here) I get the error :
    libx264 is gpl and --enable-gpl is not specified.
    So I declare ./configure --enable-libx264 --enable-gpl --enable-memalign-hack (and all the same other parameters) and I get another error :
    ERROR: libx264 not found.
    It also gives me similar errors for libmp3lame, libtheora, and libvorbis. I haven't tried all possible libs yet.

    Are there files I am missing here ? If so, what are they and where do I have to put them before re-running a configure ?
    Quote Quote  
  27. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    The files Chris K suggested seem fine : indeed, looks like some filters, including overlay, split and fifo, have been added to the core autobuild since november 15th !

    Alas, I tried watermarking, and I believe there is still the filter "movie" missing.
    Thus the reason why I'm trying to do it all back from the start. I don't just want it to work, I want to understand why it does or doesn't. Already I understand much better what I'm doing.

    In great part thanks to you guys
    Quote Quote  
  28. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by bat999 View Post
    http://www.saiweb.co.uk/linux/ffmpeg-install-with-libx264-h264
    Of course. However Klagar has installed a set of Linux tools for Windows, and is using using the documentation as rough guidance.

    Klagar, I think your going to keep hitting roadblocks due to Linux/Windows differences. In one of your previous posts you mention 'error : sh: ldconfig: command not found'. This is because the shell can't find ldconfig. 'ERROR: libx264 not found' is probably because you haven't got the development libraries for libx264 on your system - same for libmp3lame, libtheora, and libvorbis.
    I feel like I'm flying blind, as I rarely use Windows. Why not take a look at avisynth + ffmpeg, which poisondeathray suggested? It looks like it'll do exactly what you want.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!