Results 1 to 6 of 6

Thread: avconv Filenames

  1. #1
    Join Date
    Mar 2014
    Beans
    2

    avconv Filenames

    Hello there,
    I'm having a problem with avconv.

    I run the following code:

    for file in '/home/ryan/Videos/MusicVideos/'*;
    do
    avconv -i $file -f mp3 -vn -ab 192k '/home/ryan/Music/'$file;
    done

    Unfortunately it reports back that it cant find any of the given files.
    I believe one problem to be that the filenames has spaces in them, as when it states that it cant find the file. It only shows the part until the first space.

    eg.
    Filename = 'hello world'
    It will state that it couldn't find the file 'hello'

    Any help as to why this is would be greatly appreciates.
    Kind Regards
    Ryan

  2. #2
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: avconv Filenames

    Hi, ryan-peter-t and welcome to the forums!

    Thread moved to the Programming Talk.

  3. #3
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: avconv Filenames

    You should double quote every expansion and everything that could contain a special character, eg. "$file", "$@", "$(command)"

    Also in your code $file will expand to the full path to the file names:

    Code:
    cd /home/ryan/Videos/MusicVideos/ || exit 1
    shopt -s nullglob
    for file in ./*
    do
        avconv -i "$file" -f mp3 -vn -ab 192k /home/ryan/Music/"$file"
    do
    See: http://mywiki.wooledge.org/Quotes and BashPitfalls (link in my signature).

  4. #4
    Join Date
    Mar 2014
    Beans
    2

    Re: avconv Filenames

    Many thanks sisco311.
    And sorry I put the post in the wrong area.

    Kind Regards
    Ryan

  5. #5
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

  6. #6
    Join Date
    Dec 2006
    Beans
    7,098

    Re: avconv Filenames

    Instead of specifying a bitrate (and thus using CBR encoding) you could try vbr with:

    Code:
    -qscale:a 2
    All the gory details here:

    Encoding VBR (Variable Bit Rate) mp3 audio
    http://trac.ffmpeg.org/wiki/Encoding...%20mp3%20audio
    You think that's air you're breathing now?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •