[FFmpeg-user] Converting mkv to mp3 failures

JD jd1008 at gmail.com
Fri Jul 14 02:23:47 EEST 2017



On 07/13/2017 05:00 PM, Moritz Barsnick wrote:
> 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?
Yes!!! Emphatically YES!! Checked dozens of times.
>> 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$//'.)
Yes - that is in my script: vis a vis
-e 's/mp4//
as my sed command has 3 expressions using the -e option.

>
>>           /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
> options.
>
>> done < VIDEO_FILES  > FFMPEG_ERRORS 2>&1
> I don't know why, but I have seen it before, and the '< VIDEO_FILES'
> may be flooding ffmpeg's stdin. Do try "-nostdin".

I think ffmpeg just does not know how to read stdin  rightly, or perhaps 
the shell is not providing carriage returns or "newline"
at end of each line.

However, here are the mods:

#!/bin/bash
 >FFMPEG_ERRORS
while read f; do
N=`basename "$f" | sed -e 's/mkv//' -e 's/mp4//' -e 's/webm//'`
  [ -f "$f" ] || echo "Not found: ***** $f *****"
done < VIDEO_FILES  2>&1 | tee FFMPEG_ERRORS

and did NOT get any  Not found !!!!





More information about the ffmpeg-user mailing list