Help with making ffmpeg concatenate button

You could do that easily enough using a script now.

Yes, for DOpus v10 that was the reason (no internal scripting).

I guess adding "Pause" to the end of the button and removing @leavedoswindowopen should do what you want.

I must admit I don't understand why and how your batch works! I see you add files to list.txt-file. After that the buttons runs ffmpeg.exe and deletes the list.txt-file.
What makes me wonder is, how the "echo >>" is done for all files, but ffmpeg.exe and the delete is done only once (is that really the case?). Mhh.. o)

Besides I wonder why people merge mp3s, want I do most often is splitting them, strange! o))

Here is a version which sports your dialog and flatview support. Powershell code "within", so paste the little v1.1 part to join.ps1 if you're curious to try. o)

<?xml version="1.0"?>
<button backcol="none" display="both" textcol="none">
	<label>Join MP3s with ffmpeg</label>
	<tip>Join MP3s with ffmpeg to destination</tip>
	<icon1>#join</icon1>
	<function type="batch">
		<instruction>@filesonly </instruction>
		<instruction>@nodeselect </instruction>
		<instruction>@leavedoswindowopen </instruction>
		<instruction>powershell.exe -file join.ps1 &quot;C:\path to\ffmpeg.exe&quot; {d} &quot;{Rs|Output file name? (mp3 will be appended)}.mp3&quot; {allfilepath$}</instruction>
		<instruction />
		<instruction>//v1.1 - content of powershell script &quot;join.ps1&quot;</instruction>
		<instruction>//- targetfilename parameter added</instruction>
		<instruction>//----------------------------------------</instruction>
		<instruction>//$ffmpeg, $destfolder, $targetfilename, $files = $args;</instruction>
		<instruction>//&amp;&quot;$ffmpeg&quot; -i (&apos;&quot;concat:&apos;+($files -join &apos;|&apos;)+&apos;&quot; -acodec copy &quot;&apos;+(join-path -path $destfolder -childpath $targetfilename+&apos;&quot;&apos;)</instruction>
		<instruction>//----------------------------------------</instruction>
		<instruction />
		<instruction>//v1.0 - content of powershell script &quot;join.ps1&quot;</instruction>
		<instruction>//----------------------------------------</instruction>
		<instruction>//$ffmpeg, $destfolder, $files = $args;</instruction>
		<instruction>//&amp;&quot;$ffmpeg&quot; -i (&apos;&quot;concat:&apos;+($files -join &apos;|&apos;)+&apos;&quot; -acodec copy &quot;&apos;+(join-path -path $destfolder -childpath $files[0].split(&apos;.&apos;)[0])+&apos;_joined.mp3&quot;&apos;)</instruction>
		<instruction>//----------------------------------------</instruction>
	</function>
</button>

Care to give me an example Leo? :slight_smile:

Lol, no, this won't work, because the window does not close as it does in the case of a normal command window. I have to say I don't really know why, but suffice it to say that it doesn't, so adding pause does nothing apart from adding a keypress for no gain.

[quote]I must admit I don't understand why and how your batch works! I see you add files to list.txt-file. After that the buttons runs ffmpeg.exe and deletes the list.txt-file.
What makes me wonder is, how the "echo >>" is done for all files, but ffmpeg.exe and the delete is done only once (is that really the case?). Mhh.. o)[/quote]

I guess that makes us even, I don't understand how yours works either :wink:
You can test this by adding a second echo command after the first and you will see that is only done once. eg

@nofilenamequoting echo >>c:\list.txt file '{fs}' echo "Just once"

Besides I wonder why people merge mp3s, want I do most often is splitting them, strange! o))

AHA! SO you are one of these splitter types eh? I would ask why you would split them? There is no need to and splitting in the majority of cases screws things up big time. Every time now that I hear the disaster that ususally (though not always) accompanies split files, I will wonder if you are the culprit :unamused:

I never used to join them, but I tend to now. The reason is simple. Audio book CDs typically have a lot more tracks on them than a normal music CD has. Ripping a whole CD worth of tracks securely is often probematical, so it is a lot simpler to rip tracks (as opposed to rippping 'as one') then join the tracks after the rip. If you weren't ripping securely this wouldn't be an issue, but if you aren't ripping securely then you may as well not bother.

Keen to try this, thanks a million :smiley:

Error.

Missing closing ')' in expression.
At C:\join.ps1:3 char:1
+  <<<<
    + CategoryInfo          : ParserError: (CloseParenToken:TokenId) [], Paren
   tContainsErrorRecordException
    + FullyQualifiedErrorId : MissingEndParenthesisInExpression

I looked at the file, but it is beyond my understanding to see what it missing and where it goes. Sorry.

I did. It confirmed me that I hate powershell on my current system. It's a pain to make it work. And if I have to choose a tool to learn, I go for AutoIt. I assume you can get some more polished results with it and in a easier way.

I've just built a new PC with win 8.1 x64 pro and this week I will migrate from XP SP3 x86 and install DOPUS 11.5 that I purchased. I can't wait to use its built in script feature for button.

Please post a dopus script handling the first post. It will be a good example to start with for me.

Next week-end I will tell you guys how I acclimated to my new system with those script features.

I must admit that I rarely need to do that but when I needed it, every time I told myself it would be cool to have the one click action for that. I already have some buttons that tells ffmpeg to do stuff and it's an amazing tool to handle all kind of media file no matter what your needs about them. I should have get multiple GUI apps to do the same. Dopus + command line app = power.

@fred

You don't need scripting or Opus 11 to do what you first asked. This works fine...

@nofilenamequoting
echo >>c:\list.txt file '{fs}'

"C:\Program Files\Serviio\lib\ffmpeg.exe" -f concat -i c:\list.txt -c copy "{d!}{Rs|Output file name? (mp3 will be appended)}.mp3"

del c:\list.txt
pause

Obviously change the path to ffmpeg to suit.

The solution that tbone initially posted (using powershell) does the same thing, though in a slightly different and definitely more elegant way. His 2nd solution, to work around the flat mode problem and my need to control the output file name, doesn't work, but I am sure it will shortly. Just a typo or a missed character rather than it not working per se.

Sorry but a internal script (as the dopus built in functionq that you may already use into some of your buttons) is more elegant than call a dos cmd, IMHO. I try to avoid them as much as I can, the result is always better for me, more elegant.

Er, ok, but this is totally contrary to your original question, which asked how to do it sans script. My reply answers your question exactly.

No disputing which is more elegant, but the result is more or less the same. Function over form.

We both await tbone's fix :slight_smile:

Please just read a few post above where I say I'm upgrading to dopus v11.5 in which I can use built in script.

So you want something more like this: Command: JoinMP3 ?

I hope it works for you. o)

Thanks tbone, but I am snookered. I can't see how to, umm, not even sure how to put this, I can see how to implement this. I am a noob in this area so go easy on me. I dnd the script (after dropping the txt extension) to the prefs/scripts window, nothing appears to happen, but the script is copied to /script addins, but then... how do I use/call it? It doesn't appear to do what the docs or your instructions tell me, though this is probably me not understanding how to do it.

The script adds an internal command (JoinMP3) so you use it the way you use any command, by putting it on a button or hotkey.

Hey Jon, thanks, that's how I interpreted what would happen, but I must be missing something, I can't see the function anwhere.
I downloaded the script, chopped the .txt off the end, dragged it to the prefs/toolbars/scripts window. Nothing appears to happen and nothing changes within that window, but the .js file is copied to script/add ins, so that part seems to work. But then...? Where is 'at' to add from? The standard Opus JOIN is there, but no JoinMP3.

Are you using the latest beta? The script may require it.

Since I am not a beta tester, no :slight_smile:
I have 11.4. I will get myself up to date 11.5 downloading now. ta

Yup, you nailed it Leo, 11.5 and the scripts are shown in toolbars/scripts, and once I checked it, it becomes available as a command.

Thanks guys :slight_smile:

Anyone can be a beta tester these days :slight_smile:

I'd like to report the solution I use today.

Use the JoinMP3 script by tbone with the proper button you can find here.

It works as a charm :thumbsup:

It's wise to check the mp3 produced by ffmpeg for errors and fix them. Just follow this step requiring only one click.