Dealing with MIME types

Apparently, to get txt and m files to upload, you need to do the following:

add a function to functions.php (tucked away in local_install_dir/wordpress/wp-content/themes/my_current_theme/):

add_filter(‘upload_mimes’,'add_custom_mime_types’);
function add_custom_mime_types($mimes){
return array_merge($mimes,array (
‘ac3′ => ‘audio/ac3′,
‘mpa’ => ‘audio/MPA’,
‘flv’ => ‘video/x-flv’,
‘svg’ => ‘image/svg+xml’
));
}

and

add_filter(‘upload_mimes’,'remove_mime_types’);
function remove_mime_types($mimes){
unset( $mimes['mp4'] );
}

Posted in Uncategorized | Comments Off

ffmpeg & gst-launch commands

video camera:
gst-launch -v v4l2src ! video/x-raw-yuv,width=640,height=480,framerate=30/1 ! ffmpegcolorspace ! ximagesink

video capture:
ffmpeg -y -f alsa -i plughw:CARD=Mic,DEV=0 -f x11grab -r 30 -s 1830×1030 -i :0.0+0,26 -acodec ac3 -vcodec libx264 -vpre lossless_ultrafast -threads 0 abwcomm_V1_pid.mkv

padding:
ffmpeg -y -i abwcomm_V1_pid.mkv -vf pad=1920:1080:50:25 -vcodec libx264 -acodec ac3 -vpre lossless_ultrafast output.mkv

convert to ipad format using quicktime on mac. ffmpeg can do it, but finding the toggles takes more time than using a conversion product.

Posted in Uncategorized | Comments Off

Ghostscript Stuff

printing only specified pages from a pdf file
gs -sDEVICE=pdfwrite -dFirstPage=a -dLastPage=b -sOutputFile=mynewfile.pdf myoldfile.pdf

splicing two pdf files together
gs -sDEVICE=pdfwrite -sOutputFile=mynewfile.pdf myoldfile1.pdf myoldfile2.pdf

general options that make life more easy
-dNOPAUSE %you don’t have to hit enter between pages
-dQUIET %you won’t see output from gs
-dBATCH

Posted in Uncategorized | Comments Off