GithubHelp home page GithubHelp logo

Comments (7)

xxbiohazrdxx avatar xxbiohazrdxx commented on August 24, 2024 1

@rosenbjerg Having the same issue here. I believe the issue is that the text file that is created is invalid.

FFmpeg concatenate docs

Create a file mylist.txt with all the files you want to have concatenated in the following form (lines starting with a # are ignored):
# this is a comment
file '/path/to/file1.wav'
file '/path/to/file2.wav'
file '/path/to/file3.wav'

Here is an example of the text file created by FFMpegCore

Z:\Music\HLS Rips\07-31-2020\DecryptedSegments\528691.aac
Z:\Music\HLS Rips\07-31-2020\DecryptedSegments\528692.aac
Z:\Music\HLS Rips\07-31-2020\DecryptedSegments\528693.aac
Z:\Music\HLS Rips\07-31-2020\DecryptedSegments\528694.aac
Z:\Music\HLS Rips\07-31-2020\DecryptedSegments\528695.aac
Z:\Music\HLS Rips\07-31-2020\DecryptedSegments\528696.aac
Z:\Music\HLS Rips\07-31-2020\DecryptedSegments\528697.aac
Z:\Music\HLS Rips\07-31-2020\DecryptedSegments\528698.aac

In DemuxConcatArgument.cs here is the issue

public readonly IEnumerable<string> Values;
public DemuxConcatArgument(IEnumerable<string> values)
{
      Values = values;
}
private readonly string _tempFileName = Path.Combine(FFMpegOptions.Options.TempDirectory, Guid.NewGuid() + ".txt");
public void Pre() => File.WriteAllLines(_tempFileName, Values);

Instead you could do something like the following with LINQ

public readonly IEnumerable<string> Values;
public DemuxConcatArgument(IEnumerable<string> values)
{
    Values = values.Select(x => $"file '{x}'").ToArray();
}
private readonly string _tempFileName = Path.Combine(FFMpegOptions.Options.TempDirectory, Guid.NewGuid() + ".txt");

public void Pre() => File.WriteAllLines(_tempFileName, Values);

or without LINQ (can't actually modify elements in a foreach, but you get the idea)

 public readonly IEnumerable<string> Values;
 public DemuxConcatArgument(IEnumerable<string> values)
 {
      foreach (var currentValue in values)
      {
            currentValue = $"file '{currentValue}'";
       }
      Values = values;
}
private readonly string _tempFileName = Path.Combine(FFMpegOptions.Options.TempDirectory, Guid.NewGuid() + ".txt");

public void Pre() => File.WriteAllLines(_tempFileName, Values);

from ffmpegcore.

rosenbjerg avatar rosenbjerg commented on August 24, 2024

Could you try .FromDemuxConcatenation(..)?

from ffmpegcore.

curlyfro avatar curlyfro commented on August 24, 2024

that didn't work either.

FFMpegCore.Exceptions.FFMpegException : Output file was not created
   at FFMpegCore.Arguments.OutputArgument.Post()
   at FFMpegCore.FFMpegArguments.Post()
   at FFMpegCore.FFMpegArgumentProcessor.ProcessSynchronously(Boolean throwOnError)
   at Tests.FFMpegCoreTests.can_concat_videos() in C:\Users\afrom\Source\Repos\kameeyo\Tests\FFMpegCoreTests.cs:line 128

from ffmpegcore.

rosenbjerg avatar rosenbjerg commented on August 24, 2024

Did you try FFMpeg.Join before trying FFMpegArguments.FromConcatenation?

from ffmpegcore.

xxbiohazrdxx avatar xxbiohazrdxx commented on August 24, 2024

#95

from ffmpegcore.

rosenbjerg avatar rosenbjerg commented on August 24, 2024

I have merged the PR from @xxbiohazrdxx and I will release a new version containing this fix very soon.
Thank you @xxbiohazrdxx

from ffmpegcore.

xxbiohazrdxx avatar xxbiohazrdxx commented on August 24, 2024

Happy to help

from ffmpegcore.

Related Issues (20)

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.