From owner-freebsd-questions@freebsd.org Sat Jan 6 20:53:02 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E94BBDEF0FC for ; Sat, 6 Jan 2018 20:53:02 +0000 (UTC) (envelope-from jd1008@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B42147F28F for ; Sat, 6 Jan 2018 20:53:02 +0000 (UTC) (envelope-from jd1008@gmail.com) Received: by mail-it0-x229.google.com with SMTP id p139so5206281itb.1 for ; Sat, 06 Jan 2018 12:53:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-transfer-encoding; bh=sLoCSxC9yQZLrNzWU2FjO9Qkmccd5FEBdssS26Xaaec=; b=nbVMVQCS08c8FK5rmA2jYpx/ikHGdDeiqrpNw1OjrzWZz0z1cSwnJx0Z4VmdHlwMze MXiUcLqNsoktxyn/ElHezezWxdhI58aUaBBUwRhrRans2oE+yDErtZ0QZb20qjQFrrmi oYyHszpHpHUYcIso6sxgjCWbpE3tq2Z+AdC/9vQHvzVOJZ0VVE7vid/hti4n5HGyg3Np 3qZ82YFYvqRM1QNSYIPp5Fq26VYmbaS53KnnM9blTZUcIk5KGiMe/U8afvLyDZlUIT7K kU58ym7cEtPq9StTFf7URJWvJ0RqDJVo24SgibVzdvn3AjoUFNZtS2VMsIkofhdeAdYX SMig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-transfer-encoding; bh=sLoCSxC9yQZLrNzWU2FjO9Qkmccd5FEBdssS26Xaaec=; b=MJBXh1MHecW/75zd4CnSDXeItLGVpD4t6Qd26TvsgegJ+V0IoVdp6+gMnG34fC/yya NjJ62rSf5Ai56GZRLvzz/1FU4SxYZSvqsw5guS5dc3UYKmbhubhXNdUv8DgHD5I4gRjf TTbzbtjnQ+EfGO5ezbF3WzbZThv8ZlVnr/cgAmQafVfV60YMUDBkAlbS/W6/MhyZc0sW pQtC3CJSNftKRMhO/ovzZGakKPWVLUF8izc1VC0bhWhS1L4uzg08zVG+r9JZgsgMB+Eq KQFFrqRFvXQRZ4WPivP/uOLI2usfwsD0l+M1IAvYEuq5Nucb72vxClHBbdqfowXCVjPP gwCA== X-Gm-Message-State: AKGB3mJngrYW/W+zdrTBRpY4ANEiMi764zdvguUkaBP0YN85ebP0D4g1 cJBMHZMOYb7DYoaXl9DLkjMpdg== X-Google-Smtp-Source: ACJfBouhAEZPXHDVOV4VZeuJsBfG0I8WARP1e5rI6IL53256/azOn+tv73NsyVGsC7k0BJuEJ0wwXA== X-Received: by 10.36.166.13 with SMTP id q13mr6771060ite.37.1515271981683; Sat, 06 Jan 2018 12:53:01 -0800 (PST) Received: from localhost.localdomain (50-243-4-3-static.hfc.comcastbusiness.net. [50.243.4.3]) by smtp.googlemail.com with ESMTPSA id m184sm5018230itg.8.2018.01.06.12.52.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Jan 2018 12:53:00 -0800 (PST) Message-ID: <5A51372B.2050904@gmail.com> Date: Sat, 06 Jan 2018 13:52:59 -0700 From: JD User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: Convert .flac and .ape to mp3 References: <20180104163421.GA15692@admin.sibptus.transneft.ru> <20180104175156.440fa0c2.freebsd@edvax.de> <20180106063934.GA32231@admin.sibptus.transneft.ru> <20180106151754.GA35747@admin.sibptus.transneft.ru> <06f10c10-8e39-ec9b-de84-0c345c8be229@gmail.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jan 2018 20:53:03 -0000 Hi all, I too have .ape files which I would like to convert to mp3. However, the .ape files have a bitrate of 504K bits; to wit: $ ffprobe '01-O_Vis_Aeternitatis_(Responsorium).ape' ffprobe version 3.2.2 Copyright (c) 2007-2016 the FFmpeg developers built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-7) configuration: --prefix=/usr libavutil 55. 34.100 / 55. 34.100 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.100 / 57. 56.100 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 Input #0, ape, from '01-O_Vis_Aeternitatis_(Responsorium).ape': Duration: 00:08:05.36, start: 0.000000, bitrate: 504 kb/s Stream #0:0: Audio: ape (APE / 0x20455041), 44100 Hz, stereo, s16p So, how can I convert them to mp3 and keep the same rate of 504K ? If this is dependent on the mp3 encoder library, how do I specify that library on the command line? Thanx!!! On 01/06/2018 01:31 PM, Ultima wrote: > Thanks for the link Andreas, it is a good read. > > Was very tired when I made the reply yesterday so > apologies for not double checking and explaining my > minimal responses. > > I want to also mention if you want to build a more > reliable script, you should also check if the file is > actually the media format suggested by the extension. > > My solution to this problem is first checking if an error > occurs when ffprobe runs the file with -loglevel -8 options. > This will verify that ffmpeg can actually read the file. Next > run it a second time to verify the media format. > > ffprobe is very fast so you don't have to worry about taking > a performance hit. > > These are just some of the checks that I run before > processing any media and I recommend it for preventing > headaches later. > > Best regards, > Richard Gallamore > > On Sat, Jan 6, 2018 at 8:12 AM, Andreas Perstinger > wrote: > >> On 2018-01-06 16:17, Victor Sudakov wrote: >> >>> Michael Ross wrote: >>> >>>>> #!/bin/sh >>>>> for i in `find . -iname '*.ape'` >>>>> do >>>>> do_something $i >>>>> done >>>>> >>>>> breaks on spaces. >>>>> >>>>> What is the sh magic to handle such filenames? >>>>> >>>> xargs, you may want to run a few conversions in parallel: >>>> >>>> find . -iname '*.ape' -print0 | xargs -0 -I% -P convert >>>> % %.mp3 >>>> >>> I'm sure there are many ways to solve the problem, including writing a >>> C program, but a solution in pure sh has its own value and appeal. >>> >> Well, you use already the find command, so why don't you use it's full >> power? >> >> https://unix.stackexchange.com/questions/321697 >> (Why is looping over finds output bad practice?) >> >> Bye, Andreas >> >> _______________________________________________ >> freebsd-questions@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-questions >> To unsubscribe, send any mail to "freebsd-questions-unsubscribe >> @freebsd.org" >> > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >