Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concatenate multiple h264 files in a folder then convert to mp4 #12

Closed
younganakin opened this issue Sep 27, 2017 · 5 comments
Closed
Assignees
Labels

Comments

@younganakin
Copy link

How do you concatenate multiple files in a folder?
Equivalent to this in ffmpeg command line but without the mylist.txt
ffmpeg -f concat -i mylist.txt -c copy output.mp4

@tomaszzmuda
Copy link
Owner

Hi.
In ConversionHelper.cs is a method:

        /// <summary>
        ///     Concat multiple inputVideos
        /// </summary>
        /// <param name="output">Concatenated inputVideos</param>
        /// <param name="inputVideos">Videos to add</param>
        /// <returns>Conversion result</returns>
        [UsedImplicitly]
        public static async Task<bool> JoinWith(string output, params string[] inputVideos)

or you can use Concat(params string[] paths) in Conversion class.
Example:

await new Conversion().
                Concat(pathList.ToArray())
                                         .StreamCopy(Channel.Both)
                                         .SetBitstreamFilter(Channel.Audio, Filter.Aac_AdtstoAsc)
                                         .SetOutput(output)
                                         .Start();

I hope this what are you looking for. If not please tell me more about effect you want to get, I'll implement this.

@younganakin
Copy link
Author

Thanks for your help......it works....

@jawadatgithub
Copy link

The current Concat implementation is limited:
https://github.com/tomaszzmuda/Xabe.FFmpeg/blob/master/Xabe.FFmpeg/Conversion.cs#L422

as it follow https://trac.ffmpeg.org/wiki/Concatenate#protocol
ffmpeg -i "concat:input1.mpg|input2.mpg|input3.mpg" -c copy output.mpg

Implementing ffmpeg -f concat -i mylist.txt -c copy output.mp4 requires https://trac.ffmpeg.org/wiki/Concatenate#demuxer

@tomaszzmuda
Copy link
Owner

@jawadatgithub
Thank you for note that.
I'll implement it in few days.

@tomaszzmuda tomaszzmuda reopened this Oct 4, 2017
@tomaszzmuda tomaszzmuda self-assigned this Oct 4, 2017
@tomaszzmuda tomaszzmuda modified the milestone: 2.1.0 Oct 4, 2017
@tomaszzmuda
Copy link
Owner

I have changed implementation of concatenate videos.
Now it's using demuxer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants