Giter VIP home page Giter VIP logo

video-editing-automation's People

Contributors

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

video-editing-automation's Issues

[SUGGESTION] Audio/video multitracks synch by audio aligning

It would be extremely useful (especially for multicam editors) to have a paltform-indipendent library - in order to be used by open source DAW/NLEs - able to automatically synch multiple audio (and therefore also videos) tracks between them.

I found some interesting resources that may help to build it:

Hope that inspires.

Undefined Symbols: Linker error for Mac OSX

I built the ffmpeg library successfully on Mac OSX and I was trying to build your Video Automation project. I got the following linker error. Has anyone else run into this issue and know a solution?

cc   bin/examples/ffmpeg/demuxing_decoding.o    -o bin/examples/ffmpeg/demuxing_decoding
Undefined symbols for architecture x86_64:
  "_av_dict_set", referenced from:
      _open_codec_context in demuxing_decoding.o
  "_av_dump_format", referenced from:
      _main in demuxing_decoding.o
  "_av_find_best_stream", referenced from:
      _open_codec_context in demuxing_decoding.o
  "_av_frame_alloc", referenced from:
      _main in demuxing_decoding.o
  "_av_frame_free", referenced from:
      _main in demuxing_decoding.o
  "_av_frame_unref", referenced from:
      _decode_packet in demuxing_decoding.o
  "_av_free", referenced from:
      _main in demuxing_decoding.o
  "_av_get_bytes_per_sample", referenced from:
      _decode_packet in demuxing_decoding.o
  "_av_get_media_type_string", referenced from:
      _open_codec_context in demuxing_decoding.o
  "_av_get_packed_sample_fmt", referenced from:
      _main in demuxing_decoding.o
  "_av_get_pix_fmt_name", referenced from:
      _main in demuxing_decoding.o
      _decode_packet in demuxing_decoding.o
  "_av_get_sample_fmt_name", referenced from:
      _main in demuxing_decoding.o
      _get_format_from_sample_fmt in demuxing_decoding.o
  "_av_image_alloc", referenced from:
      _main in demuxing_decoding.o
  "_av_image_copy", referenced from:
      _decode_packet in demuxing_decoding.o
  "_av_init_packet", referenced from:
      _main in demuxing_decoding.o
  "_av_packet_unref", referenced from:
      _main in demuxing_decoding.o
  "_av_read_frame", referenced from:
      _main in demuxing_decoding.o
  "_av_sample_fmt_is_planar", referenced from:
      _main in demuxing_decoding.o
  "_av_seek_frame", referenced from:
      _main in demuxing_decoding.o
  "_av_strerror", referenced from:
      _av_make_error_string in demuxing_decoding.o
  "_avcodec_alloc_context3", referenced from:
      _open_codec_context in demuxing_decoding.o
  "_avcodec_decode_audio4", referenced from:
      _decode_packet in demuxing_decoding.o
  "_avcodec_decode_video2", referenced from:
      _decode_packet in demuxing_decoding.o
  "_avcodec_find_decoder", referenced from:
      _open_codec_context in demuxing_decoding.o
  "_avcodec_free_context", referenced from:
      _main in demuxing_decoding.o
  "_avcodec_open2", referenced from:
      _open_codec_context in demuxing_decoding.o
  "_avcodec_parameters_to_context", referenced from:
      _open_codec_context in demuxing_decoding.o
  "_avformat_close_input", referenced from:
      _main in demuxing_decoding.o
  "_avformat_find_stream_info", referenced from:
      _main in demuxing_decoding.o
  "_avformat_open_input", referenced from:
      _main in demuxing_decoding.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bin/examples/ffmpeg/demuxing_decoding] Error 1

Audio based editing

Why not?
It would be better, maybe as a second option to edit the video.

Like skipping silent moments.

Or even comparing the start frame and the ending frame based on the duration and see whether it was changed or not if so you could have option like fast forwarding if there was no audio.

And so on..

Just a note: i didn't read the source code, maybe you're doing that already idk

Stack Buffer Overflow at src/Sequence.c

In file src/Sequence.c at line 567 a stack buffer overflow can occur due to the fact that there's no length check on the buf local variable.

/**
 * get sequence string
 * @param  seq Sequence to get data
 * @return     string allocated on heap, to be freed by caller
 */
char *print_sequence(Sequence *seq) {
    // (...)
    char buf[4096];
    // (...)

    for(int i = 0; currNode != NULL; i++) {

        // Here it is!!
        sprintf(buf, "Clip [%d]\nurl: %s\nstart_pts: %ld\nend_pts: %ld\norig_start_pts: %ld\norig_end_pts: %ld\nvid_ctx: %p\n",
                i, c->vid_ctx->url, c->start_pts, c->end_pts, c->orig_start_pts, c->orig_end_pts, c->vid_ctx);
    }
    return str;
}

This can lead to a crash or to arbitrary code execution.

I wrote a POC for showing this:

/**
 * This is a proof of concept of a possible buffer overflow
 * in src/Sequence.c -> print_sequence() -> line: 567
 *
 * A buffer overflow can occur by trying to print a sequence
 * with a large enough path.
 *
 * In UNIX, the maximun size of a path is 4096 bytes, so in this
 * POC we still handle realistic sizes.
 */

#include "Timebase.h"
#include "Sequence.h"
#include "OutputContext.h"

int main(int argc, char **argv) {
    Sequence seq;
    init_sequence(&seq, 30, 48000);

    char *large_buffer = (char *)malloc(4096);
    for (uint64_t i = 0; i < 4096; i++){
      *(large_buffer+i) = 'A';
    }
    Clip *clip = malloc(sizeof(Clip));
    init_clip(clip, large_buffer);

    open_clip(clip);

    set_clip_bounds(clip, 53, 61);

    sequence_append_clip(&seq, clip);

    char *str = print_sequence(&seq);
    printf("Sequence:\n%s\n", str);
    free(str);
    str = NULL;


    free_sequence(&seq);
    return 0;
}

And here's the crash log:

Could not open source file AAAAAAAAAAAA(skipped...)AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
open_clip() error: Failed to open VideoContext for clip[AAAAAAAAAAAAAAAAA(skipped...)AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA]
Video stream does not exist
sequence add clip [AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA(skipped...)AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA], start_pts: 0
Failed to get video time_base: clip[AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA(skipped...)AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA] is not open
*** stack smashing detected ***: <unknown> terminated
Aborted (core dumped)

As the maximum size of a UNIX path is 4096 bytes, my idea for fixing this is pretty simple:

  1. Make the variable buf bigger so that it can fit a 4096 bytes path.
  2. Check at the start of the function if the path is bigger than 4096 bytes, and if so:
    Option 1: Cut it
    Option 2: return -1 and abort

Music based editing

You feed the program a music clip along with the video files and it cuts the video synced with the music.

parameters cannot be NULL

I finally got your code up and running in my Ubuntu virtual machine, but when I try to run it with either MP4 files OR MOV files, it simply gives the following error:
Could not open source file /home/creepinson/vid/HD0048.mp4
open_clip() error: Failed to open VideoContext for clip[/home/creepinson/vid/HD0048.mp4]
add_files() warning: failed to allocate clip[/home/creepinson/vid/HD0048.mp4]
sequence_insert_clip_sorted() error: parameters cannot be NULL....

And this happens when I run this command:
./bin/examples/random-splice out.mov 60 44100 ~/vid/ 300 13 10

When I remove the / after ~/vid
it simply gives this error:
pick_frames() error: sequence duration[0] is invalid
random_cut() error: Failed to pick frames....

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.