Samstag, 3. Mai 2014

speed up mp4/mp3 with ffmpeg


you may need to download latest ffmpeg
if there are issues with ffmpeg filter options.

szenario: You're having some training videos (mp4) and want to listen to them faster.

Option #1: mp4 to mp3, and speedup (in one step):

create mp3 from mp4 and change the tempo while doing this.
ffmpeg -i input.mp4  -filter:a "atempo=1.8" output.mp3 

Option #2: speedup video (no mp3 conversion):

create mp4 and double the tempo
ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mp4

For more information, visit: https://trac.ffmpeg.org/wiki

Sonntag, 16. März 2014

convert pdf

note: you need to install imagemagick and ghostscript first

convert multiple png to one pdf


convert page1.png page2.png output.pdf
or simply
convert page*.png output.pdf 

src: http://stackoverflow.com/a/8955465

hint: 
lets say you'd like your oldest file (page01.png) to be the last page in output.pdf.
you can reverse the order of files:
convert page* -reverse output.pdf

reduce filesize of pdf


...via ghostscript

gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sOutputFile=output.pdf input.pdf

src: http://www.virtualzone.de/2012/11/how-to-reduce-pdf-file-size-in-linux.html


fyi: you can change /screen to /printer for better quality

join multiple pdf files into one file


 ...via ghostscript

gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf in3.pdf ...

...via pdftk

pdftk file1.pdf file2.pdf cat output -

...via pdfsam

pdfsam-console -f 1.pdf -f 2.pdf -o ./output.pdf concat

reverse page order

pdftk in.pdf cat end-1 output out.pdf