Giter VIP home page Giter VIP logo

ffmprovisr's Introduction

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.

How do I see it?

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.

You can also install the latest release on your computer with the two commands:

brew tap amiaopensource/amiaos
brew install ffmprovisr

and then call it locally with the command:

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 manually and the open index.html in a browser.

Parseable list of the commands

A list of all recipes in an easily parseable ASCII text format is provided as well. It contains for each recipe its title and command in the following format:

# title of recipe 1
ffmpeg command 1
# title of recipe 2
ffmpeg command 2

...

# title of recipe n-1
ffmpeg command n-1
# title of recipe n
ffmpeg command n

The used one-liner is in the scripts folder.

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.

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 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.

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.
  • Some recipes may benefit from including a GIF that shows the output
  • Some recipes require an explanatory section which may not fit gracefully into the recipe itself
  • 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
  • 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

Make a request

If you are having trouble with coding it yourself or with GitHub, feel free to submit an issue 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 for anything that sounds confusing and requires clarification.

Code of Conduct

You can read our contributor code of conduct here.

Maintainers

Ashley Blewer, Katherine Frances Nagels, Kieran O'Leary and Andrew Weaver

Contributors

Code Contributors:
ablwr (Ashley)
alavigne12 (A. Lavigne)
Anushka-codergirl (Anushka Raj)
bastibeckr (Basti Becker)
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 Logan)
macasaurusrex (Maura)
mgiraldo (Mauricio Giraldo)
pjotrek-b (Peter B.)
privatezero (Andrew Weaver)
retokromer (Reto Kromer)
rfraimow

All Contributors:
ablwr (Ashley)
alavigne12 (A. Lavigne)
Anushka-codergirl (Anushka Raj)
audiovisualopen
bastibeckr (Basti Becker)
brainwane (Sumana Harihareswara)
bturkus
dericed (Dave Rice)
digitensions (Joanna White)
drodz11 (Dave Rodriguez)
edsu (Ed Summers)
EG-tech (Ethan Gates)
federicomenaquintero (Federico Mena Quintero)
Fizz24
GregH18
jamessam (Jim Sam)
jfarbowitz (Jonathan Farbowitz)
JonnyTech
jronallo (Jason Ronallo)
kellyhaydon (metacynic)
kfrn (Katherine Frances Nagels)
kgrons (Kathryn Gronsbell)
kieranjol (Kieran O'Leary)
llogan (Lou Logan)
macasaurusrex (Maura)
mercuryswitch
mgiraldo (Mauricio Giraldo)
mulvya
nkrabben (Nick Krabbenhoeft)
pjotrek-b (Peter B.)
privatezero (Andrew Weaver)
retokromer (Reto Kromer)
rfraimow
richardpl (Paul B Mahol)
ross-spencer (Ross Spencer)
taschenbach (Tommy Aschenbach)
todrobbins (Tod Robbins)

Repo: amiaopensource/ffmprovisr
GitHub Contributors: 20
All Contributors: 37
Last updated: 2019-12-11

AVHack Team

Association of Moving Image Archivists & Digital Library Federation Hack Day 2015

Ashley Blewer, Eddy Colloton, Rebecca Dillmeier, Jonathan Farbowitz, Rebecca Fraimow, Samuel Gutterman, Kelly Haydon, Reto Kromer, Nicole Martin, Katherine Frances Nagels, Kieran O'Leary, Catriona Schlosser, Ben Turkus

Sister projects

The Cable Bible: A Guide to Cables and Connectors Used for Audiovisual Tech
FFCommand_Engine: a tool for easier use of FFmpeg binaries
QEMU QED: instructions for using QEMU (Quick EMUlator), a command line application for computer emulation and virtualization
Script Ahoy: Community Resource for Archivists and Librarians Scripting
sourcecaster: helps you use the command line to work through common challenges that come up when working with digital primary sources.

Articles and mentions

License

Creative Commons License
This work by ffmprovisr is licensed under a Creative Commons Attribution 4.0 International License.
Based on a work at https://github.com/amiaopensource/ffmprovisr.

ffmprovisr's People

Contributors

ablwr avatar alavigne12 avatar anushka-codergirl avatar axfelix avatar bastibeckr avatar bturkus avatar dalelore avatar dericed avatar digitensions avatar dnicolson avatar edsu avatar eg-tech avatar jamessam avatar jfarbowitz avatar jmf-nyu avatar kfrn avatar kgrons avatar kieranjol avatar macasaurusrex avatar mgiraldo avatar mobygamer avatar pjotrek-b avatar privatezero avatar retokromer avatar rfraimow avatar todrobbins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ffmprovisr's Issues

Audio Dropout on FFplay

Hi there,

Not sure if i have the right place for this question but I have several video files each roughly the same file size and bit rate. They all play well with vlc/quicktime however with ffplay the audio dropouts every consistently throughout playback.

This is mediainfo report on one of the files . Is there an incompatible codec I am working with? I also transcoded the file to a h.264 file with ffmpeg and it played well in ffplay.

Any advice? Thanks in advance


General
Complete name                            : /Users/EQ2317/Desktop/harry.mov
Format                                   : MPEG-4
Format profile                           : QuickTime
Codec ID                                 : qt   2005.03 (qt  )
File size                                : 26.4 GiB
Duration                                 : 17mn 1s
Overall bit rate                         : 222 Mbps
Encoded date                             : UTC 2016-07-21 16:14:58
Tagged date                              : UTC 2016-07-21 16:26:17
Writing library                          : Apple QuickTime
com.apple.proapps.logNote                : harry_new
com.apple.proapps.reel                   : 001
com.apple.proapps.scene                  : Scene 01
Media/UUID                               : 8CE6BF11-1ABF-4D4B-978D-9D841DD8F66F

Video
ID                                       : 1
Format                                   : YUV
Codec ID                                 : v210
Codec ID/Hint                            : AJA Video Systems Xena
Duration                                 : 17mn 1s
Bit rate mode                            : Constant
Bit rate                                 : 221 Mbps
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 29.970 (30000/1001) fps
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 10 bits
Scan type                                : Interlaced
Scan type, store method                  : Interleaved fields
Scan order                               : Bottom Field First
Compression mode                         : Lossless
Bits/(Pixel*Frame)                       : 21.333
Stream size                              : 26.3 GiB (99%)
Language                                 : English
Encoded date                             : UTC 2016-07-21 16:14:58
Tagged date                              : UTC 2016-07-21 16:26:17
Color primaries                          : BT.601 NTSC
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.601

Audio
ID                                       : 3
Format                                   : PCM
Format settings, Endianness              : Little
Format settings, Sign                    : Signed
Codec ID                                 : sowt
Duration                                 : 17mn 1s
Bit rate mode                            : Constant
Bit rate                                 : 1 536 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Stream size                              : 187 MiB (1%)
Language                                 : English
Encoded date                             : UTC 2016-03-21 16:26:01
Tagged date                              : UTC 2016-03-21 16:26:17

Other
ID                                       : 2
Type                                     : Time code
Format                                   : QuickTime TC
Duration                                 : 17mn 1s
Time code of first frame                 : 04:44:44;04
Time code, striped                       : Yes
Title                                    : time
Language                                 : English
Encoded date                             : UTC 2016-03-21 16:26:01
Tagged date                              : UTC 2016-03-21 16:26:17

Transcode into a deinterlaced Apple ProRes LT

Transcode into a deinterlaced Apple ProRes LT

  • What about a button just with transcoding into ProRes and
    an other (= this) button with additional options, e.g.
    de-interlacing?
    (c/o Reto)

deinterlacing command (+question)

the @privatezero tutorial last week got me thinking about deinterlacing. the only yadif flag in ffmprovisr is in the "Transcode to Prores" command.

Wondering if there should be something separate for clarity, and wondering if anyone has any exp with deinterlacing filters other than yadif (I count 4 others: bwdif, kerndeint, nnedi, w3fdif).

Alternatively, does anyone have a method for controlled deinterlacing (or denoising) testing?

thanks.

Lossless Segmentation and Concatenate for Preservation

Hi all, as archives may wish to create preservation clips in a lossless fashion from digital masters, maybe instructions on lossless segmentation and and concatenation would be beneficial?

As there is already in commands for clipping and concatenate (Join files together/Trim a video) without re-encoding, maybe they could be added to the preservation section as well with an emphases on the stream copy function:
-c copy
use stream copy mode to re-mux instead of re-encode

thanks and what a great resource.

regards,
Andrew

write demo of scene change splitting

Here's a start. I think it would need to be in two passes, one to get the scene change times and one to split, so first pass with signalstats and 2nd with the segment muxer.

This command outputs a csv of the time of scene change and the YDIF value. I'm using 10 below as a scene change threshold, adjust as needed.

ffprobe -f lavfi movie=HEY.mkv,signalstats -show_entries frame=pkt_pts_time:frame_tags=lavfi.signalstats.YDIF -of compact=p=0:nk=1:s=',' | awk -F, '$2 > 10'

The csv could then be processed to make it an input to the segment_times option of the segment muxer, see: http://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-ssegment

wishlist: link directly to a recipe

As the number of recipes increases, I think it could be useful to be able to link directly to a recipe.
I don't know how to implement this, but if there's any repetitive retrospective data entry required to make those links, I'll volunteer to do it, once I know roughly what to do.

Thanks!

Wish - changelog/what's new on homepage

Is it possible to add a changelog or a 'most recent recipes' page to the site? Someone on AMIA-L recently asked for something somewhat similar, though I think he wanted updates posted on the listserv instead. It could be useful for visitors who may not notice that a new recipe has been added, and it could also be a useful promotional tool as we could link to the new scripts on various public forums.

I'm not sure if linking to the commit history would be the best way to go about it as it could confuse people not familar with github.

Interlaced ProRes

At a some point, I guess, we should also consider an example of interlaced ProRes.

ffmpeg -h foo=bar

@kieranjol Maybe you could add here as recipe the information you posted on FFmpeg-user? The general command with the examples ffmpeg -h encoder=ffv1 and ffmpeg -h muxer=matroska would be very useful, in my opinion. (If you don’t have the time, just let me know, and I’ll do.)

Batch processing for Windows?

Hi all, I have a batch script for Windows (PowerShell) that I could add as a separate command.
Maybe we have some Windows users that would like to automate tasks. What do you all think?

-report parameter

We should find something nice that is improved by the use of the -report parameter. Suggestions welcome!

Wish: Lump issues into categories

Sort the code blocks into categories with subheadings for better organization of information. This ticket entails thought towards how to best categorize these scripts and also implementation of that categorization. Ideas for categories are something like... access copy creation, format transformation, exporting, image extraction, snippet extraction, digital preservation methods.

Wish: Make accessible offline

Right now there's a JS dependency called by a CDN. It'd be good if this was integrated into the app so it could be downloaded and run even without an internet connection. Also the cute fonts drop out. ;)

Additionally it would be good to reduce the overall weight of the application with consideration to slow connections.

Wish - png watermark overlay

I'm currently working on scripts that automate the addition of head and tail plates to a .mov, while adding a transparent png watermark that kicks in after 3.5 seconds.
ffmpeg -safe 0 -f concat -i mylist.txt -i "/Users/bla/playertests/logo.png" -c:v prores -filter_complex "overlay=:enable='between(t,3.5,2000)':main_w-overlay_w-5:5,yadif" outputrigh12345.mov
I'll add something like this over the coming days.

Wish: Better documentation

Boost up documentation on contribution guides and ways people can contribute / make it as easy as possible for contributions to happen.

How to check frame md5s

Create frame md5s

  • We should also indicate in an additional button how to check if the MD5 are correct or not.
    (c/o Reto)

input > process > output

What about a little different structure?
One can chose between

  • different input formats,
  • different actions to apply, and
  • different output formats.

Then the app generates the corresponding window with the full command and the related explanations.
(As it's three-dimensional, that would be a kind Rubik's Cube for audio-visual archivists.)

Add CRALS/sourcecaster

We link to CRALS and Sourcecaster in the README but I think we should link to it on the site itself, underneath the link to the CLI learning resource. I can do this but not at this time, so filing an Issue for the middle period (or if someone else wants to do it).

CSS: 0 o O

Inside the tag the zeroes look like zeroes, but in the

tag (or
?) the zeroes look like lower-case letters o.

extract audio

Saw someone asking about this on the internet so a mental reminder to add script that extracts audio without loss from a video file: ffmpeg -i video.[mp4] -vn -acodec copy audio-only-file.[aac]

Wish: reduce bloat

Reduce the overall weight of the application with consideration to slow connections. This can be done by cutting out lazy dependencies on Bootstrap and jQuery and using only what is necessary.

Suggested addition: Excerpt from end

Adapted from existing Excerpt to end

Excerpt from end

ffmpeg -i input_file -sseof -5 -c copy output_file

This command copies a video file starting from a specified time before the end of the file, removing everything before from the output. This can be used to create an excerpt, or extract content from the end of a video file.

ffmpeg
starts the command
-i input_file
path, name and extension of the input file
-sseof -5
Tells ffmpeg what timecode in the file to look for to start copying, and specifies the number of seconds from the end of the video that ffmpeg should start copying. The end of the file has index 0 and the minus sign is needed to reference earlier portions. To be more specific, you can use timecode such as 00:00:05.
-c copy
use stream copy mode to re-mux instead of re-encode
output_file
path, name and extension of the output file

Adding Bash Scripts to ffmprovisr

Continued from here, if that's OK? #36

Im not sure how ye see longer scripts within ffmprovisr.. Go with bash or also include other languages that also allows Window support? Or do ye want to keep the site to single ffmpeg commands?

It could be handy to knock up a simple watermark script, where the font size is calculated in proportion to video height?
Or possibly check what the codec and wrapper is of each file in a directory, and transcode if certain conditions are met?

Here's a python one that (last time I checked) works in windows and OSX - haven't tried Ubuntu yet but it should work.
https://github.com/kieranjol/pyh264bitc/blob/master/py_h264_bitc.py
I need to change a good few things in that script, mostly based on things I've learned from ffmprovisr! Also there's some things in there that are specific to where I work which should be removed.
The main difference in terms of OS adjustments is getting python to escape the colons in the timecode/fontpath in different ways depending on which OS it detects.

issues with thumbnail generation

There seem to be some overlaping/broken commands in this section.

https://amiaopensource.github.io/ffmprovisr/#thumbnails
This command is called "generate thumbnails" in the plural, but actually seems closer to the script for generating only one. The explanation within this command also refers only to making a thumbnail "at a specific time" so there is discrepancy between the title and explanation.

Additionally, in its current form with an extra input tied to a variable, the script is broken. Is this a typo, or was it trying to do something else that accidentally didn't make it into the final script? (Since the annotations don't mention anything else I suspect the first explanation).

Since there already are commands for creating both single and multiple thumbnails, is this command redundant?

Worth adding how to decode a file with -f null - ?

Is it worth showing how to just decode a file in order to check fixity against internal crcs in an mkv? I'm not sure if this is too obvious/simple?I'd like to get feedback on this before I create an entry.
Something like ffmpeg -i input_file -f null -

I would find this useful within a preservation context. I didn't know how to harness fixity info within a container/codec until @dericed showed me on twitter. Perhaps there's other benefits to this beyond fixity?

If it is worthy of inclusion, should it be called "verify embedded checksums" or should it just be called something general like "decode a file"?
There's also the err_detect bitstream and crccheck tools but I don't see any benefit to these over just decoding to -f null - , though I'm probably using them incorrectly.

Change display aspect ratio is misleading

Hey, as discovered at the Tate workshops, the change display aspect ratio recipe (that i wrote)is misleading,as it also transcodes to prores.As stream copy doesn't work with a filter, specifying a codec is required .
@dericed wrote a better one in his 'change stream properties' script,which uses field_order,but from my limited tests, this doesn't work with Matroska,only mov(probably mp4 too?).

I think the setfield script should stay in but a better explanation is required so that the re-encode is made more obvious.

mp3 constant quality

In the WAV to .mp3 script ffmprovisr gives instructions for a constant bit rate which will result in access files that are significantly larger than if a constant quality setting was used.
http://amiaopensource.github.io/ffmprovisr/#wav_to_mp3

FFMpeg's documentation suggests that anything set between -qscale:a 0 and -qscale:a 3 should in most cases be indistinguishable from files encoded with the max constant bitrate in terms of sound quality:
https://trac.ffmpeg.org/wiki/Encode/MP3.

Is this worth revising, or making a note about constant quality vs bit rate?

License

Someone just asked if they could use this template for another project and I realized we don't have a license! I'm happy with the most open CC license. Can I get a +1?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.