Reputation: 2137
After a hard study, I have created a batch
file:
for /R D:\storytelling\MusicFiles %%a in (*.3gp) do ffmpeg -i %%a -y %%~na.mp3
However, it can't reach my goal since the scenario is a little different here:
Here is my directory structure:
I have several directories under a certain path:D:\storytelling\MusicFiles\
and new directories could be created by another application. And I put ffmpeg.exe
file in this path: D:\storytelling\MusicFiles\
.
Also, In each directory, I have hundreds of .3gp
files, and my target is to convert them to .mp3
in the directory where they used
to stay at.
But this script
for /R D:\storytelling\MusicFiles %%a in (*.3gp) do ffmpeg -i %%a -y %%~na.mp3
would convert every .3gp
file in each directory to the path: D:\storytelling\MusicFiles\
It leads to:
But I want the publicUser_XXX.mp3
files are still in the directory publicUser
and after conversion all the files remain in their original directory. The only change is that I got new a media copy with different media format like:
Please help and give me some advise.
Upvotes: 2
Views: 1823
Reputation: 41267
Try this:
@echo off
for /R D:\storytelling\MusicFiles %%a in (*.3gp) do ffmpeg -i "%%a" -y "%%~dpna.mp3"
Upvotes: 2