Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques Extracting position from ffplay in real time

  • Extracting position from ffplay in real time

    Posted by James D’authreau on May 18, 2012 at 11:16 am

    Hope someone can help, I am wanting to make a simple trimmer using ffmpeg / ffplay (in windows), and I am stuck on how to get the position in seconds programmatically in real time whilst the video is running in ffplay, so I can use it to edit later. I know how to send stdout to a file, which can then be parsed, but that can only be done after the play finishes, so I guess i need to be able to send the stdout to a variable. Ideally I would like to do this in a command line, but open to other ideas!

    James D’authreau replied 14 years ago 2 Members · 4 Replies
  • 4 Replies
  • Reuben Martin

    May 20, 2012 at 3:58 am

    ffplay -vf showinfo myvideo.ext

  • James D’authreau

    May 20, 2012 at 1:07 pm

    Thanks, that shows the necessary info on the command line, however what I am struggling with is how to take the data and do something with it programmatically.

  • Reuben Martin

    May 21, 2012 at 1:59 am

    Redirect stderr output to whatever you plan to use to parse the text output. Please note that if you are trying to do this on windows, that A) You must enjoy pain and B) You will need more then the standard DOS tools to implement something like that.

    If you were doing this on a *nix machine, you would direct stderr to a named pipe, then assign a file descriptor to the pipe to avoid blocking, and then access the file descriptor with a script of some sort to parse and act upon the stream of text.

  • James D’authreau

    May 23, 2012 at 9:35 am

    Glory be! thanks, unfortunately it has to be windows, I am playing about using autohotkey, a scripting tool which can call dlls, hopefully eventually I will sort it

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy