Skip to content

Instantly share code, notes, and snippets.

@benjohnde
Last active May 28, 2019 12:54
Show Gist options
  • Save benjohnde/6ec22c91f4562103cae47593d9b6719b to your computer and use it in GitHub Desktop.
Save benjohnde/6ec22c91f4562103cae47593d9b6719b to your computer and use it in GitHub Desktop.
#!/bin/bash
for ppt in *.ppsx
do
mkdir tmp
cd tmp
unzip ../$ppt
sed -i '' 's/slideshow/presentation/' \[Content_Types\].xml
sed -i '' 's/x-ms-wmv/mp4/' \[Content_Types\].xml
sed -i '' 's/wmv/mp4/' \[Content_Types\].xml
cd ppt/media
for f in *.wmv; do ffmpeg -i $f -c:v libx264 ${f%%.*}.mp4; rm $f; done
cd ../slides/_rels
for f in *.xml.rels; do sed -i '' 's/\.wmv/\.mp4/g' $f; done
cd ../..
sed -i '' 's/<p:modifyVerifier[ a-zA-Z0-9\"=/+]*\/>//' presentation.xml
cd ..
zip -r ../${ppt%%.*}-umgewandelt.pptx .
cd ..
rm -rf tmp
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment