Coder Social home page Coder Social logo

avmerge's Introduction

avmerge

A simple Perl script that merges matching subsequent audio and video files into a single file with ffmpeg.

Document last updated 23nd December, 2020 (8 Tevet 5781);

Table of Contents

About avmerge

avmerge is a simple Perl script that merges matching subsequent audio and video files into a single file with ffmpeg.

It works by looking for files that use the file extension provided as the argument import_file_extension in the working directory. Once it has found a file with the file extension, it then looks for another file with the same file extension. Once it finds two files, it merges them together with ffmpeg.

This script should only be used for merging files in directories that contain an even number of files (i.e. only matching pairs of files). The script currently does not compare the names of the files, so it will not work if the files are not in the same order, and it may incorrectly merge mismatching files if there is an odd number of files with the relevant file extension within the working directory.

Please note that this script does not remove any files after the merging process is complete. You must remove the original files manually if you wish to do so.

How to use avmerge

Before you can use avmerge, you must install FFmpeg globally.

To use avmerge in a single directory without installing it, the following steps are required.

  1. Download the avmerge.pl file from this repository;
  2. Move the avmerge.pl file into the directory;
  3. Run the script via ./avmerge.pl with two arguments:
    • the first argument, import_file_extension, should be the file extension of both of the files that you wish to merge.
    • the second argument, export_file_extension, should be the file extension of the resulting combined file.

Full example:

perl avmerge.pl webm mkv

To use avmerge globally, the following steps are required.

  1. Download avmerge.pl, avmerge.8, and install.sh;
  2. Run install.sh as root;
  3. Run the script via avmerge with two arguments:
    • the first argument, import_file_extension, should be the file extension of both of the files that you wish to merge.
    • the second argument, export_file_extension, should be the file extension of the resulting combined file.

Full example:

avmerge webm mkv

Read the man page avmerge(8) for more details, including information on additional options and arguments.

Contributing

Contributions can be made in the form of pull requests, or via bug reports and suggestions in the repository issues.

All contributors must assign the copyright of their contribution to the author of the project. This is to avoid the myraid of issues caused by having multiple intellectual property holders in a single project.

License

Copyright © 2020 Rachel Michaela Bradley.

avmerge is released in its entirety under the BSD 2-Clause License. The full text of this license is available in the COPYING file.

Acknowledgements

  • Thanks to the FFmpeg project team for their useful programmes.

avmerge's People

Contributors

rachelmichaela avatar

Stargazers

brian avatar

Watchers

 avatar

avmerge's Issues

auto overwriting existing files

possibly add a -y flag to overwrite existing files
Might also be a good idea to simply add a flag to allow passing of raw FFmpeg arguments through the script.
This would prevent duplication of effort on your part, and let us fine tune our scripts much closer than we would be able to otherwise.

Replace sequential matching with fuzzy matching as the default mode

Fuzzy matching of file names should be introduced as a preferred alternative to the current sequential matching. Sequential matching should work for most use cases, but there are edge cases where it will fail spectacularly. A good example is if the files are named similarly, but they all have a numbered prefix that does not preserve the correct order for sequential matching.

This will complement #1.

Processed files

Possibly adding an option to move files that have been processed through ffmpeg into their own sub-folder, or possibly just deleting them outright?

Recersive option

Any chance we could get a recursive option to go through sub-folders?

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.