Compare commits

...

83 Commits

Author SHA1 Message Date
Kieran O'Leary
63033942f1 Merge pull request #460 from kieranjol/gh-pages
join files recipe - remove './' from example, fixes #457
2022-05-12 21:18:17 +01:00
Kieran O'Leary
aba38e0a08 join files recipe - add @brainwane path hint 2022-05-10 23:08:20 +01:00
Kieran O'Leary
393a8cc22f join files recipe - remove './' from example, fixes #457 2022-05-10 21:40:51 +01:00
Katherine Frances Nagels
20cbf26144 Merge pull request #458 from amiaopensource/kfrn-join-files
Fix indentation of code block showing file contents
2022-05-11 07:53:34 +12:00
kfrn
e6552c5494 Join files recipe: fix indentation of code block showing file contents
Previously, the second and following lines were indented compared to the first line.
2022-05-11 07:31:40 +12:00
רטו • Reto
0d27ffa5d1 don't try to find the default browser on macOS (#456) 2021-08-13 19:53:57 +02:00
Ashley
bf93a20da8 Merge pull request #455 from amiaopensource/homebrew-1
delete Homebrew compilation parameters
2021-08-13 11:46:21 -04:00
רטו • Reto
3c393a688e delete Homebrew compilation parameters 2021-08-13 17:33:40 +02:00
Andrew Weaver
961f401c34 Merge pull request #454 from amiaopensource/qemu
update QEMU QED link in ReadMe
2021-01-29 13:36:35 -08:00
רטו
f3cc3b518f update QEMU QED link in ReadMe 2021-01-29 22:24:42 +01:00
Andrew Weaver
3555a9b61e Merge pull request #453 from EG-tech/eg-tech
update QEMU QED link
2021-01-29 13:17:55 -08:00
EG-tech
9a36ef66ba update QEMU QED link
fixed
2021-01-29 16:12:28 -05:00
Ashley
e7d8dd58b9 Merge pull request #448 from amiaopensource/ablwr-patch-1
add ffmpeg-artschool as sibling
2020-11-30 10:22:04 -05:00
Ashley
a25c20a855 add target blank 2020-11-30 10:18:57 -05:00
Ashley
c0d3761ce5 Merge pull request #449 from amiaopensource/ablwr-patch-2
rebrand "sister" to gender-neutral "sibling"
2020-11-30 10:15:12 -05:00
Ashley
869ffda8c4 rebrand "sister" to gender-neutral "sibling" 2020-11-30 10:11:43 -05:00
Ashley
789329b415 add ffmpeg-artschool as sibling 2020-11-30 10:10:43 -05:00
Ashley
23e0097b54 Merge pull request #446 from axfelix/gh-pages
add hardware encoding examples
2020-11-22 13:55:18 -05:00
Alex Garnett
ca86a0eca4 fix hevc profile in separate example 2020-11-22 10:50:43 -08:00
Alex Garnett
bc0edae268 add separate hevc recipe 2020-11-22 10:46:23 -08:00
Alex Garnett
87314cef76 fix preset command 2020-11-22 10:42:18 -08:00
Alex Garnett
77a7a2b3dc add hardware encoding examples 2020-11-22 10:30:42 -08:00
Ashley
f0aab69f0f Merge pull request #445 from amiaopensource/ffmprovisr_typo
fix tiny typo
2020-11-16 08:39:31 -05:00
רטו
5c0b98bded fix tiny typo 2020-11-16 12:49:55 +01:00
bturkus
2677cd74e7 update pbs tech specs link (#444) 2020-11-12 13:30:19 +01:00
Reto Kromer
46d65cf4d0 update recipe list (#443) 2020-09-28 08:07:11 +02:00
Reto Kromer
638bb951dd fix HTML (#442) 2020-07-22 07:08:34 +02:00
Andrew Weaver
87581c717c Merge pull request #441 from amiaopensource/delete_space
delete a space before `</h5>`
2020-07-20 10:29:54 -07:00
Reto Kromer
ba49741c9f delete a space before </h5> 2020-07-20 18:14:35 +02:00
Reto Kromer
de49996097 update H.265/HEVC formula (#439) 2020-07-19 08:02:37 +02:00
Reto Kromer
708cd0eae3 upgrade CC CoC to version 2.0 (#437) 2020-06-15 06:57:03 +02:00
Ashley
e39d70ac2b Merge pull request #436 from amiaopensource/FFCommand_Engine
add FFCommand_Engine to sister projects
2020-06-12 13:42:50 -04:00
Reto Kromer
7dd7f1c355 add FFCommand_Engine to sister projects 2020-06-11 15:15:45 +02:00
Katherine Frances Nagels
6f3e8eb0a4 Merge pull request #434 from amiaopensource/kfrn/recipe-enhancements
Recipe enhancements & tidy-ups
2020-06-05 19:04:57 +12:00
kfrn
885535c33b Code style: normalise H264 (etc) → H.264, aac → AAC
Matching the majority spelling
2020-06-05 17:39:21 +12:00
kfrn
515c0c3ae2 Docs: fix typo 2020-06-05 17:39:21 +12:00
kfrn
528ba39135 Recipe: transcode to H.264 - add note about >1 audio (etc) tracks
Addresses https://github.com/amiaopensource/ffmprovisr/issues/383
2020-06-05 17:39:05 +12:00
kfrn
d3971b7ec2 Recipe: SD → HD with pillarbox - add note about deinterlacing
Addresses https://github.com/amiaopensource/ffmprovisr/issues/380
2020-06-04 20:02:08 +12:00
Katherine Frances Nagels
b04c0723b5 Merge pull request #430 from amiaopensource/kfrn/style-guide
Style guide

https://github.com/amiaopensource/ffmprovisr/issues/429
2020-06-04 17:55:44 +12:00
kfrn
f2ab1827f7 Fix typos 2020-06-04 17:54:35 +12:00
kfrn
9a1c1af578 Docs/PR template: remove point about adding to recipes.txt
Not user-friendly for beginners - and Reto's on the case ;)

https://github.com/amiaopensource/ffmprovisr/pull/430#discussion_r433718981
2020-06-04 17:54:35 +12:00
kfrn
8963b4af7e Code style: add PR template 2020-06-04 17:54:35 +12:00
kfrn
5f3fd5e464 Docs: add new section, Guidelines for contributing
Content supplied by @kieranjol,
https://github.com/amiaopensource/ffmprovisr/issues/429
2020-06-04 17:54:35 +12:00
kfrn
2adc238e3e Code style: headings according to nesting level 2020-06-04 17:54:35 +12:00
Katherine Frances Nagels
a35dcb2883 Merge pull request #432 from todrobbins/tod-tweaks
swapped out intro-leads for h3
2020-06-04 17:54:09 +12:00
todrobbins
d9cceb5dbd removed .intro-lead styling 2020-06-03 15:07:18 -06:00
todrobbins
904861ddd2 replaced intro-lead with h3 2020-06-03 09:30:20 -06:00
todrobbins
2ab4584bae styled intro-leads 2020-06-02 18:13:02 -06:00
Ashley
8ddd07134f Merge pull request #428 from DaleLore/patch-2
Another attempt at fade in/out documentation
2020-05-31 16:25:55 -04:00
Lorena A Ramírez-López
0294761f77 Another update to the instructions
So many times firsts and lasts. I think I got all of them.
2020-05-31 11:58:17 -04:00
Lorena A Ramírez-López
33582ee6ea Another udpate
Took out fades in and out the first and last second of video as it's no longer hard-coded for that.
2020-05-31 11:53:48 -04:00
Lorena A Ramírez-López
77c7cc337a More generic instructions for Fade in/out
Took out the audio example. 
Took out mini example.
Took out hardcoded attributes.
Added IN_POINT, OUT_POINT, DURATION to the time in seconds (expressed as integers) per kfrn suggestion
2020-05-31 11:48:36 -04:00
Lorena A Ramírez-López
ee6136a020 Another attempt at fade in/out documentation
Hopefully I got all the uses of "frames" out. (let me know if one snuck in)
And I used the example that was used in the stackoverflow forum. 

This is for Issue: OG #386 / First attempt #422 / Now this attempt #424
2020-05-28 23:58:45 -04:00
Ashley
3984c8aae3 Merge pull request #425 from amiaopensource/rm-jquery
Remove jQuery
2020-05-14 08:24:18 -04:00
Ashley Blewer
f9ef8dbae3 Update lets as consts 2020-05-13 17:12:28 -04:00
Ashley Blewer
f814abbc0a Move js up into body 2020-05-13 10:05:31 -04:00
Ashley Blewer
843f05cc73 Remove jQuery library and use vanilla js 2020-05-13 09:35:16 -04:00
Ashley Blewer
54577f4b28 Add missing link tag 2020-05-13 09:34:28 -04:00
Ashley
aa5d63f4c4 Merge pull request #423 from amiaopensource/recipe_list
add Fade both video and audio streams to recipe list
2020-05-02 12:06:47 -04:00
Reto Kromer
dd257331fe add Fade video and audio streams to recipe list 2020-05-02 07:33:52 +02:00
Ashley
feac0ded9b Merge pull request #422 from DaleLore/fade
Update: Adding fade/afade to streams
2020-05-01 23:10:36 -04:00
Lorena A Ramírez-López
a33ed1d24f Apply suggestions from code review
Good point. Thanks

Co-authored-by: Ashley <ashley.blewer@gmail.com>
2020-05-01 23:09:49 -04:00
Lorena A Ramírez-López
020b9fbe73 Update: Adding fade/afade to streams 2020-05-01 23:03:25 -04:00
Ashley
1df442f6dd Merge pull request #421 from amiaopensource/prores
add all containers for ProRes
2020-05-01 22:17:31 -04:00
Reto Kromer
3a05c8f440 add all containers for ProRes 2020-05-01 09:47:57 +02:00
Ashley
89642fdd56 Merge pull request #420 from amiaopensource/BWF
add BWF to recipe list
2020-04-16 08:45:15 -04:00
Reto Kromer
a9ec972aef add BWF to recipe list 2020-04-16 14:31:13 +02:00
Reto Kromer
91540a2fb8 Merge pull request #415 (use same wording in ToC and title) 2020-01-04 10:58:41 +01:00
Reto Kromer
2becad3d9c use same wording in ToC and title 2019-12-25 10:32:15 +01:00
Ashley
e4c327bbac Merge pull request #414 from amiaopensource/kfrn/tweaks
Tweaks: naming, whitespace, collapse all recipes
2019-12-17 11:48:57 -05:00
kfrn
4359d6dd4a Update 'show/hide recipes' (expand/collapse) functionality
Previously, it would expand the recipe if currently collapsed, and vice versa.
Now, if any recipes are currently expanded, it will collapse all; otherwise, all recipes will be expanded.

The 'expand all' functionality is necessary for full-text searching.
2019-12-18 05:42:29 +13:00
kfrn
d184ed2fe9 Code style: remove trailing whitespace 2019-12-17 22:36:47 +13:00
kfrn
089725a753 Crop video recipe: correct name/description of example images 2019-12-17 22:34:37 +13:00
Ashley
897f1b1616 Merge pull request #413 from amiaopensource/update-contributors
Update contributors list with octohatrack
2019-12-11 12:08:30 -05:00
Ashley
358a2ec23b add "last updated" 2019-12-11 12:04:09 -05:00
Ashley Blewer
de6c08a58d Update contributors list with octohatrack 2019-12-10 17:56:18 -05:00
Ashley
0d1fc1bfe8 Merge pull request #412 from amiaopensource/BWF_name
fix BWF name
2019-12-10 10:41:34 -05:00
Reto Kromer
cbca3ac7ad fix BWF name 2019-12-10 10:04:07 +01:00
Ashley
bcc425a955 Merge pull request #410 from amiaopensource/add-bext
add BWF embedding recipe
2019-12-09 12:15:51 -05:00
weaver
0353c1761e ch ch ch changes 2019-12-06 08:37:11 -08:00
weaver
e3aa81fb95 add BWF 2019-12-05 16:28:58 -08:00
Ashley
633374f22d Merge pull request #409 from macasaurusrex/issue-399-meta-tag-validation
Update index.html
2019-11-20 10:39:49 -05:00
Maura
1d60060eed Update index.html
fix for ticket 399: meta tag validation error. w3 doesn't like chartset in the same tag as viewport so I split them out based on what was described in the ticket
2019-11-19 18:07:41 -05:00
9 changed files with 388 additions and 161 deletions

3
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,3 @@
## Checklist
* [ ] I've referred to the [Guidelines for contributing](https://github.com/amiaopensource/ffmprovisr/blob/gh-pages/readme.md#guidelines-for-contributing)

View File

@@ -1,50 +1,133 @@
# Contributor Code of Conduct
# Contributor Covenant Code of Conduct
As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.
## Our Pledge
We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
Examples of unacceptable behavior by participants include:
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct
* Publishing others private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Enforcement Responsibilities
By adopting this Code of Conduct, project maintainers commit themselves to
fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting a project maintainer. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. Maintainers are
obligated to maintain confidentiality with regard to the reporter of an
incident.
reported to the community leaders responsible for enforcement, who are the
ffmprovisr maintainers:
* Ashley Blewer (ashley.blewer@gmail.com)
* Katherine Frances Nagels (kfnagels@gmail.com)
* Kieran O'Leary (kieran.o.leary@gmail.com)
* Andrew Weaver (theandrewjw@gmail.com)
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4.1, available at
[https://www.contributor-covenant.org/version/1/4/code-of-conduct.html][version]
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
[homepage]: https://www.contributor-covenant.org/
[version]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
Community Impact Guidelines were inspired by [Mozillas code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View File

@@ -85,7 +85,7 @@ a:visited {
}
.license img {
max-width: 10em;
max-width: 6em;
display: inline;
}
@@ -113,10 +113,6 @@ h4 {
font-size: 1.2em;
}
.intro-lead {
font-size: 1em;
}
code {
padding: 2px 4px;
color: #c7254e;

View File

@@ -2,11 +2,10 @@
<html lang="en">
<head>
<title>ffmprovisr</title>
<meta name="viewport" charset="utf-8" content="text/html, width=device-width, initial-scale=1">
<meta name="viewport" content="text/html, width=device-width, initial-scale=1">
<meta charset="utf-8">
<link rel="stylesheet" href="css/css.css">
<link rel="icon" href="img/vhs.ico">
<script src="js/jquery.min.js"></script>
<script src="js/js.js"></script>
</head>
<body>
@@ -18,7 +17,7 @@
<nav class="sidebar well">
<h2 class="heading">Table of Contents</h2>
<a href="#about"><div class="contents-list">About this resource</div></a>
<div id="open-all" class="contents-list">Show/hide all recipes</div>
<div id="toggle-expand-collapse-all" class="contents-list">Expand/collapse all recipes</div>
<a href="#basics"><div class="contents-list">FFmpeg basics</div></a>
<a href="#concepts"><div class="contents-list">Advanced FFmpeg concepts</div></a>
<a href="#rewrap"><div class="contents-list">Change container (rewrap)</div></a>
@@ -46,25 +45,26 @@
<div class="content">
<div class="well">
<h2 class="heading" id="about">About ffmprovisr</h2>
<span class="intro-lead">Making FFmpeg Easier</span>
<h3>Making FFmpeg Easier</h3>
<p>FFmpeg is a powerful tool for manipulating audiovisual files. Unfortunately, it also has a steep learning curve, especially for users unfamiliar with a command line interface. This app helps users through the command generation process so that more people can reap the benefits of FFmpeg.</p>
<p>Each button displays helpful information about how to perform a wide variety of tasks using FFmpeg. To use this site, click on the task you would like to perform. A new window will open up with a sample command and a description of how that command works. You can copy this command and understand how the command works with a breakdown of each of the flags.</p>
<p>This page does not have search functionality, but you can open all recipes (second option in the sidebar) and use your browser's search tool (often ctrl+f or cmd+f) to perform a keyword search through all recipes.</p>
<span class="intro-lead">Tutorials</span>
<h3>Tutorials</h3>
<p>For FFmpeg basics, check out the programs <a href="https://ffmpeg.org/" target="_blank">official website</a>.</p>
<p>For instructions on how to install FFmpeg on Mac, Linux, and Windows, refer to Reto Kromers <a href="https://avpres.net/FFmpeg/#ch1" target="_blank">installation instructions</a>.</p>
<p>For Bash and command line basics, try the <a href="https://learnpythonthehardway.org/book/appendixa.html" target="_blank">Command Line Crash Course</a>. For a little more context presented in an ffmprovisr style, try <a href="https://explainshell.com/" target="_blank">explainshell.com</a>!</p>
<span class="intro-lead">License</span>
<h3>License</h3>
<p class="license">
<a href="https://creativecommons.org/licenses/by/4.0/" target="_blank"><img alt="Creative Commons License" src="img/cc.png"></a><br>
This work is licensed under a <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution 4.0 International License</a>.
</p>
<span class="intro-lead">Sister projects</span>
<h3>Sibling projects</h3>
<p><a href="https://dd388.github.io/crals/" target="_blank">Script Ahoy</a>: Community Resource for Archivists and Librarians Scripting</p>
<p><a href="https://datapraxis.github.io/sourcecaster/" target="_blank">The Sourcecaster</a>: an app that helps you use the command line to work through common challenges that come up when working with digital primary sources.</p>
<p><a href="https://pugetsoundandvision.github.io/micropops/" target="_blank">Micropops</a>: One liners and automation tools from Moving Image Preservation of Puget Sound</p>
<p><a href="https://amiaopensource.github.io/cable-bible/" target="_blank">Cable Bible</a>: A Guide to Cables and Connectors Used for Audiovisual Tech</p>
<p><a href="https://eaasi.gitlab.io/qemu-qed/" target="_blank">QEMU QED</a>: instructions for using QEMU (Quick EMUlator), a command line application for computer emulation and virtualization</p>
<p><a href="https://eaasi.gitlab.io/program_docs/qemu-qed/" target="_blank">QEMU QED</a>: instructions for using QEMU (Quick EMUlator), a command line application for computer emulation and virtualization</p>
<p><a href="https://amiaopensource.github.io/ffmpeg-artschool/" target="_blank">ffmpeg-artschool</a>: An AMIA workshop featuring scripts, exercises, and activities to make art using FFmpeg</p>
</div>
<div class="well">
@@ -117,13 +117,14 @@
<p>When creating or transcoding files with FFmpeg, it is important to consider codec settings for both audio and video, as the default options may not be desirable in your particular context. The following is a brief list of codec defaults for some common file types:</p>
<ul>
<li><code>.avi</code>: Audio Codec: mp3, Video Codec: mpeg4</li>
<li><code>.mkv</code>: Audio Codec: ac3, Video Codec: h.264</li>
<li><code>.mov</code>: Audio Codec: aac, Video Codec: h.264</li>
<li><code>.mp4</code>: Audio Codec: aac, Video Codec: h.264</li>
<li><code>.mkv</code>: Audio Codec: ac3, Video Codec: H.264</li>
<li><code>.mov</code>: Audio Codec: AAC, Video Codec: H.264</li>
<li><code>.mp4</code>: Audio Codec: AAC, Video Codec: H.264</li>
<li><code>.mpg</code>: Audio Codec: mp2, Video Codec: mpeg1video</li>
<li><code>.mxf</code>: Audio Codec: pcm_s16le, Video Codec: mpeg2video</li>
<li><code>.wav</code>: Audio Codec: pcm_s16le (16 bit PCM)</li>
</ul>
<p class="link"></p>
</div>
<!-- End Codec Defaults -->
@@ -183,7 +184,7 @@
<p>To map <em>all</em> streams in the input file to the output file, use <code>-map 0</code>. However, note that not all container formats can include all stream types: for example, .mp4 cannot contain timecode.</p>
<h4>Mapping with a failsafe</h4>
<p>To safely process files that may or may not contain given a type of stream, you can add a trailing <code>?</code> to your map commands: for example, <code>-map 0:a?</code> instead of <code>-map 0:a</code>.</p>
<p>This makes the map optional: audio streams will be mapped over if they are present in the file—but if the file contains no audio streams, the transcode will precede as usual, minus the audio stream mapping. Without adding the trailing <code>?</code>, FFmpeg will exit with an error on that file.</p>
<p>This makes the map optional: audio streams will be mapped over if they are present in the file—but if the file contains no audio streams, the transcode will proceed as usual, minus the audio stream mapping. Without adding the trailing <code>?</code>, FFmpeg will exit with an error on that file.</p>
<p>This is especially recommended when batch processing video files: it ensures that all files in your batch will be transcoded, whether or not they contain audio streams.</p>
<p>For more information, check out the FFmpeg wiki <a href="https://trac.ffmpeg.org/wiki/Map" target="_blank">Map</a> page, and the official FFmpeg <a href="https://ffmpeg.org/ffmpeg.html#Advanced-options" target="_blank">documentation on <code>-map</code></a>.</p>
<p class="link"></p>
@@ -218,6 +219,36 @@
</div>
<!-- End Basic rewrap command -->
<!-- BWF -->
<label class="recipe" for="bwf">Convert to (or create) Broadcast WAV</label>
<input type="checkbox" id="bwf">
<div class="hiding">
<h5>Generate Broadcast WAV</h5>
<p><code>ffmpeg -i <em>input_file.wav</em> -c copy -write_bext 1 -metadata field_name='Content' <em>output_file.wav</em></code></p>
<p>This command will write a file in the Broadcast Wave Format (BWF) containing a BEXT chunk with related metadata.</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <em>input_file.wav</em></dt><dd>path and name of the input file</dd>
<dt>-c copy</dt><dd>this will copy the encoding/sample rate etc from the input. If not using a WAV as the input file you will have to specify codec settings in place of this.</dd>
<dt>-write_bext 1</dt><dd>tells FFmpeg to write a BEXT chunk, the part of the file where BWF metadata is stored.</dd>
<dt>-metadata field_name='Content'</dt><dd>This is where you can specify which BEXT fields to write, and what information to fill them with by replacing <code>field_name</code> and <code>'Content'</code> respectively. See below for additional details.</dd>
</dl>
<p>Notes: You can choose which fields to write by repeating <code>-metadata field_name='Content'</code> for each desired field. Flags for commonly used fields (such as those recommended by the <a href="http://www.digitizationguidelines.gov/audio-visual/documents/Embed_Guideline_20120423.pdf">FADGI guidelines</a>) are as follows:</p>
<ul>
<li>description</li>
<li>originator</li>
<li>originator_reference</li>
<li>origination_date</li>
<li>origination_time</li>
<li>coding_history</li>
<li>IARL</li>
</ul>
<p>Example: <code>-metadata originator='US, UW Libraries'</code></p>
<p>Additionally, users should be aware that BWF metadata fields are limited by characters, with some such as OriginatorReference maxing out at 32. Specific information can be found in the <a href="https://tech.ebu.ch/docs/tech/tech3285.pdf">Broadcast Wave Format specification</a>. Additional examples of BWF metadata usage can be found in the <a href="http://www.dlib.indiana.edu/projects/sounddirections/papersPresent/sd_bp_07.pdf">Sound Directions report</a> by Indiana University and Harvard.</p>
<p class="link"></p>
</div>
<!-- ends BWF -->
<!-- Rewrap DV -->
<label class="recipe" for="rewrap-dv">Rewrap DV video to .dv file</label>
<input type="checkbox" id="rewrap-dv">
@@ -245,7 +276,7 @@
<input type="checkbox" id="to_prores">
<div class="hiding">
<h5>Transcode into a deinterlaced Apple ProRes LT</h5>
<p><code>ffmpeg -i <em>input_file</em> -c:v prores -profile:v 1 -vf yadif -c:a pcm_s16le <em>output_file</em>.mov</code></p>
<p><code>ffmpeg -i <em>input_file</em> -c:v prores -profile:v 1 -vf yadif -c:a pcm_s16le <em>output_file</em></code></p>
<p>This command transcodes an input file into a deinterlaced Apple ProRes 422 LT file with 16-bit linear PCM encoded audio. The file is deinterlaced using the yadif filter (Yet Another De-Interlacing Filter).</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
@@ -261,7 +292,7 @@
<dt>-vf yadif</dt><dd>Runs a deinterlacing video filter (yet another deinterlacing filter) on the new file. <code>-vf</code> is an alias for <code>-filter:v</code>.</dd>
<dt>-c:a pcm_s16le</dt><dd>tells FFmpeg to encode the audio stream in 16-bit linear PCM</dd>
<dt><em>output_file</em></dt><dd>path, name and extension of the output file<br>
The extension for the QuickTime container is <code>.mov</code>.</dd>
There are currently three possible containers for ProRes 422 and 4444 which are all supported by FFmpeg: QuickTime (<code>.mov</code>), Matroska (<code>.mkv</code>) and Material eXchange Format (<code>.mxf</code>).</dd>
</dl>
<p>FFmpeg comes with more than one ProRes encoder:</p>
<ul>
@@ -301,11 +332,44 @@
<dt>-crf <em>18</em></dt><dd>Specifying a lower CRF will make a larger file with better visual quality. For H.264 files being encoded with a 4:2:0 chroma subsampling scheme (i.e., using <code>-pix_fmt yuv420p</code>), the scale ranges between 0-51 for 8-bit content, with 0 being lossless and 51 the worst possible quality.<br>
If no crf is specified, <code>libx264</code> will use a default value of 23. 18 is often considered a “visually lossless” compression.</dd>
</dl>
<p>By default, this recipe will include one track of each type (e.g. audio, video) in the output file. If you wish to include more tracks, consult the <a href="#stream-mapping">entry on stream mapping</a>.</p>
<p>For more information, see the <a href="https://trac.ffmpeg.org/wiki/Encode/H.264" target="_blank">FFmpeg and H.264 Encoding Guide</a> on the FFmpeg wiki.</p>
<p class="link"></p>
</div>
<!-- ends Transcode to H.264 -->
<!-- Transcode to H.264 or H.265 using the GPU -->
<label class="recipe" for="transcode_gpu">Transcode to H.264/H.265 using the GPU</label>
<input type="checkbox" id="transcode_gpu">
<div class="hiding">
<h5>Transcode to H.264/H.265 using the GPU</h5>
<p><code>ffmpeg -i <em>input_file</em> -c:v h264_nvenc -preset llhq -rc:v vbr_hq -cq:v 19 -b:v 8000k -maxrate:v 12000k -profile:v high -c:a copy <em>output_file</em></code></p>
<p>This command takes an input file and transcodes it to H.264 using the encoding functionality of an Nvidia GPU (without transcoding the audio). If you're using H.264 with AAC or AC3 audio, you can output to an .mp4 file; if you're using HEVC and/or more exotic audio, you should output to .mkv. While Nvidia's fixed-function hardware can be 10x as performant as encoding on the CPU, it requires a few more parameters in order to optimize quality at lower bitrates.</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <em>input_file</em></dt><dd>path, name and extension of the input file</dd>
<dt>-c:v <em>h264_nvenc</em></dt><dd>tells FFmpeg to encode the video stream as H.264 using Nvidia's encoder.</dd>
<dt>-preset <em>llhq</em></dt><dd>uses the "low latency, high quality" encoding preset, a good default when working with nvenc.</dd>
<dt>-rc:v <em>vbr_hq</em></dt><dd>means "variable bitrate, high quality," allowing you to set a minimum and maximum bitrate for the encode.</dd>
<dt>-cq:v <em>19</em></dt><dd>is the same as the CRF quality level specified using x264 or other CPU-based encoders, where 0 is lossless, 51 is the worst possible quality, and values from 18-23 are typical.</dd>
<dt>-b:v <em>8000k -maxrate:v 12000k</em></dt><dd>corresponds to a minimum bitrate of 8 megabits (8000k) per second, and a maximum of 12 megabits per second. nvenc is not as good at estimating bitrates as CPU-based encoders, and without this data, will occasionally choose a visibly lower bitrate. The 8-12 mbit range is generally a good one for high-quality 1080p h264.</dd>
<dt>-profile:v <em>high</em></dt><dd>uses the "high quality" profile of h264, something that's been baked in to the spec for a long time so that older players can declare compatibility; almost all h264 video now uses high.</dd>
<dt>-c:a <em>copy</em></dt><dd>will skip reencoding the audio stream, and copy the audio from the source file.</dd>
<dt><em>output_file</em></dt><dd>path, name and extension of the output file</dd>
</dl>
<p>In order to encode to HEVC instead, and optionally transcode the audio, you can try changing the command like this:</p>
<p><code>ffmpeg -i <em>input_file</em> -c:v hevc_nvenc -preset llhq -rc:v vbr_hq -cq:v 19 -b:v 5000k -maxrate:v 8000k -profile:v main10 -c:a aac <em>output_file</em></code></p>
<dl>
<dt>-c:v <em>hevc_nvenc</em></dt><dd>encodes to HEVC (also called H.265), a more efficient codec supported on GPUs from approximately 2015 and newer.</dd>
<dt>-b:v <em>5000k -maxrate:v 8000k</em></dt><dd>specifies a slightly lower bitrate than when using h264, per HEVC's greater efficiency.</dd>
<dt>-profile:v <em>main10</em></dt><dd>declares the "main10" profile for working with HEVC; one of the primary advantages of this codec is better support for 10-bit video, enabling consumer HDR.</dd>
<dt>-c:a <em>aac</em></dt><dd>reencodes the audio to AAC with default parameters, a very common and widely supported format for access copies.</dd>
</dl>
<p>Much of the information in this entry was taken from <a href="https://superuser.com/a/1236387" target="_blank">this superuser.com post</a> provided by an Nvidia developer, one of the best sources of information on the ffmpeg Nvidia encoders.</p>
<p class="link"></p>
</div>
<!-- ends Transcode to H.264 or H.265 using the GPU -->
<!-- H.264 from DCP -->
<label class="recipe" for="dcp_to_h264">Transcode from DCP to an H.264 access file</label>
<input type="checkbox" id="dcp_to_h264">
@@ -401,7 +465,6 @@
<h5>Transcode to H.265/HEVC</h5>
<p><code>ffmpeg -i <em>input_file</em> -c:v libx265 -pix_fmt yuv420p -c:a copy <em>output_file</em></code></p>
<p>This command takes an input file and transcodes it to H.265/HEVC in an .mp4 wrapper, keeping the audio codec the same as in the original file.</p>
<p><strong>Note:</strong> FFmpeg must be compiled with libx265, the library of the H.265 codec, for this script to work. (Add the flag <code>--with-x265</code> if using the <code>brew install ffmpeg</code> method).</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <em>input file</em></dt><dd>path, name and extension of the input file</dd>
@@ -429,7 +492,6 @@
<h5>Transcode to Ogg/Theora</h5>
<p><code>ffmpeg -i <em>input_file</em> -acodec libvorbis -b:v 690k <em>output_file</em></code></p>
<p>This command takes an input file and transcodes it to Ogg/Theora in an .ogv wrapper with 690k video bitrate.</p>
<p><strong>Note:</strong> FFmpeg must be installed with support for Ogg Theora. If you are using Homebrew, you can check with <code>brew info ffmpeg</code> and then update it with <code>brew upgrade ffmpeg --with-theora --with-libvorbis</code> if necessary.</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <em>input file</em></dt><dd>path, name and extension of the input file</dd>
@@ -599,6 +661,9 @@
For silent videos you can replace <code>-c:a copy</code> with <code>-an</code>.</dd>
<dt><em>output_file</em></dt><dd>path, name and extension of the output file</dd>
</dl>
<p>If your source is interlaced, you will want to deinterlace prior to scaling. In that case, your command would look like this:</p>
<p><code>ffmpeg -i <em>input_file</em> -c:v libx264 -filter:v "yadif, colormatrix=bt601:bt709, scale=1440:1080:flags=lanczos, pad=1920:1080:240:0" -c:a copy <em>output_file</em></code></p>
<p>See the <a href="#ntsc_to_h264">Interlaced NTSC to MP4 recipe</a> for a fuller explanation of the deinterlacing step.</p>
<p class="link"></p>
</div>
<!-- ends SD to HD -->
@@ -690,14 +755,34 @@
<li>In the sound filter <code>atempo</code> the numerator <code>output_fps</code> sets the output speed and the denominator <code>input_fps</code> sets the input speed; both values are given in frames per second.</li>
</ul>
The different filters in a complex filter can be divided either by comma or semicolon. The quotation marks allow to insert a space between the filters for readability.</dd>
<dt>-map "[v]"</dt><dd>maps the video stream and:</dd>
<dt>-map "[v]"</dt><dd>maps the video stream and</dd>
<dt>-map "[a]"</dt><dd>maps the audio stream together into:</dd>
<dt><em>output_file</em></dt><dd>path, name and extension of the output file</dd>
</dl>
<p class="link"></p>
</div>
<!-- ends Modify speed -->
<!-- Fade both video and audio streams -->
<label class="recipe" for="fade_streams">Fade both video and audio streams</label>
<input type="checkbox" id="fade_streams">
<div class="hiding">
<h5>Fade both video and audio streams</h5>
<p><code>ffmpeg -i <em>input_file</em> -filter:v "fade=in:st=IN_POINT:d=DURATION, fade=out:st=OUT_POINT:d=DURATION" -filter:a "afade=in:st=OUT_POINT:d=DURATION, afade=out:st=IN_POINT:d=DURATION" -c:v libx264 -c:a aac <em>output_file</em></code></p>
<p>This command fades your video in and out. Change IN_POINT, OUT_POINT, and DURATION to the time in seconds (expressed as integers).</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <em>input_file</em></dt><dd>path, name and extension of the input file</dd>
<dt>-filter:v "fade=in:st=IN_POINT:d=DURATION, fade=out:st=OUT_POINT:d=DURATION"</dt><dd>applies a video filter that fades your video in and out. <code>st</code> sets the start and <code>d</code> sets the duration.</dd>
<dt>-filter:a "afade=in:st=IN_POINT:d=DURATION, afade=out:st=OUT_POINT:d=DURATION"</dt><dd>applies an audio filter that fades your video in and out. <code>st</code> sets the start and <code>d</code> sets the duration.</dd>
<dt>-c:v <em>video_codec</em></dt><dd>as a video filter is used, it is not possible to use <code>-c copy</code>. The video must be re-encoded with whatever video codec is chosen, e.g. <code>ffv1</code>, <code>v210</code> or <code>prores</code>.</dd>
<dt>-c:a <em>audio_codec</em></dt><dd>as an audio filter is used, it is not possible to use <code>-c copy</code>. The audio must be re-encoded with whatever audio codec is chosen, e.g. <code>aac</code>.</dd>
<dt><em>output_file</em></dt><dd>path, name and extension of the output_file</dd>
</dl>
<p class="link"></p>
</div>
<!-- ends Fade both video and audio streams -->
<!-- Synchronize video and audio streams -->
<label class="recipe" for="sync_streams">Synchronize video and audio streams</label>
<input type="checkbox" id="sync_streams">
@@ -773,13 +858,13 @@
<p>It's also possible to specify the crop position by adding the x and y coordinates representing the top left of your cropped area to your crop filter, as such:</p>
<p><code>ffmpeg -i <em>input_file</em> -vf "crop=<em>width</em>:<em>height</em>[:<em>x_position</em>:<em>y_position</em>]" <em>output_file</em></code></p>
<h5>Examples</h5>
<p>The original frame, a screenshot of the SMPTE colorbars:</p>
<p>The original frame, a screenshot of Maggie Cheung in the film <i>Hero</i>:</p>
<img class="sample-image" src="img/crop_example_orig.png" alt="VLC screenshot of Maggie Cheung">
<p>Result of the command <code>ffmpeg -i <em>smpte_colorsbars.mov</em> -vf "crop=500:500" <em>output_file</em></code>:</p>
<p>Result of the command <code>ffmpeg -i <em>maggie.mov</em> -vf "crop=500:500" <em>output_file</em></code>:</p>
<img class="sample-image-small" src="img/crop_example_aftercrop1.png" alt="VLC screenshot of Maggie Cheung, cropped from original">
<p>Result of the command <code>ffmpeg -i <em>smpte_colorsbars.mov</em> -vf "crop=500:500:0:0" <em>output_file</em></code>, appending <code>:0:0</code> to crop from the top left corner:</p>
<p>Result of the command <code>ffmpeg -i <em>maggie.mov</em> -vf "crop=500:500:0:0" <em>output_file</em></code>, appending <code>:0:0</code> to crop from the top left corner:</p>
<img class="sample-image-small" src="img/crop_example_aftercrop2.png" alt="VLC screenshot of Maggie Cheung, cropped from original">
<p>Result of the command <code>ffmpeg -i <em>smpte_colousbars.mov</em> -vf "crop=500:300:500:30" <em>output_file</em></code>:</p>
<p>Result of the command <code>ffmpeg -i <em>maggie.mov</em> -vf "crop=500:300:500:30" <em>output_file</em></code>:</p>
<img class="sample-image-small" src="img/crop_example_aftercrop3.png" alt="VLC screenshot of Maggie Cheung, cropped from original">
<p class="link"></p>
</div>
@@ -813,7 +898,7 @@
<p class="link"></p>
</div>
<!-- ends Change video color to black and white -->
</div>
<div class="well">
<h2 id="audio-files">Change or view audio properties</h2>
@@ -887,7 +972,7 @@
<p><code>ffmpeg -i <em>input_file</em> -af loudnorm=print_format=json -f null -</code></p>
<p>This filter calculates and outputs loudness information in json about an input file (labeled input) as well as what the levels would be if loudnorm were applied in its one pass mode (labeled output). The values generated can be used as inputs for a 'second pass' of the loudnorm filter allowing more accurate loudness normalization than if it is used in a single pass.</p>
<p>These instructions use the loudnorm defaults, which align well with PBS recommendations for target loudness. More information can be found at the <a href="https://ffmpeg.org/ffmpeg-filters.html#loudnorm" target="_blank">loudnorm documentation</a>.</p>
<p>Information about PBS loudness standards can be found in the <a href="https://www-tc.pbs.org/capt/Producing/TOS-2012-Pt2-Distribution.pdf" target="_blank">PBS Technical Operating Specifications</a> document. Information about EBU loudness standards can be found in the <a href="https://tech.ebu.ch/docs/r/r128-2014.pdf" target="_blank">EBU R 128</a> recommendation document.</p>
<p>Information about PBS loudness standards can be found in the <a href="http://bento.cdn.pbs.org/hostedbento-prod/filer_public/PBS_About/Producing/Red%20Book/TOS%20Pt%201%20Submission%202016.pdf" target="_blank">PBS Technical Operating Specifications</a> document. Information about EBU loudness standards can be found in the <a href="https://tech.ebu.ch/docs/r/r128-2014.pdf" target="_blank">EBU R 128</a> recommendation document.</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt><em>input_file</em></dt><dd>path, name and extension of the input file</dd>
@@ -1007,16 +1092,18 @@
<div class="hiding">
<h5>Join files together</h5>
<p><code>ffmpeg -f concat -i mylist.txt -c copy <em>output_file</em></code></p>
<p>This command takes two or more files of the same file type and joins them together to make a single file. All that the program needs is a text file with a list specifying the files that should be joined. However, it only works properly if the files to be combined have the exact same codec and technical specifications. Be careful, FFmpeg may appear to have successfully joined two video files with different codecs, but may only bring over the audio from the second file or have other weird behaviors. Dont use this command for joining files with different codecs and technical specs and always preview your resulting video file!</p>
<p>This command takes two or more files of the same file type and joins them together to make a single file. All that the program needs is a text file with a list specifying the files that should be joined. If possible, run the command from the same directory where the files and the text file reside. Otherwise you'll have to use <code>-safe 0</code>, see below for more information. However, it only works properly if the files to be combined have the exact same codec and technical specifications. Be careful, FFmpeg may appear to have successfully joined two video files with different codecs, but may only bring over the audio from the second file or have other weird behaviors. Dont use this command for joining files with different codecs and technical specs and always preview your resulting video file!</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-f concat</dt><dd>forces ffmpeg to concatenate the files and to keep the same file format</dd>
<dt>-i <em>mylist.txt</em></dt><dd>path, name and extension of the input file. Per the <a href="https://ffmpeg.org/ffmpeg-formats.html#Options" target="_blank">FFmpeg documentation</a>, it is preferable to specify relative rather than absolute file paths, as allowing absolute file paths may pose a security risk.<br>
This text file contains the list of files to be concatenated and should be formatted as follows:
<pre>file '<em>./first_file.ext</em>'
file '<em>./second_file.ext</em>'
This text file contains the list of files (without their absolute path) to be concatenated and should be formatted as follows:
<pre>
file '<em>first_file.ext</em>'
file '<em>second_file.ext</em>'
. . .
file '<em>./last_file.ext</em>'</pre>
file '<em>last_file.ext</em>'
</pre>
In the above, <strong>file</strong> is simply the word "file". Straight apostrophes ('like this') rather than curved quotation marks (like this) must be used to enclose the file paths.<br>
<strong>Note:</strong> If specifying absolute file paths in the .txt file, add <code>-safe 0</code> before the input file.<br>
e.g.: <code>ffmpeg -f concat -safe 0 -i mylist.txt -c copy <em>output_file</em></code></dd>
@@ -1453,7 +1540,7 @@
<label class="recipe" for="embed_subtitles">Embed subtitles</label>
<input type="checkbox" id="embed_subtitles">
<div class="hiding">
<h5>Embed a subtitle file into a movie file </h5>
<h5>Embed a subtitle file into a movie file</h5>
<p><code>ffmpeg -i <em>input_file</em> -i <em>subtitles_file</em> -c copy -c:s mov_text <em>output_file</em></code></p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
@@ -2282,7 +2369,6 @@
<input type="checkbox" id="ocr_on_top">
<div class="hiding">
<h5>Plays video with OCR on top</h5>
<p>Note: ffmpeg must be compiled with the tesseract library for this script to work (<code>--with-tesseract</code> if using the <code>brew install ffmpeg</code> method).</p>
<p><code>ffplay input_file -vf "ocr,drawtext=fontfile=/Library/Fonts/Andale Mono.ttf:text=%{metadata\\\:lavfi.ocr.text}:fontcolor=white"</code></p>
<dl>
<dt>ffplay</dt><dd>starts the command</dd>
@@ -2306,7 +2392,6 @@
<input type="checkbox" id="ffprobe_ocr">
<div class="hiding">
<h5>Exports OCR data to screen</h5>
<p>Note: FFmpeg must be compiled with the tesseract library for this script to work (<code>--with-tesseract</code> if using the <code>brew install ffmpeg</code> method)</p>
<p><code>ffprobe -show_entries frame_tags=lavfi.ocr.text -f lavfi -i "movie=<em>input_file</em>,ocr"</code></p>
<dl>
<dt>ffprobe</dt><dd>starts the command</dd>
@@ -2514,7 +2599,7 @@
<dt>-flags +global_header</dt><dd>Don't place extra data in every keyframe</dd>
<dt>-vf scale="1280:-1"</dt><dd>Scale to 1280 width, maintain aspect ratio.</dd>
<dt>-pix_fmt yuv420p</dt><dd>convert to 4:2:0 chroma subsampling scheme</dd>
<dt>-level 3.1</dt><dd>H264 Level (defines some thresholds for bitrate)</dd>
<dt>-level 3.1</dt><dd>H.264 Level (defines some thresholds for bitrate)</dd>
<dt>-vsync passthrough</dt><dd>Each frame is passed with its timestamp from the demuxer to the muxer.</dd>
<dt>-crf 26</dt><dd>Constant rate factor - basically the quality</dd>
<dt>-g 50</dt><dd>GOP size.</dd>
@@ -2770,7 +2855,7 @@
<input type="checkbox" id="flac-tool">
<div class="hiding">
<h5>About flac tool</h5>
<p>The flac tool is the tool created by the FLAC project to transcode to/from FLAC and to manipulate metadata in FLAC files. One advantage it has over other tools used to transcode into FLAC is the capability of embedding foreign metadata (such as BWF metadata). This means that it is possible to compress a BWF file into FLAC and maintain the ability to transcode back into an identical BWF, metadata and all. For a more detailed explanation, see <a href="http://dericed.com/2013/flac-in-the-archives/" target="_blank">Dave Rice's article</a> on the topic, from which the following commands are adapted.</p>
<p>The flac tool is the tool created by the FLAC project to transcode to/from FLAC and to manipulate metadata in FLAC files. One advantage it has over other tools used to transcode into FLAC is the capability of embedding foreign metadata (such as BWF metadata). This means that it is possible to compress a BWF file into FLAC and maintain the ability to transcode back into an identical BWF, metadata and all. For a more detailed explanation, see <a href="http://dericed.com/2013/flac-in-the-archives/" target="_blank">Dave Rice's article</a> on the topic, from which the following commands are adapted.</p>
<h3>Transcode to FLAC</h3>
<p>Use this command to transcode from WAV to FLAC while maintaining BWF metadata</p>
<p><code>flac --best --keep-foreign-metadata --preserve-modtime --verify <em>input.wav</em></code></p>
@@ -2812,5 +2897,6 @@ Change the above data-target field, the hover-over description, the button text,
<p>Made with ♥ at <a href="https://wiki.curatecamp.org/index.php/Association_of_Moving_Image_Archivists_%26_Digital_Library_Federation_Hack_Day_2015" target="_blank">AMIA #AVhack15</a>! Contribute to the project via <a href="https://github.com/amiaopensource/ffmprovisr" target="_blank">our GitHub page</a>!</p>
</footer>
</div><!-- ends "grid" -->
<script src="js/js.js"></script>
</body>
</html>

4
js/jquery.min.js vendored

File diff suppressed because one or more lines are too long

126
js/js.js
View File

@@ -1,42 +1,96 @@
$(document).ready(function() {
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
function appendLink(id) {
$(id).next('div').find('.link').empty();
$(id).next('div').find('.link').append("<small>Link to this command: <a href='https://amiaopensource.github.io/ffmprovisr/index.html" + id + "'>https://amiaopensource.github.io/ffmprovisr/index.html" + id + "</a></small>");
}
function moveToRecipe(id) {
document.getElementById(id.substring(1)).checked = true;
$('html, body').animate({ scrollTop: $(id).offset().top }, 1000);
appendLink(id)
}
// open recipe window if a hash is found in URL
if (window.location.hash) {
id = window.location.hash
moveToRecipe(id)
}
// add hash URL when recipe is opened
$('label[class="recipe"]').on("click", function(){
id = $(this).attr("for");
window.location.hash = ('#' + id)
appendLink('#' + id)
})
// open recipe when clicked
$('a').on("click", function(){
intralink = $(this).attr("href")
if (intralink[0] == "#") {
moveToRecipe(intralink)
var animateScroll = function(){
currentTime += increment;
var val = Math.easeInOutQuad(currentTime, start, change, duration);
element.scrollTop = val;
if(currentTime < duration) {
setTimeout(animateScroll, increment);
}
}
animateScroll()
}
//t = current time, b = start value, c = change in value, d = duration
Math.easeInOutQuad = function (t, b, c, d) {
t /= d/2;
if (t < 1) return c/2*t*t + b;
t--;
return -c/2 * (t*(t-2) - 1) + b;
}
function appendLink(id) {
const link = document.getElementById(id).nextElementSibling.querySelector('.link')
if (link) {
link.innerHTML = ("<small>Link to this command: <a href='https://amiaopensource.github.io/ffmprovisr/index.html#" + id + "'>https://amiaopensource.github.io/ffmprovisr/index.html#" + id + "</a></small>")
}
}
function moveToRecipe(id) {
document.getElementById(id).checked = true;
scrollTo(document.body, 0, 1000);
appendLink(id)
}
// open recipe window if a hash is found in URL
if (window.location.hash) {
id = window.location.hash.slice(1)
moveToRecipe(id)
}
// add hash URL when recipe is opened
const recipes = document.querySelectorAll('label[class="recipe"]')
recipes.forEach(function(item, i){
item.addEventListener("click", function(){
id = this.getAttribute("for");
window.location.hash = (id)
appendLink(id)
})
})
// open all windows if button is clicked
$('#open-all').on("click", function(){
$('input[type=checkbox]').each(function(){
this.checked = !this.checked;
// open recipe when clicked
const links = document.querySelectorAll('a')
links.forEach(function(item, i){
item.addEventListener("click", function(){
intralink = this.getAttribute("href")
if (intralink[0] == "#") {
moveToRecipe(intralink.substring(1))
}
})
})
function getCheckedBoxes(checkboxes) {
var checkboxesChecked = [];
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].checked) {
checkboxesChecked.push(checkboxes[i]);
}
}
return checkboxesChecked.length > 0 ? checkboxesChecked : null;
}
// Collapse all recipes when button is clicked
document.getElementById('toggle-expand-collapse-all').addEventListener("click", function(){
const checkboxes = document.querySelectorAll('input[type=checkbox]')
var checked = getCheckedBoxes(checkboxes);
if (checked) {
// Collapse all
document.querySelectorAll('input[type=checkbox]').forEach(function(item, i){
item.checked = false;
})
} else {
// Expand all
document.querySelectorAll('input[type=checkbox]').forEach(function(item, i){
item.checked = true;
})
});
}
})
});

View File

@@ -5,17 +5,18 @@ Repository of useful FFmpeg command lines for archivists!
* [What is this?](#what-is-this)
* [How do I see it?](#how-do-i-see-it)
* [How do I contribute?](#how-do-i-contribute)
* [Guidelines for contributing](#guidelines-for-contributing)
* [Code of conduct](#code-of-conduct)
* [Maintainers](#maintainers)
* [Contributors](#contributors)
* [AVHack Team](#avhack-team)
* [Sister projects](#sister-projects)
* [Awards and mentions](#articles-and-mentions)
* [Articles and mentions](#articles-and-mentions)
* [License](#license)
## What is this?
#### Project Objective
### 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.
@@ -34,7 +35,7 @@ ffmprovisr
```
This works currently under macOS, Linux and the Linux apps on Windows (Ubuntu and Debian tested). On classic Windows you can install the last [release](https://github.com/amiaopensource/ffmprovisr/releases) manually and the open `index.html` in a browser.
#### Parseable list of the commands
### Parseable list of the commands
A list of all recipes in an easily parseable [ASCII text](recipes.txt) format is provided as well. It contains for each recipe its title and command in the following format:
@@ -58,15 +59,30 @@ The used [one-liner](scripts/get_recipe_list) is in the `scripts` folder.
You are welcome to edit the codebase yourself, or just supply the information and ask it to be added to the site.
#### Edit codebase
### Edit codebase
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.
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 a guideline for your command.
#### Make a request
#### Guidelines for contributing
* Recipes should ideally do just one thing or solve one problem, to keep things as user-friendly as possible and to avoid unintended side-effects
* Explanations and examples for recipes should be as generic as possible, to allow users to alter the command for their own use-case.
* This may involve the use of `VARIABLE_NAMES`
* Example: [Fade video and audio streams](https://amiaopensource.github.io/ffmprovisr/#fade_streams)
* Some recipes may benefit from including a GIF that shows the output
* Example: [Plays a graphical output showing decibel levels of an input file](https://amiaopensource.github.io/ffmprovisr/#astats)
* Some recipes require an explanatory section which may not fit gracefully into the recipe itself
* Example: [Rewrap a file](https://amiaopensource.github.io/ffmprovisr/#basic-rewrap)
* Recipes involving `-filter_complex` can be some of the most verbose and difficult to understand, so breaking these down as much as possible into their relevant sections is ideal
* Example: [Generate two access MP3s from input](https://amiaopensource.github.io/ffmprovisr/#append_mp3)
* Some recipes may refer to a specific standard or vocabulary, and it's useful to link to these so that the user can scale the recipe to their use case
* Example: [Generate Broadcast WAV](https://amiaopensource.github.io/ffmprovisr/#bwf)
### 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
### 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.
@@ -81,33 +97,38 @@ You can read our contributor code of conduct [here](https://github.com/amiaopens
## Contributors
* Gathered using [octohatrack](https://github.com/LABHR/octohatrack)
*Code Contributors*:
*Code Contributors*:
ablwr (Ashley)
alavigne12 (A. Lavigne)
Anushka-codergirl (Anushka Raj)
bastibeckr (Basti Becker)
b00giehead (Joanna White)
bturkus
dericed (Dave Rice)
digitensions (Joanna White)
edsu (Ed Summers)
jamessam (Jim Sam)
jfarbowitz (Jonathan Farbowitz)
kfrn (Katherine Frances Nagels)
kgrons (Kathryn Gronsbell)
kieranjol (Kieran O'Leary)
llogan (Lou)
llogan (Lou Logan)
macasaurusrex (Maura)
mgiraldo (Mauricio Giraldo)
pjotrek-b (Peter B.)
privatezero (Andrew Weaver)
retokromer (Reto Kromer)
rfraimow
*All Contributors*:
All Contributors:
ablwr (Ashley)
alavigne12 (A. Lavigne)
Anushka-codergirl (Anushka Raj)
audiovisualopen
bastibeckr (Basti Becker)
b00giehead (Joanna White)
brainwane (Sumana Harihareswara)
bturkus
dericed (Dave Rice)
digitensions (Joanna White)
drodz11 (Dave Rodriguez)
edsu (Ed Summers)
EG-tech (Ethan Gates)
@@ -122,7 +143,9 @@ kellyhaydon (metacynic)
kfrn (Katherine Frances Nagels)
kgrons (Kathryn Gronsbell)
kieranjol (Kieran O'Leary)
llogan (Lou)
llogan (Lou Logan)
macasaurusrex (Maura)
mercuryswitch
mgiraldo (Mauricio Giraldo)
mulvya
nkrabben (Nick Krabbenhoeft)
@@ -132,12 +155,13 @@ retokromer (Reto Kromer)
rfraimow
richardpl (Paul B Mahol)
ross-spencer (Ross Spencer)
taschenbach (Tommy Aschenbach)
todrobbins (Tod Robbins)
Repo: amiaopensource/ffmprovisr
Code Contributors: 17
All Contributors: 32
Last updated: 2019-02-11
GitHub Contributors: 20
All Contributors: 37
Last updated: 2019-12-11
## AVHack Team
@@ -148,7 +172,8 @@ Last updated: 2019-02-11
## Sister projects
[The Cable Bible](https://amiaopensource.github.io/cable-bible/): A Guide to Cables and Connectors Used for Audiovisual Tech
[QEMU QED](https://eaasi.gitlab.io/qemu-qed): instructions for using QEMU (Quick EMUlator), a command line application for computer emulation and virtualization
[FFCommand_Engine](https://github.com/ColorlabMD/FFCommand_Engine): a tool for easier use of FFmpeg binaries
[QEMU QED](https://eaasi.gitlab.io/program_docs/qemu-qed/): instructions for using QEMU (Quick EMUlator), a command line application for computer emulation and virtualization
[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.

View File

@@ -1,5 +1,7 @@
# Basic rewrap command
ffmpeg -i input_file.ext -c copy -map 0 output_file.ext
# Generate Broadcast WAV
ffmpeg -i input_file.wav -c copy -write_bext 1 -metadata field_name='Content' output_file.wav
# Rewrap DV video to .dv file
ffmpeg -i input_file -f rawvideo -c:v copy output_file.dv
# Transcode to deinterlaced Apple ProRes LT
@@ -14,6 +16,10 @@ ffmpeg -i input_file -map 0 -dn -c:v ffv1 -level 3 -g 1 -slicecrc 1 -slices 16 -
ffmpeg -i concat:input_file_1\|input_file_2\|input_file_3 -c:v libx264 -c:a aac output_file.mp4
# Transcode to an H.265/HEVC MP4
ffmpeg -i input_file -c:v libx265 -pix_fmt yuv420p -c:a copy output_file
# Transcode to H.264 using the GPU
ffmpeg -i input_file -c:v h264_nvenc -preset llhq -rc:v vbr_hq -cq:v 19 -b:v 8000k -maxrate:v 12000k -profile:v high -c:a copy output_file
# Transcode to H.265 using the GPU
ffmpeg -i input_file -c:v hevc_nvenc -preset llhq -rc:v vbr_hq -cq:v 19 -b:v 5000k -maxrate:v 8000k -profile:v main10 -c:a copy output_file
# Transcode to an Ogg Theora
ffmpeg -i input_file -acodec libvorbis -b:v 690k output_file
# Convert WAV to MP3
@@ -36,6 +42,8 @@ ffmpeg -i input_file -c:v copy -aspect 4:3 output_file
ffmpeg -i input_file -c:v libx264 -vf colormatrix=src:dst output_file
# Modify image and sound speed
ffmpeg -i input_file -r output_fps -filter_complex "[0:v]setpts=input_fps/output_fps*PTS[v]; [0:a]atempo=output_fps/input_fps[a]" -map "[v]" -map "[a]" output_file
# Fade both video and audio streams
ffmpeg -i input_file -filter:v "fade=in:st=0:d=1, fade=out:st=59:d=1" -filter:a "afade=in:st=0:d=1, afade=out:st=59:d=1" -c:v libx264 -c:a aac output_file
# Synchronize video and audio streams
ffmpeg -i input_file -itsoffset 0.125 -i input_file -map 1:v -map 0:a -c copy output_file
# Clarify stream properties
@@ -104,7 +112,7 @@ ffmpeg -i input_file -ss 00:00:20 -vframes 1 thumb.png
ffmpeg -i input_file -vf fps=1/60 out%d.png
# Create GIF from still images
ffmpeg -f image2 -framerate 9 -pattern_type glob -i "input_image_*.jpg" -vf scale=250x250 output_file.gif
# Create GIF from a video
# Create GIF from a video
ffmpeg -ss HH:MM:SS -i input_file -filter_complex "fps=10,scale=500:-1:flags=lanczos,palettegen" -t 3 palette.png
ffmpeg -ss HH:MM:SS -i input_file -i palette.png -filter_complex "[0:v]fps=10, scale=500:-1:flags=lanczos[v], [v][1:v]paletteuse" -t 3 -loop 6 output_file
# Transcode an image sequence into uncompressed 10-bit video
@@ -157,7 +165,7 @@ ffmpeg -f lavfi -i smptebars=size=720x576:rate=25 -c:v prores -t 10 output_file
ffmpeg -f lavfi -i testsrc=size=720x576:rate=25 -c:v v210 -t 10 output_file
# Play HD SMPTE bars
ffplay -f lavfi -i smptehdbars=size=1920x1080
# Play VGA SMPTE bars
# Play VGA SMPTE bars
ffplay -f lavfi -i smptebars=size=640x480
# Generate a sine wave test audio file
ffmpeg -f lavfi -i "sine=frequency=1000:sample_rate=48000:duration=5" -c:a pcm_s16le output_file.wav
@@ -177,7 +185,7 @@ ffmpeg -i input_one -i input_two -filter_complex signature=detectmode=full:nb_in
ffmpeg -i input -vf signature=format=xml:filename="output.xml" -an -f null -
# Play an image sequence
ffplay -framerate 5 input_file_%06d.ext
# Split audio and video tracks
# Split audio and video tracks
ffmpeg -i input_file -map 0:v:0 video_output_file -map 0:a:0 audio_output_file
# Merge audio and video tracks
ffmpeg -i video_file -i audio_file -map 0:v -map 1:a -c copy output_file
@@ -191,22 +199,3 @@ ffmpeg -i input_file -filter:v drawbox=w=iw:h=7:y=ih-h:t=max output_file
ffmpeg -re -i ${INPUTFILE} -map 0 -flags +global_header -vf scale="1280:-1,format=yuv420p" -pix_fmt yuv420p -level 3.1 -vsync passthrough -crf 26 -g 50 -bufsize 3500k -maxrate 1800k -c:v libx264 -c:a aac -b:a 128000 -r:a 44100 -ac 2 -t ${STREAMDURATION} -f tee "[movflags=+faststart]${TARGETFILE}|[f=flv]${STREAMTARGET}"
# View FFmpeg subprogram information
ffmpeg -h type=name
# Rip a CD with CD Paranoia
cdparanoia -L -B -O [Drive Offset] [Starting Track Number]-[Ending Track Number] output_file.wav
# Rip a CD with Cdda2wav
cdda2wav -L0 -t all -cuefile -paranoia paraopts=retries=200,readahead=600,minoverlap=sectors-per-request-1 -verbose-level all output.wav
# Compare two images
compare -metric ae image1.ext image2.ext null:
# Create thumbnails of images
mogrify -resize 80x80 -format jpg -quality 75 -path thumbs *.jpg
# Creates grid of images from text file
montage @list.txt -tile 6x12 -geometry +0+0 output_grid.jpg
# Get file signature data
convert -verbose input_file.ext | grep -i signature
# Removes exif metadata
mogrify -path ./stripped/ -strip *.jpg
# Resizes image to specific pixel width
convert input_file.ext -resize 750 output_file.ext
# Transcoding to/from FLAC
flac --best --keep-foreign-metadata --preserve-modtime --verify input.wav
flac --decode --keep-foreign-metadata --preserve-modtime --verify input.flac

View File

@@ -4,17 +4,12 @@
# connected to the Web, and the local version otherwise.
if [[ "$(uname -s)" = "Darwin" ]] ; then
default_browser=$(plutil -convert json ~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist -r -o - | grep https -b1 | tail -n1 | cut -d'"' -f4)
if ping -c 1 amiaopensource.github.io >/dev/null 2>&1 ; then
ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/'
else
ffmprovisr_path=$(find /usr/local/Cellar/ffmprovisr -iname 'index.html' | sort -M | tail -n1)
fi
if [[ -n "${default_browser}" ]] ; then
open -b "${default_browser}" "${ffmprovisr_path}"
else
open "${ffmprovisr_path}"
fi
open "${ffmprovisr_path}"
elif [[ "$(uname -s)" = "Linux" ]] ; then
if ping -c 1 amiaopensource.github.io >/dev/null 2>&1 ; then
ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/'