0 Members and 1 Guest are viewing this topic.
#!/bin/sh[ -z ${1} ] && echo "Usage: $(basename $0) <filename>" && exit||filename=${1}duration="$(ffmpeg -i $filename 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,// | cat)";seconds="$(echo $duration | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }' | sed 's/[,]/./')";framerate=40;framesd="$(echo "$framerate*$seconds" | bc)";frames=${framesd%.*}for i in $(seq 0 $frames); do time="$(echo " scale = 3; result = $i/$framerate; if (0 < result && result < 1) { print "0" } print result; " | bc)"; echo $time; ffmpeg -vframes 1 -ss $time -i $filename -f image2 pipe: | convert - -resize 128x64\! -ordered-dither o3x3 pbm:- | sed '1,3d' | cat >> demo.cuv;done;
Yeah but your previous post seemed like it made it look like it caused more troubles for us to figure out how the Prizm RAM works...
After some experiments i wrote a short bash script for converting an avi file to a cuv file (for the video player). It doesn't have audio support and the used dither is not the best one can think of. It uses ffmpeg, image-magick and bc.In my tests (in the SDK) the audio (played from the original video) gets asynchron, so the framerate is probably wrong* converts Wall-E for viewing it in his Math lessons... Code: [Select]#!/bin/sh[ -z ${1} ] && echo "Usage: $(basename $0) <filename>" && exit||filename=${1}duration="$(ffmpeg -i $filename 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,// | cat)";seconds="$(echo $duration | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }' | sed 's/[,]/./')";framerate=40;framesd="$(echo "$framerate*$seconds" | bc)";frames=${framesd%.*}for i in $(seq 0 $frames); do time="$(echo " scale = 3; result = $i/$framerate; if (0 < result && result < 1) { print "0" } print result; " | bc)"; echo $time; ffmpeg -vframes 1 -ss $time -i $filename -f image2 pipe: | convert - -resize 128x64\! -ordered-dither o3x3 pbm:- | sed '1,3d' | cat >> demo.cuv;done;
Quote from: DJ Omnimaga on January 26, 2011, 02:06:22 amYeah but your previous post seemed like it made it look like it caused more troubles for us to figure out how the Prizm RAM works...It did, simply because it prevents easy RAM dumps. Now that we have the OS, it shouldn't be as much of a problem.