Voprosnik
Voprosnik

Reputation: 205

Incorporating ffmpeg in a bash script

I have a very large audio mp4 file that contains several songs.

I have generated a script which reads a text file with the times and the song names and successfully assigns starttime, endtime and songtitle in 3 variables. The script successfully echoes the variables and returns the following format:

00:00:00 00:10:15 Song1
00:10:15 00:14:20 Song2

and so on...

Now I am intending to use this script with ffmpeg and crop each part of the big file into smaller audio files.

The script thus, after feeding the variables in a while loop, it reaches to the command

ffmpeg -ss $START -t $END -i ${1} -acodec copy $SONGNAME.mp4

Once I run the script, the first two songs are cropped, but then the whole process stops with

Press [q] to stop, [?] for help
error parsing debug value
debug=0

I checked the generated files and they play ok, but there is no way for me to know why the script stopped there and did no proceed to the rest of the file (considering that when in the script I replace ffmpeg with echo, the script echoes the variables flawlessly).

In other words I don't know if there is a problem in my script, ffmpeg, or the source music file.

Upvotes: 3

Views: 1297

Answers (1)

Filippo Vitale
Filippo Vitale

Reputation: 8103

In this case I would add the argument -nostdin to ffmpeg.

Upvotes: 7

Related Questions