[FFmpeg-user] Converting mkv to mp3 failures

Moritz Barsnick barsnick at gmx.net
Fri Jul 14 02:00:36 EEST 2017

On Thu, Jul 13, 2017 at 16:24:31 -0600, JD wrote:
> into a file which I edited and turned it into a script that
> removed single quotes, unprintable characters, square brackets, commas, and
> replaced all spaces with underscores - of course, used the mv command to 
> move
> the files to the new names.

Okay, so you are absolutely sure each an every one of those files
listed exists at their newl given names?

> while read f; do
> N=`basename "$f" | sed -e 's/mkv//' -e 's/mp4//' -e 's/webm//'`

BTW, what happens if the YouTube magic hash contains "mp4"
(e.g. "X6gmp4rTl")?
(Solution: 's/\.mp4$//'.)

>          /bin/ffmpeg -i "$f" -map 0:a -c:a libmp3lame -ab 320k -ac 2 -y  $D/$N"mp3"

Replace this quoted line with
  echo "****** $f ******"
just to go sure that the absolutely correct filenames are found.

To go one further: Replace the quoted line with
  [ -f "$f" ] || echo "Not found: ***** $f *****"
to prove that the shell can find these files as listed in your
VIDEO_FILES. If not, then ffmpeg can't find it either.

ffmpeg gets the filename option as an arbitrary option from the
operating system. If other programs can successfully make use of it, so
can ffmpeg.

> And I am still getting parse errors, because ffmpeg is UNABLE to parse 
> long filenames.

No magic involved, ffmpeg does nothing special.

> What makes it even more confusing, the parse error message appears 
> within or between the console output
> of transcoding a previous file.

That's the letters flying in, interactively controlling ffmpeg's output


I don't know why, but I have seen it before, and the '< VIDEO_FILES'
may be flooding ffmpeg's stdin. Do try "-nostdin".


More information about the ffmpeg-user mailing list