#!/usr/bin/env pf # Using an external movie player (ffmpeg/mencoder) for input -> transcoding "broken. see 'demo/rawvideo.pf'" . cr FIXME load-image load-blit load-lqt variable stream # the stream object "/tmp/movie.mpg" variable! movie # movie file name # see wrapper scripts in libpf/bin # these take one argument (movie file) and dump i420 320x240 to stdout "pf-rawvideo.ffmpeg" # "pf-rawvideo.mencoder" constant pf-rawvideo : open dup movie ! # save movie filename pf-rawvideo 2 pack # build command line "r" open-program stream ! ; # open stream "( name -- )\tOpen movie file." doc : grab ` bitmap/i420/320/240 stream @ read-raw-packet # grab raw bitmap from stream >image ; # convert to image "( -- image )\tGrab next frame." doc : cycle grab blit 33. sleep ; : tv ' cycle is tick ; : loop-tv { try cycle recover drop movie @ open endtry } is tick ; "\nRaw video input demo\n\n" . "open\t" . help open "grab\t" . help grab "\n" . # "/tmp/video.mpg" open tv interactive