3

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.

5
  • 2
    Can you manually run that command on the third song in the file? What is the name of the third song? Does it perhaps contain a space? Commented Sep 12, 2014 at 14:52
  • Yes it does contain a space! Commented Sep 12, 2014 at 14:56
  • 2
    So enclose your variables in double quotes, like this "$SONGNAME.mp4" Commented Sep 12, 2014 at 15:03
  • Yup, your command is being parsed as ffmpeg ... -acodec copy first_word second_word.mp4 and ffmpeg is getting confused about what you want to do. Commented Sep 12, 2014 at 15:04
  • 2
    You should show your script. Commented Sep 12, 2014 at 16:58

1 Answer 1

7

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.