0

Is there a way to extract scene change information from a video file using XVid in Python? For example: I have an .mkv file, and I need to get a .log scene change file (Xvid 2nd pass stat file) to use for subtitles timing. SCXvid can create such files, but I'd like to do this in Python if possible.

The reason why I need this is because the only way to do it on Linux is to use SCXvid-standalone which requires y4m files, and I need to use files in their original format.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Ray P.
  • 875
  • 1
  • 9
  • 24
  • If ffmpeg [works](http://stackoverflow.com/a/40689366/5726027) for you... – Gyan Apr 14 '17 at 19:38
  • 1
    Your question is unclear. XVid is a library, so requiring the use of it is odd. MKV is a container. If you want to use ffmpeg, you can just launch another process from python with ffmpeg outputting your scene to the output buffer then writing it to a file in python. If you want to do it programmatically from python, please specify the encoding. In short, if it's mpeg encoded it should be fairly easy. on h.264 you can easily extract scenes with the limitation of extracting from i-frame to i-frame. H.262 (mpeg2) is even easier since there's no notion of b-frames – polo Apr 14 '17 at 19:44
  • I guess, I actually need to use Xvid, because it gives the most accurate scene change info (according to https://doki.co/support/doki-timing-guide/). I need to be able to open a file using ffmpeg, and then to write it to Xvid, generating a pass file. – Ray P. Apr 14 '17 at 20:00

0 Answers0