Skip to content

Jupyter notebook, ffmpeg, shell commands

“ffmpeg -i input-video.avi -vn -acodec copy output-audio.aac

Execute Shell Commands from Jupyter Notebook

Section titled “Execute Shell Commands from Jupyter Notebook”

`%%cmd

or

“!

for moviefile in os.listdir("./"):

`if moviefile.endswith(".mp4"):`
`inputfile = moviefile`
`outputfile = moviefile + ".aac"`
`if os.listdirtdir command = 'ffmpeg -i ' + inputfile + ' -vn -acodec copy ' + outputfile`
`!{command}`

`find . -name ”.DS_Store” -type f -print

`find . -name ”.DS_Store” -type f -delete

`find . -name ”*.DS_Store” -delete

`find . -type d -empty -print

`find . -type d -empty -delete

`find . -mindepth 2 -maxdepth 2 -type d -print

`find . -mindepth 2 -maxdepth 2 -type d -exec echo mv {} . ;

`find . -name ”.DS_Store” -type f -delete && find . -type d -empty -delete

Find All Files that Don’t Have One of a Set of Extensions

Section titled “Find All Files that Don’t Have One of a Set of Extensions”

`find . -type f -print | grep -vE ”.(jpg|png)$“

Update All Photos’ Date Created and Modified to Date Taken

Section titled “Update All Photos’ Date Created and Modified to Date Taken”

`exiftool “-filemodifydate<datetimeoriginal” “-filecreatedate<datetimeoriginal” DIR

  1. Download organize: https://[GitHub](../Organizations/GitHub.md).com/tfeldmann/organize
rules:
- locations: ~/Pictures
filters:
- extension:
- .jpg
- .raf
- exif
actions:
- move: ~/Pictures/Sorted/{exif.exif.datetimeoriginal.year}/{exif.exif.datetimeoriginal.month}/

Generate a List of Sequential URLs and Automatically Copy Them to the MacOS Clipboard

Section titled “Generate a List of Sequential URLs and Automatically Copy Them to the MacOS Clipboard”
echo https://www.example.com/file-{001..010}.html | pbcopy