6

I'm having some trouble using lavfi within ffplay to apply filters.

I'm simply trying to pad one video, and overlay another video within the padded area.

My command and console output is as follows:

ffplay -f lavfi "movie=h:\test.mpg,pad=704:770:0:0[padded];movie=h:\test2.mpg[2];[padded][2]overlay=shortest=1:x=0:y=490[1]"

ffplay version N-69920-g8bc8001 Copyright (c) 2003-2015 the FFmpeg developers
  built with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-lib
modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en
able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
 --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-
libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
le-zlib
  libavutil      54. 18.100 / 54. 18.100
  libavcodec     56. 22.100 / 56. 22.100
  libavformat    56. 22.100 / 56. 22.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.100 /  5. 11.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[Parsed_movie_0 @ 0000000000399480] Failed to avformat_open_input 'd'
[lavfi @ 0000000000396a60] Error initializing filter 'movie' with args 'd:test.mpg'
movie=d:\test.mpg,pad=704:770:0:0[padded];movie=d:\test2.mpg[2];[padded][2]overlay=shortest=1:x=0:y=490[1]: No such file or directory

To simplify things, I get the same error when I try and simplify the command dramatically to:

ffplay -f lavfi "movie=d:/test.mpg"

I'm hoping that I'm simply using the wrong syntax to specify the files location here within lavfi.

llogan
  • 57,139
  • 15
  • 118
  • 145
occvtech
  • 1,700
  • 1
  • 14
  • 18

1 Answers1

6

Two things:

  • Your parentheses and quotes are wrong. You had "][1] at the end but that'd be one bracket too much, and you should close the quote at the very end only.

  • For Windows, you need to double-escape the colon in the movie filter. Otherwise, it'll be interpreted as an option-separator. I don't know why exactly, but ticket #2166 mentions it.

This should work:

ffplay -f lavfi "movie=d\\:/test.mpg,pad=704:770:0:0[padded];movie=d\\:/test2.mpg[2];[padded][2]overlay=shortest=1:x=0:y=490[1]"

slhck
  • 223,558
  • 70
  • 607
  • 592
  • OK, we're getting CLOSE!! I just tried a whole bunch of variations on the quotation marks, and nothing worked. I get the same error each time. However, I tried copying test.mpg to the `c:\users\user` directory (my current default cd), and now the command `ffplay -f lavfi "movie=test.mpg"` works. I can't seem to get it to launch from D (which is important for my needs), but it looks like we're getting close. Any other thoughts on how to format the path? Thanks again! – occvtech Apr 21 '15 at 18:44
  • 2
    Got it, see my updated answer. A double-backslash escape is what you need. – slhck Apr 21 '15 at 19:04
  • That did it!! Thanks for your help!! I do have another question though: I lose the ability to scrub through the video now using lavfi. I know this is because it is trying to add filters and decode on the fly. Is there anyway around this? Maybe through another filter... or by creating an index of some sort? Thanks again! – occvtech Apr 21 '15 at 19:10
  • As described in https://superuser.com/questions/569274/how-to-make-vf-movie-point-to-another-folder-in-ffmpeg/1512661#1512661 , this does not work in git bash under windows.What worked for me was: `ffplay -f lavfi "movie=\'d:/test.mpg\',....` – Oliver Zendel Dec 26 '19 at 17:09