mirror of
https://github.com/amiaopensource/ffmprovisr.git
synced 2025-10-16 10:49:58 +02:00
Compare commits
41 Commits
v2017-04-0
...
v2017-05-0
Author | SHA1 | Date | |
---|---|---|---|
|
18e2c17ab4 | ||
|
e4309d6664 | ||
|
750810d392 | ||
|
b2a04d138f | ||
|
b53f6c9984 | ||
|
64a362314c | ||
|
2a71179776 | ||
|
77e346c067 | ||
|
b995fb05c5 | ||
|
d30741e378 | ||
|
e3b01e2aa8 | ||
|
750a763157 | ||
|
0a6e5a4a7a | ||
|
54a8ab6057 | ||
|
e762c7dc42 | ||
|
cb7f001444 | ||
|
89039f55b3 | ||
|
59e6c6d879 | ||
|
195bc5446e | ||
|
a1cc5a4428 | ||
|
58663a869f | ||
|
05d16367f0 | ||
|
9477bcfe0a | ||
|
ad439d3b78 | ||
|
736b01e426 | ||
|
57166fe61d | ||
|
ec26d2038a | ||
|
321d998b5a | ||
|
009670eed1 | ||
|
d3a941a725 | ||
|
d334d7b4de | ||
|
d08cf349f6 | ||
|
b5b06021b0 | ||
|
e0ceeb0d73 | ||
|
dc47dbc618 | ||
|
28ae979652 | ||
|
0e2a2c2bfe | ||
|
388b107a3f | ||
|
117ebf506d | ||
|
9356f9af93 | ||
|
4d2d5c7c81 |
BIN
img/16_32_abitscope.gif
Normal file
BIN
img/16_32_abitscope.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 450 KiB |
1041
index.html
1041
index.html
File diff suppressed because it is too large
Load Diff
38
readme.md
38
readme.md
@@ -1,33 +1,41 @@
|
||||
# [ffmprovisr](http://amiaopensource.github.io/ffmprovisr)
|
||||
|
||||
Repository of useful FFmpeg command lines for archivists! [AMIA hackday](http://wiki.curatecamp.org/index.php/Association_of_Moving_Image_Archivists_%26_Digital_Library_Federation_Hack_Day_2015) edition.
|
||||
Repository of useful FFmpeg command lines for archivists!
|
||||
|
||||
## What is this?
|
||||
|
||||
Project Objective: To facilitate better understanding of FFmpeg through collaborative sharing of useful scripts and detailed flag-level description of how each script works so archivists can copy-paste and produce their own scripts but also understand how and why they work.
|
||||
#### Project Objective
|
||||
|
||||
To facilitate better understanding of FFmpeg through collaborative sharing of useful scripts and detailed flag-level description of how each script works, so archivists can copy-paste and produce their own scripts, but also understand how and why they work.
|
||||
|
||||
## How do I see it?
|
||||
|
||||
Code stuff in the gh-pages branch (the default primary branch). Readme is right here. The site is live and lives on github pages. You can see it [here](http://amiaopensource.github.io/ffmprovisr), or you can download a [release](https://github.com/amiaopensource/ffmprovisr/releases) and use it locally.
|
||||
The code is found in the gh-pages branch (the default primary branch). Readme is right here. You can see the site live on [GitHub pages](http://amiaopensource.github.io/ffmprovisr), or you can download a [release](https://github.com/amiaopensource/ffmprovisr/releases) and use it locally.
|
||||
|
||||
## How do I contribute?
|
||||
|
||||
You are welcome to edit the codebase yourself or just supply the information and ask it to be added to the site.
|
||||
You are welcome to edit the codebase yourself, or just supply the information and ask it to be added to the site.
|
||||
|
||||
To contribute to this project directly (and more quickly), clone this repository and create a new branch (`git checkout -b your-branch-name`) and add or modify a new block in index.html. Then submit a pull request and someone can review and integrate your code. There is a commented-out sample available at the bottom of index.html that can be used to build your own block.
|
||||
#### Edit codebase
|
||||
|
||||
If you are having trouble with the coding it yourself or with github, feel free to [submit an issue](https://github.com/amiaopensource/ffmprovisr/issues) with the kind of command you would like to see added to the site.
|
||||
To contribute to this project directly (and more quickly), clone this repository and create a new branch (`git checkout -b your-branch-name`) and add or modify a new block in `index.html`. Then [submit a pull request](https://github.com/amiaopensource/ffmprovisr/pulls) and the maintainers will review and integrate your code. There is a commented-out sample block available at the bottom of `index.html` that can be as a guideline for your command.
|
||||
|
||||
#### Make a request
|
||||
|
||||
If you are having trouble with coding it yourself or with github, feel free to [submit an issue](https://github.com/amiaopensource/ffmprovisr/issues) with the kind of command you would like to see added to the site.
|
||||
|
||||
#### General help
|
||||
|
||||
If you want to help but don't have a new script to add, you can help us by testing out the scripts available, by refining or clarifying the documentation, or [creating an issue](https://github.com/amiaopensource/ffmprovisr/issues) for anything that sounds confusing and requires clarification.
|
||||
|
||||
## License
|
||||
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br />This <span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/InteractiveResource" rel="dct:type">work</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://amiaopensource.github.io/ffmprovisr/" property="cc:attributionName" rel="cc:attributionURL">ffmprovisr</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.<br />Based on a work at <a xmlns:dct="http://purl.org/dc/terms/" href="https://github.com/amiaopensource/ffmprovisr" rel="dct:source">https://github.com/amiaopensource/ffmprovisr</a>.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
You can read our contributor code of conduct [here](https://github.com/amiaopensource/ffmprovisr/blob/gh-pages/code_of_conduct.md).
|
||||
|
||||
## Maintainers
|
||||
|
||||
[Ashley Blewer](https://github.com/ablwr), [Katherine Frances Nagels](https://github.com/kfrn), [Kieran O'Leary](https://github.com/kieranjol) and [Reto Kromer](https://github.com/retokromer)
|
||||
|
||||
## Contributors
|
||||
* Gathered using [octohatrack](https://github.com/LABHR/octohatrack)
|
||||
|
||||
@@ -68,11 +76,17 @@ Repo: amiaopensource/ffmprovisr
|
||||
GitHub Contributors: 11
|
||||
All Contributors: 18
|
||||
|
||||
## AVHack Team:
|
||||
## AVHack Team
|
||||
|
||||
[Ashley Blewer](https://github.com/ablwr), Eddy Colloton, Rebecca Dillmeier, [Jonathan Farbowitz](https://github.com/jfarbowitz), Rebecca Fraimow, Samuel Gutterman, Kelly Haydon, [Reto Kromer](https://github.com/retokromer), Nicole Martin, [Katherine Frances Nagels](https://github.com/kfrn), [Kieran O'Leary](https://github.com/kieranjol), Catriona Schlosser, Ben Turkus
|
||||
[Association of Moving Image Archivists & Digital Library Federation Hack Day 2015](http://wiki.curatecamp.org/index.php/Association_of_Moving_Image_Archivists_%26_Digital_Library_Federation_Hack_Day_2015)
|
||||
|
||||
[Ashley Blewer](https://github.com/ablwr), [Eddy Colloton](https://github.com/eddycolloton), Rebecca Dillmeier, [Jonathan Farbowitz](https://github.com/jfarbowitz), [Rebecca Fraimow](https://github.com/rfraimow), Samuel Gutterman, [Kelly Haydon](https://github.com/kellyhaydon), [Reto Kromer](https://github.com/retokromer), Nicole Martin, [Katherine Frances Nagels](https://github.com/kfrn), [Kieran O'Leary](https://github.com/kieranjol), Catriona Schlosser, [Ben Turkus](https://github.com/bturkus)
|
||||
|
||||
## Sister projects
|
||||
|
||||
[Script Ahoy](http://dd388.github.io/crals/): Community Resource for Archivists and Librarians Scripting
|
||||
[sourcecaster](https://datapraxis.github.io/sourcecaster/): helps you use the command line to work through common challenges that come up when working with digital primary sources.
|
||||
|
||||
## License
|
||||
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br />This <span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/InteractiveResource" rel="dct:type">work</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://amiaopensource.github.io/ffmprovisr/" property="cc:attributionName" rel="cc:attributionURL">ffmprovisr</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.<br />Based on a work at <a xmlns:dct="http://purl.org/dc/terms/" href="https://github.com/amiaopensource/ffmprovisr" rel="dct:source">https://github.com/amiaopensource/ffmprovisr</a>.
|
||||
|
23
check_framemd5.sh → scripts/check_audio_framemd5.sh
Normal file → Executable file
23
check_framemd5.sh → scripts/check_audio_framemd5.sh
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
SCRIPT=$(basename "${0}")
|
||||
VERSION='2016-12-31'
|
||||
VERSION='2017-04-17'
|
||||
AUTHOR='ffmprovisr'
|
||||
RED='\033[1;31m'
|
||||
BLUE='\033[1;34m'
|
||||
@@ -13,7 +13,7 @@ fi
|
||||
|
||||
_output_prompt(){
|
||||
cat <<EOF
|
||||
Usage: ${SCRIPT} [-h] | [ -i <av_file> -m <md5_file> ]
|
||||
Usage: ${SCRIPT} -h | -i <av_file> -m <md5_file>
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
@@ -32,7 +32,7 @@ Dependency:
|
||||
ffmpeg
|
||||
About:
|
||||
Version: ${VERSION}
|
||||
Website: https://github.com/amiaopensource/ffmprovisr/blob/gh-pages/check_framemd5.sh
|
||||
Website: https://github.com/amiaopensource/ffmprovisr/blob/gh-pages/scripts/check_audio_framemd5.sh
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
@@ -54,21 +54,24 @@ done
|
||||
echo -e "${BLUE}Please wait...${NC}"
|
||||
unset md5_tmp
|
||||
if [[ $OSTYPE = "cygwin" ]]; then
|
||||
md5_tmp=""${USERPROFILE}/$(basename ${input_hash}).tmp""
|
||||
md5_tmp="${USERPROFILE}/$(basename "${input_hash}").tmp"
|
||||
else
|
||||
md5_tmp="${HOME}/$(basename ${input_hash}).tmp"
|
||||
md5_tmp="${HOME}/$(basename "${input_hash}").tmp"
|
||||
fi
|
||||
$(ffmpeg -i ${input_file} -loglevel 0 -f framemd5 -an ${md5_tmp})
|
||||
# Find audio frame size for hash calculation
|
||||
sample_rate=$(grep -v '^#' "${input_hash}" | head -n 1 | tr -d ' ' | cut -d',' -f4)
|
||||
ffmpeg -i "${input_file}" -loglevel 0 -af "asetnsamples=n='$sample_rate'" -f framemd5 -vn "${md5_tmp}"
|
||||
[[ ! -f ${md5_tmp} ]] && { echo -e "${RED}Error: '${input_file}' is not a valid audio-visual file.${NC}" ; _output_prompt ; }
|
||||
unset old_file
|
||||
unset tmp_file
|
||||
old_file=$(grep -v '^#' ${input_hash})
|
||||
tmp_file=$(grep -v '^#' ${md5_tmp})
|
||||
unset sample_rate
|
||||
old_file=$(grep -v '^#' "${input_hash}")
|
||||
tmp_file=$(grep -v '^#' "${md5_tmp}")
|
||||
if [[ "${old_file}" = "${tmp_file}" ]]; then
|
||||
echo -e "${BLUE}'$(basename ${input_file})' matches '$(basename ${input_hash})'${NC}"
|
||||
echo -e "${BLUE}'$(basename "${input_file}")' matches '$(basename "${input_hash}")'${NC}"
|
||||
rm "${md5_tmp}"
|
||||
else
|
||||
echo -e "${RED}The following differences were detected between '$(basename ${input_file})' and '$(basename ${input_hash})':${NC}"
|
||||
echo -e "${RED}The following differences were detected between '$(basename "${input_file}")' and '$(basename "${input_hash}")':${NC}"
|
||||
diff "${input_hash}" "${md5_tmp}"
|
||||
rm "${md5_tmp}"
|
||||
fi
|
74
scripts/check_video_framemd5.sh
Normal file
74
scripts/check_video_framemd5.sh
Normal file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
SCRIPT=$(basename "${0}")
|
||||
VERSION='2017-04-17'
|
||||
AUTHOR='ffmprovisr'
|
||||
RED='\033[1;31m'
|
||||
BLUE='\033[1;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
if [[ ${OSTYPE} = "cygwin" ]] || [ ! $(which diff) ]; then
|
||||
echo -e "${RED}Error: 'diff' is not installed by default. Please install 'diffutils' from Cygwin.${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
_output_prompt(){
|
||||
cat <<EOF
|
||||
Usage: ${SCRIPT} -h | -i <av_file> -m <md5_file>
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
_output_help(){
|
||||
cat <<EOF
|
||||
Syntax:
|
||||
${SCRIPT}
|
||||
Prompts a short help message.
|
||||
${SCRIPT} -h
|
||||
This help.
|
||||
${SCRIPT} -i <av_file> -m <md5_file>
|
||||
Pass to the script the audio-visual file and the corresponding MD5
|
||||
file to check.
|
||||
Dependency:
|
||||
ffmpeg
|
||||
About:
|
||||
Version: ${VERSION}
|
||||
Website: https://github.com/amiaopensource/ffmprovisr/blob/gh-pages/scripts/check_video_framemd5.sh
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
|
||||
unset input_file
|
||||
unset input_hash
|
||||
|
||||
while getopts ":hi:m:" opt; do
|
||||
case "${opt}" in
|
||||
h) _output_help ;;
|
||||
i) input_file=$OPTARG ;;
|
||||
m) input_hash=$OPTARG ;;
|
||||
:) echo -e "${RED}Error: option -${OPTARG} requires an argument${NC}" ; _output_prompt ;;
|
||||
*) echo -e "${RED}Error: bad option -${OPTARG}${NC}" ; _output_prompt ;;
|
||||
esac
|
||||
done
|
||||
|
||||
[[ -z "${#}" || ! ${input_file} || ! ${input_hash} ]] && _output_prompt
|
||||
echo -e "${BLUE}Please wait...${NC}"
|
||||
unset md5_tmp
|
||||
if [[ $OSTYPE = "cygwin" ]]; then
|
||||
md5_tmp="${USERPROFILE}/$(basename "${input_hash}").tmp"
|
||||
else
|
||||
md5_tmp="${HOME}/$(basename "${input_hash}").tmp"
|
||||
fi
|
||||
ffmpeg -i "${input_file}" -loglevel 0 -f framemd5 -an "${md5_tmp}"
|
||||
[[ ! -f "${md5_tmp}" ]] && { echo -e "${RED}Error: '${input_file}' is not a valid audio-visual file.${NC}" ; _output_prompt ; }
|
||||
unset old_file
|
||||
unset tmp_file
|
||||
old_file=$(grep -v '^#' "${input_hash}")
|
||||
tmp_file=$(grep -v '^#' "${md5_tmp}")
|
||||
if [[ "${old_file}" = "${tmp_file}" ]]; then
|
||||
echo -e "${BLUE}'$(basename "${input_file}")' matches '$(basename "${input_hash}")'${NC}"
|
||||
rm "${md5_tmp}"
|
||||
else
|
||||
echo -e "${RED}The following differences were detected between '$(basename "${input_file}")' and '$(basename "${input_hash}")':${NC}"
|
||||
diff "${input_hash}" "${md5_tmp}"
|
||||
rm "${md5_tmp}"
|
||||
fi
|
19
scripts/ffmprovisr
Executable file
19
scripts/ffmprovisr
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ $OSTYPE = darwin* ]] ; then
|
||||
if [ -d /usr/local/Cellar/ffmprovisr ] ; then
|
||||
ffmprovisr_path=$(find /usr/local/Cellar/ffmprovisr -iname 'index.html' | sort -M | tail -n1)
|
||||
fi
|
||||
if [ -z "${ffmprovisr_path}" ] ; then
|
||||
ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/'
|
||||
fi
|
||||
open "${ffmprovisr_path}"
|
||||
elif [[ $OSTYPE = linux-gnu ]] ; then
|
||||
if [ -d ~/.linuxbrew/Cellar/ffmprovisr ] ; then
|
||||
ffmprovisr_path=$(find ~/.linuxbrew/Cellar/ffmprovisr -iname 'index.html' | sort -M | tail -n1)
|
||||
fi
|
||||
if [ -z "${ffmprovisr_path}" ] ; then
|
||||
ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/'
|
||||
fi
|
||||
xdg-open "${ffmprovisr_path}"
|
||||
fi
|
Reference in New Issue
Block a user