Categories
Music

FFMPEG – Converting DSF to FLAC

When converting SACD DSF audio files to FLAC (or any other PCM type format) the conversion process will most likely introduce distortion in the upper frequencies. In order to eliminate this you need to use the lowpass filter during the conversion process. This post is mainly so I won’t forget.

These are the ffmpeg commands I used to convert to regular FLAC. To convert to 24bit FLAC use s32 for the sample format.

convert one file to flac
ffmpeg -i inputfile.dsf -af "lowpass=24000,volume=6db" -sample_fmt s16 -ar 48000 outputfile.flac
Convert all dsf files in directory
for i in *.dsf; do ffmpeg -i "$i" -af "lowpass=24000, volume=6dB" -sample_fmt s16 -ar 48000 "${i%.*}.flac"; done

24 bit and 32 bit FLAC

At the time I wrote this the FLAC encoder only supported 16 and 24 bit encoding. As of ffmpeg v6 the FLAC encoder now appears to support 32 bit encoding using the -strict experimental switch. Be sure to test playback devices for the new 32 bit encoded FLAC files.

convert to 24 bit flac
ffmpeg -i inputfile.dsf -af "lowpass=24000, volume=6dB" -sample_fmt s32 -ar 48000 outputfile.flac
convert to 32 bit flac
ffmpeg -i inputfile.dsf -strict experimental -af "lowpass=24000, volume=6dB" -sample_fmt s32 -ar 48000 outputfile.flac

Audio Filters

Remember that the audio filters are specific to convert DSF files only. If you are converting other file types to FLAC they are not necessary. The values are not absolute and can be modified. The lowpass filter passes all frequencies below its setting and blocks any above it. This is required due to the high frequency distortion from converting DSD format to PCM format. The volume filter adjusts the volume. This isn’t required, but highly recommended as the volumes between the two formats are represented differently. The resulting PCM file will be lower in volume. These settings are not specific to FLAC but the conversion process from DSD to PCM.

Written by a real human. No AI involved.

Categories
Other

Importing Video Tapes – DV Files and FFMPEG

I’ve been working on importing all my old VHS and 8mm video tapes into my computer.  It’s always been fairly straight forward process of importing the video, originally when it was composite video being inputted it was in the form of an Uncompressed AVI file.  And then you’d convert it over to whatever media format you wanted.  Long ago I had chosen the Real Media file format. It had multiple bit rate encoding in a single file. This was required due to the various connectivity speeds everyone had back then.  From 28k Dialup to 1mbit connections.  It worked really well and then the Real Media format was pushed out for more wide spread and open source accessible media file formats. This is what happened with most of all the video files I had online.  They were all in some obsolete format and there wasn’t anything that could convert the Real Media files.  Which in turn were low resolution already.

I had started importing my video tapes back in 2011 via Firewire port and the pass through option on my Sony video camera.  This worked really well and unfortunately that computer failed and the replacement one no longer had a Firewire port.  So, I finally picked up a Firewire port at the beginning of this month and began the process where I had left off.

When importing via Firewire the it creates DV files.  Back in 2011 one of my main things was for the Karvanek Conspiracy video files, I wanted to master them all in the new webm format, because I like to torture myself with bleeding edge technology and paint myself into a corner like I did with the Real Media.  This worked out great, but it was a fairly slow process of hand writing all the times for where to stop and start the webm encoding process.  I was using WinFF which is a Windows GUI for ffmpeg.  And I would do command line encoding using the latest version of ffmpeg at that time. Everything worked like a champ. Other than encoding in webm is insanely slow.

But, that is no longer the case now.  Trying WinFF and straight ffmpeg and any application that uses ffmpeg will now fail to encode DV video files that I am creating because the DV files will record tape drop outs and other events (like stopping and starting recording) as some sort of odd or error frame.  When ffmpeg detects these frames it will spit out a bunch of EOB errors and stop encoding. ffmpeg, WinFF, Xmedia Recode, Handbrake all succumb to this problem.  The only encoder I had installed on my computer was Microsoft Expression Encoder 3.  It was part of the whole Microsoft Expression suite as I use Expression Web to do HTML editing.  It is a real good encoder, it will do VC-1, H.264 and Smooth Streaming.  I’ve been encoding everything now in MP4 format and Expression Encoder 3 worked great, but it was slow. It would take an hour to encode 30 minutes of video.

I wasted a good day figuring out the problem with DV files and ffmpeg and realizing it was hopeless unless I wanted to patch the source code on a Linux box and do all my encoding on that.  Which seemed kind of retarded, wait, that is retarded.  This whole issue is retarded.  So I finally started looking into other encoder programs.  I found one that works like a champ with my DV files converting to MP4 and it will do WebM as well, but I haven’t tested it out yet.  It’s called Xilisoft Video Converter Ultimate.  It’s only about $50 at the time of this post. It’s worth the cost just in the time you will save searching total retarded non-sense.  The big surprise about this software is not that it worked converting the DV files, but it has code for both Nvidia and ATI graphics cards that will speed up MP4 encoding. The 30 minutes DV file that took an hour to convert using the old Expression Encoder 3, takes Video Converter Ultimate just about 5 minutes on my AMD A10 APU.  If you have a higher end graphics card I can imagine that time will go down considerably. So now my bottleneck is the actual importing of the video tapes and uploading them to You Tube.

The Super Fucking Ultra Shitty editor that comes with BlogEngine.Net refuses to allow me to enter a link over the Xilisoft name. You know, let’s make a blog application for Microsoft’s web server and go out of our way to make it not work with Internet Explorer.  So here is the manually typed in link; http://www.xilisoft.com/