0

I want to track a moving object on a video using swistrack. https://en.wikibooks.org/wiki/SwisTrack

I will use a simple background subtraction algorithm for that. Therefore, I need a snapshot of the first frame of my movie. The movies are in .avi format, and I have tried taking snapshots using GNOME player and Mplayer (on ubuntu) and VLC player (on Windows). However, I always bump into the same problem: my movie has dimensions 720 x 576 and any screenshot I take has dimensions 768 x 576. This makes background substraction impossible and it makes swistrack complain.

I have no idea what is going wrong here. Is it the movie format? I uploaded a movie and a screenshot on this URL so you could perhaps try it and see if you get the same results? https://perswww.kuleuven.be/~u0065551/movies_and_snapshots/

The thing is I want to batch process my video's using e.g. Mplayer, always automatically saving a movie in its folder together with the snapshot of the first frame, and the mask that it makes from it, so I can very easily read that in with swistrack.

Thanks a lot for your help!

  • Instead of taking screenshots in GNOME, you can use ffmpeg to extract the frames you need from the video. – Zaphod Jul 26 '13 at 09:37
  • Hi Zaphod, Thanks for that! It works indeed. Any idea why the other programs do this weird thing? Cheers – Goat-Anti-Rabbit Jul 26 '13 at 11:45
  • Seems to me like these programs are trying to maintain a 4:3 aspect ratio, and they scale/crop the image accordingly. I haven't used them before, but there may be a setting or a way to remove this restriction and work on the video using its original aspect ratio. – Zaphod Jul 26 '13 at 12:55

0 Answers0