From owner-freebsd-questions@freebsd.org Sat Jan 6 15:58:07 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 9DB54EBF3D8 for ; Sat, 6 Jan 2018 15:58:07 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DDD0741C3 for ; Sat, 6 Jan 2018 15:58:06 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([92.195.18.98]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.167]) with ESMTPA (Nemesis) id 0LqpOw-1f32ql1TLG-00eM3X; Sat, 06 Jan 2018 16:52:21 +0100 Date: Sat, 6 Jan 2018 16:52:20 +0100 From: Polytropon To: Victor Sudakov Cc: freebsd-questions@freebsd.org Subject: Re: Convert .flac and .ape to mp3 Message-Id: <20180106165220.b722e6f0.freebsd@edvax.de> In-Reply-To: <20180106063934.GA32231@admin.sibptus.transneft.ru> References: <20180104163421.GA15692@admin.sibptus.transneft.ru> <20180104175156.440fa0c2.freebsd@edvax.de> <20180106063934.GA32231@admin.sibptus.transneft.ru> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:1/QogzyB7ZKX1r0t9QbRG7usvKBj00e4Ks/gjhrT8QanfOOG3Hy VpjqQn/WGAYzD2L1n+qkV7P0X7Q/rGqdtC58Wc08sOT+EchR6nwRDgjhFC/WnNU1uIIWbM8 f7rHkUaP1s/+YPtCLXeGqKZbsOCWrIq+2ipNNoAZEMJ049+1mbrIQP0E/do0EOQnfQKugId IdccKlcwpdjZGV5PcfEhA== X-UI-Out-Filterresults: notjunk:1;V01:K0:ixbYyBZ/KUU=:fYUymSUPgmJ9tfyzoPvZhC kvy1QKmL7gY/lI98s/Co+z44sMQwF9bRlbVexfQZHDgk6Se7PhYLKm2hyxooGRFgU00ZGk+h0 5yDpGYhpbwz1kcGSp8sav+Gbsfl8Pbdgo9lzEgnZ3LduXeYYUnXtf6L90ahvCruhEk49EOfA3 U163ReHw9ZuPELWyPym89Yq0YQ12t4YPzhVyZwOfVVRA0Ju3vskDcJiI9Le+uKeqOOoMi00SF 5lmfyqa0Sifi5ZXuKGBtxnOmjinnHxgjmvoeM72udv1G2C36bVM8BIVZKXbQLi8QGK+q/wdPb CUrVGueEOwGeUFkFdr468D1HvGr7NTkY6vNAusQx/e7rh2Nlws69AtDhpD2qWZq1JvgeAH3tk S1qKPU43gEQQwaVLdsJlz/ctJbnHTDsgDViF6zrl9kF0GDt5U1Oa778rxI6XAfbc0cgAOFtOC z/LrVYSZudr8QmcRbCAaHke7lIL/BUCD+MfxcdE1CqtWzBw1peUAq4eX1/C1wGHFB4R0yY7jT AW1VsGyIwjtsuc1b80xLrgbs24lqwafbdF+LDC0eWd7GGECYyzfGJ395hc4svJn581SWXNnPZ +Au4uNEvODp2f6ACR3lA1nAS2eYIbo/dxNygWJuKwY0og11/rRjb/Ce7Twn9xg9B8g69+I5jy AFAJ/DXfjhz3EjOLjEai47BI3RjsvJu+kvKs1BXZxYDAiVMeKF7CFktgN4oe2nQC8kUTKHKHj y1OVDrt0w9WV33mAcdiu9oV+4PH0Mc30Nj3XNU3fe8JWC1TyL/N4iCaR7L0= 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 15:58:07 -0000 On Sat, 6 Jan 2018 13:39:34 +0700, Victor Sudakov wrote: > Polytropon wrote: > > > What do you convert ape and flac audio files to mp3 with? > > > > > > multimedia/ffmpeg does not seem to support encoding to mp3 (only > > > decoding), what else could I try? > > > > Huh? I'm using ffmpeg regularly to convert from mp4 or flv _to_ mp3, > > this works quite well. Maybe you need to install an additional encoder, > > plugin, or library if you're lacking mp3 support? > > > > % ffmpeg -i example.flv example.mp3 > > > > It does what it says on the can. Works for years. :-) > > > > With ffmpeg's mp3 support, you should be able to convert from flac > > or ape in a similar manner. > > I'm somewhat disappointed because ffmpeg does not seem to be able to > split flac/ape files according to cue file, or extract track names > therefrom and insert them into the mp3 file. I wish there would be some "magical MP3 split" that acts upon a specified silence (for example, 3 seconds) and splits the file into "tracks" that could then be renamed... > So eventually I will need to write a script to process all the *.ape > files, probably with bchunk. Which brings the following question. If > the file and directory names have spaces in them, a simple loop like > this: > > #!/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? There are two articles which I occassionally refer to, indead of saying "don't use spaces". :-) David A. Wheeler: Filenames and Pathnames in Shell: How to do it correctly http://www.dwheeler.com/essays/filenames-in-shell.html David A. Wheeler: Fixing Unix/Linux/POSIX Filenames: Control Characters (such as Newline), Leading Dashes, and Other Problems http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html Those articles will provide you with the most robust solution - and: no, just adding "quotes" isn't sufficient in most cases. :-) Also note: If you're starting to extract information from an ID3 tag and want to turn that into a directory and filename structure, you might find other characters than just spaces that "misbehave" in shell context. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...