[FFmpeg-user] How can I remove the first 30 seconds of 3000 MP3 files

Ferdi Scholten ferdi at sttc-nlp.nl
Mon Jan 24 20:09:27 EET 2022



On 24-01-2022 15:07, Børge Wedel Müller wrote:
> Hi Again
> When I run the command below, I got a "larger than sign" eg this sign ">"
>
> What Iis I doing wrong?
> Best
> /Børge Wedel Müller
>
>
>
> Den 23. januar 2022 kl. 19.22.19 +01.00, skrev LuKaRo <lists at lrose.de>:
>
>> Hi,
>>
>> you can use standard Unix methods for batch processing, e.g. in bash:
>>
>> for i in *.mp3; do ffmpeg -ss 00:00:30.000 -i "$i" -c copy "$(basename $i .mp3)-output.mp3"
>>
>> This will cut the first 30 seconds from each file ending in .mp3, creating a file with the same name and -output at the end. Instead of -c copy, you can add any additional ffmpeg arguments regarding the output.
>>
>> If you want to leverage parallel processing, you can use xargs instead (note that this will disable interactive input in ffmpeg, e.g. asking for overwrites):
>>
>> ls *.mp3 | xargs -P 4 -I '{}' bash -c 'ffmpeg -ss 00:00:30.000 -i "{}" -c copy "$(basename {} .mp3)-output.mp3"
>>
>> Again, replace -c copy by any output parameters you'd like to use, and replace -P 4 by the number of processes you want to start in parallel.
>>
>> Let us know if you have any further questions.
>>
>> Kind regards,
>>
>> LuKaRo
>>
>> On 1/23/22 17:28, Børge Wedel Müller wrote:
>>
>>> Hi
>>> I have searched over and over again, so this is last resort :-)
>>> I have approx 3000 audio files MP3, and I need to remove the first 30 seconds of each and everyone of the files.
>>>
>>> I am using a LINUX system. (Debian)
>>> I hope you can learn me how to remove these first annoying 30 seconds i one batch.
>>>
>>> Thanks.
>>>
>>> Best
>>> /Børge Wedel Müller
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> ffmpeg-user mailing list
>>> <ffmpeg-user at ffmpeg.org>
>>> <https://ffmpeg.org/mailman/listinfo/ffmpeg-user>
>>>
>>> To unsubscribe, visit link above, or email
>>> <ffmpeg-user-request at ffmpeg.org> with subject "unsubscribe".
>>> _______________________________________________
>> ffmpeg-user mailing list
>> <ffmpeg-user at ffmpeg.org>
>> <https://ffmpeg.org/mailman/listinfo/ffmpeg-user>
>>
>> To unsubscribe, visit link above, or email
>> <ffmpeg-user-request at ffmpeg.org> with subject "unsubscribe".
>>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
The bash command is not complete, the do statement needs to be closed 
with done;
like this:

for i in *.mp3; do ffmpeg -ss 00:00:30.000 -i "$i" -c copy "$(basename $i .mp3)-output.mp3" done

otherwise bash will prompt for more commands to follow do.



More information about the ffmpeg-user mailing list