palkia has asked for the wisdom of the Perl Monks concerning the following question:

Hello everyone.

As the title hints, I would like to break apart mp4 videos to animation and sound, so these may be edited, and recombined, to form an edited version of the mp4 file.
My question is: do you know of any good and reliable modules that can help me do so ?

Thank you very much for any assistance ☺

Replies are listed 'Best First'.
Re: Mp4 editing
by marto (Cardinal) on Aug 25, 2016 at 07:43 UTC

    You want to split the streams, use ffmpeg, there are various modules on cpan, you'll have to investigate since I've never used them. This, or something similar has likely been asked before Super Search is your friend. Openshot is a nice cross platform solution for editing and recombining various A/V streams.

Re: Mp4 editing
by kevbot (Vicar) on Aug 25, 2016 at 02:57 UTC
      Thank you kevbot.

      I have encountered this module on my cpan search too, however as far as I can tell, this module only refers to metadata, types, and other hyperparameters.
      For example it has a constant MP4_AUDIO_TRACK_TYPE but no "getAudio" or "getAnimation" subroutines etc.

      Also there is practically no documentation as far as I can see, it says to refer to libmp4v2 for details, but I can't find anything about whatever that is.
      I can't even begin to speculate what "verbosity" may refer to.

      I am not yet an expert Perler, so maybe I just don't understand some of the terminology or conventions used in the MP4::File's documentation, but I doubt that's the problem.

      Do you understand it better ? Have I misinterpreted anything ?
      Thx.
        Hi palkia,

        Your interpretation seems correct to me. However, I'm not very familiar with video editing. It seems that the mp4 format is just a container, and the audio and video inside the container could be in just about any format. So, any parsing library that you find would have to support the audio and video codecs that are used in your files. Hopefully other monks that are more knowledgeable in this area will reply. I searched around but I did not find a perl library (I did find this Java library: http://github.com/sannies/mp4parser).