VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 22 of 22
Thread
  1. I've run into a brick wall here and cannot find the answer, so I'm hoping you might be able to help - I have an audio track from a DTS CD, which is 6ch DTS in a .wav container. My problem is, it's a 44.1k 24bit file, and I need it to be a 48khz 24bit file (so I can mux it into a video file for playback on my media player). And I just can't find a way to resample the audio whilst preserving the 6ch structure, bit rate, etc. In fact, I can't even find (what I thought would be fairly simple) a program to split a multichannel audio file into separate mono-channel files (although that probably wouldn't help me unless I can then mux them back together again correctly)

    Am I going mad or is there a simple way to do this? I've tried a whole bunch of apps and programs, from DTS Parser on Windows (which will let me properly "transcode" from .wav to .dts, but retains the 44.1k/24bit) as well as eac3to GUI (following a guide HERE that only seems to yield a log file and no actual .wavs (although I did try a conversion to .dts which it did do, but it also only gave me a file with 44.1k and only 10 mins of the original 53mins, so no idea what's going on there). I tried installing ffmpeg on my MacBook but it didn't work, so I've run out of ideas.

    Any ideas?
    Quote Quote  
  2. Use ffmpeg - this is single executable file and no need to install it (but i can't help you where to find Mac precompiled binary)

    You are serching for filter like:
    Code:
    aresample=resampler=soxr:osr=48000:cutoff=0.990:dither_method=none
    and ffmpeg commandline may look like this:

    Code:
    ffmpeg -hide_banner -v 32 -stats -y -i filename -vn -af aresample=resampler=soxr:osr=48000:cutoff=0.990:dither_method=none -c:a dca -b:a 1536k -f wav filename_48k.wav
    Quote Quote  
  3. Thanks for the reply. I downloaded and extracted the zip, but I'm effed if I can get it to work. I double click the ffmpeg file within the ""bin" folder and get a Terminal window, but it won't let me paste or type a command, and if I paste/type the command into a regular Terminal window, I just get an error saying command not found
    Quote Quote  
  4. If you open a terminal window it will have a certain "(current) working directory". E.g. if your terminal is currently in "C:\Users\Matt\" while your ffmpeg.exe is in "C:\downloads\ffmpeg\ffmpeg.exe" it will not know what to do with any "ffmpeg" command because there is no "C:\Users\Matt\ffmpeg.exe" . If you type "C:\downloads\ffmpeg\ffmpeg.exe -hide_banner -v 32 [........ etc.] " instead it can find it.

    If you want to use ffmpeg often I recommend putting the ffmpeg folder into the "%PATH%" environment variable. Then you can use ffmpeg from any working directory. See this tutorial for an ffmpeg "setup".
    Quote Quote  
  5. Thanks for that, that certainly helped - got further than I did last time, but alas it failed

    Code:
      Duration: 00:51:43.09, bitrate: 1411 kb/s
        Stream #0:0: Audio: dts (DTS) ([1][0][0][0] / 0x0001), 44100 Hz, 5.1(side), fltp, 1411 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (dts (dca) -> dts (dca))
    Press [q] to stop, [?] for help
    [dca @ 0x7f8742001200] The encoder 'dca' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.
    Conversion failed!
    Quote Quote  
  6. [dca @ 0x7f8742001200] The encoder 'dca' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.
    It tells you what to do; add "strict -2" (without the quotes)
    Quote Quote  
  7. Add it where - to the end of the original code?
    Quote Quote  
  8. Originally Posted by Matt_C1 View Post
    Add it where - to the end of the original code?
    Put it before the output file (before "filename_48k.wav")
    Quote Quote  
  9. New error this time

    Code:
    Unrecognized option '2'.
    Error splitting the argument list: Option not found
    Quote Quote  
  10. sorry it should be "-strict -2" as it says in the message . My previous post omitted the first "-"

    Code:
    -strict -2
    Quote Quote  
  11. Success! It's still in a .wav container, but the internal codec is DTS, and it is 48khz. It's dropped from 24bit to 16bit though (unsure why). But that's a good start - should be able to mux that into an MKV file and have it playback right on my media player (problem I was having before was anything encoded to 44.1khz would play fast, transposed up and "hiccup" (as in glitch) at regular intervals. I narrowed it down to it being 44.1 as opposed to 48.

    I did find what seemed like a very useful app called "FLAC to MP3 Converter" which does a buttload of file types and codecs, including DTS, with useful options like down mixing to stereo (if need be), merging multiple files of the same type (useful for stitching a bunch of 6ch FLAC files together) and changing the sample rate. But annoyingly, whilst the 6ch FLAC conversion worked flawlessly, converting to DTS gave two problems - 1) it would only encode at 960kbps (no option for other bitrates, nor "same as source") and 2) the channel assignment was wrong. I believe this is because different containers use different assignments, but it didn't reassign the channels to where they should be, so the centre channel ended up being the FL, and the FR because RR, etc.

    If I can figure out (with your help, no doubt) how to fully utilise ffmpeg commands then that could be a useful tool for processing audio from one type to another, splitting channels etc.

    Thanks again for your help, guys. If anyone has thoughts/advice on the 16 vs 24 bit thing, I'd be interested to hear it
    Quote Quote  
  12. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    It may have been stored using "24bit" as a flag, but in essence it was already 16bit. So ignore it, leave it as is and don't fret - it's as good as it could be.

    Scott
    Quote Quote  
  13. Well, 48k was the important part.

    Earlier I needed to concatenate bunch of wavs (which were 44.1/16) to make a single file, which I did with ffmpeg (bit of trial an error with code I found here and there), and then had to run through again with the 48k code above. I'm wondering if there's a better workflow for this - could the code be appended to also convert it to 48k at the same time it's concatenating, or is that asking too much and just stick with running it through twice?

    Code:
    ffmpeg -i in1.wav -i in2.wav -i in3.wav -i in4.wav -i  \
    -filter_complex '[0:0][1:0][2:0][3:0]concat=n=4:v=0:a=1[out]' \
    -map '[out]' output.wav
    Quote Quote  
  14. You can chain filters.

    Code:
    ffmpeg -i "in1.wav" -i "in2.wav" -i "in3.wav" -i "in4.wav" -filter_complex "[0:0][1:0][2:0][3:0]concat=n=4:v=0:a=1[temp];[temp]aresample=48000[out]" -map "[out]" "output.wav"
    https://trac.ffmpeg.org/wiki/FilteringGuide#FiltergraphChainFilterrelationship
    Quote Quote  
  15. Thank - I was wondering if you could chain.

    Not a lot of luck with that though - first attempt, just replacing "in1.wav" etc with the file path for the three wavs I was using resulted in

    Code:
    [NULL @ 0x7fce1b84dc00] Unable to find a suitable output format for 'pipe:'
    pipe:: Invalid argument
    Then I changed a couple bits and got

    Code:
    [AVFilterGraph @ 0x7f82b1002a40] Too many inputs specified for the "concat" filter.
    Error initializing complex filters.
    Invalid argument
    Quote Quote  
  16. Originally Posted by Matt_C1 View Post
    Then I changed a couple bits and got
    Are we supposed to guess which bits and how? It's easier for us if you always post the complete command you used as well as the complete log.

    (From the error message it sounds like you have too many "-i "inX.wav"" or too few "filter_complex "[0:0][1:0][2:0][3:0]......." depending on how many files you seek to concat.)
    Quote Quote  
  17. I would have done, but I chopped it around so much, after the initial one didn't work, with parts from one and parts from another, removed " here and there that weren't present in the first, hat I ended up confused myself as to what exact commands I'd used! Hence not including them

    My test for this combined command was for three .wavs, all in the output directory (my home or user folder, it seems) so I was sure to only include the file paths to those three files, and the relevant -i before each one, as well as adjust the concat=n= with the correct number. But alas, no luck. I'll persevere... Otherwise it's just concat then convert separately
    Quote Quote  
  18. You know "[0:0][1:0][2:0][3:0]" is for 4 input files as ffmpeg starts counting from 0? So with 3 files you use "[0:0][1:0][2:0]".
    Quote Quote  
  19. Ah, no I didn't know that. Makes sense. How comes then when I did ten files I didn't adjust it to [0:0][1:0][2:0][3:0][4:0][5:0][6:0][7:0][8:0][9:0] then? The initial page I read about concat said to not adjust the [0:0][1:0][2:0][3:0] and only change the "concat=n=" number to the same number as the total files, hence why I didn't adjust it this time. Or is it a case of if it's under 4 edit it, if it's 4 or more files, leave it?
    Quote Quote  
  20. Originally Posted by Matt_C1 View Post
    Ah, no I didn't know that. Makes sense. How comes then when I did ten files I didn't adjust it to [0:0][1:0][2:0][3:0][4:0][5:0][6:0][7:0][8:0][9:0] then? The initial page I read about concat said to not adjust the [0:0][1:0][2:0][3:0] and only change the "concat=n=" number to the same number as the total files, hence why I didn't adjust it this time. Or is it a case of if it's under 4 edit it, if it's 4 or more files, leave it?
    ffmpeg does some smart auto-guessing. So if you don't explicitly set these things they will often work anyways.
    E.g.:
    Code:
    ffmpeg -i "in1.wav" -i "in2.wav" -i "in3.wav" -i "in4.wav" -filter_complex "[0:0][1:0][2:0][3:0]concat=n=4:v=0:a=1[temp];[temp]aresample=44100[out]" -map "[out]" "output.wav"
    
    ffmpeg -i "in1.wav" -i "in2.wav" -i "in3.wav" -i "in4.wav" -filter_complex "[0:0][1:0][2:0]concat=n=4:v=0:a=1[temp];[temp]aresample=44100[out]" -map "[out]" "output.wav"
    
    ffmpeg -i "in1.wav" -i "in2.wav" -i "in3.wav" -i "in4.wav" -filter_complex "[0:0][1:0]concat=n=4:v=0:a=1[temp];[temp]aresample=44100[out]" -map "[out]" "output.wav"
    
    ffmpeg -i "in1.wav" -i "in2.wav" -i "in3.wav" -i "in4.wav" -filter_complex "concat=n=4:v=0:a=1[temp];[temp]aresample=44100[out]" -map "[out]" "output.wav"
    will all yield the exact same result.
    Quote Quote  
  21. Tested, works OK (Windows), conversion to max bitdepth and max channel layout (from DTS and ffmpeg dca perspective):

    Code:
    @set filename=%1
    @ffmpeg.exe -report -hide_banner -v 32 -stats -y -i "%filename%" -vn -af aresample=resampler=soxr:osr=48000:cutoff=0.990:dither_method=none,aformat=sample_fmts=s32:channel_layouts=0x60f -strict -2 -c:a dca -b:a 1536k -f wav "%~n1_dts.wav"
    Quote Quote  
  22. Thanks again to you all for your replies - if you hadn't gathered by now, I'm very new to command line working: I rarely use Terminal, other than for commands I find from Googling (usually for MacBook/MacOS setting changes) and barely used DOS back when I was a Windows user. So it's a bit of a learning curve, and the language is fairly foreign to me.

    I've still not managed to do a conversion with chaining filters, so as to concat the files and then resample the resulting output to 48k, but I'll work on it.

    Question re the resampling - up to now it's been to resample to 48000 from 44.1, but should I want to go the other way am I right in thinking it's just a case of changing the "48000" in the script to "44100"?
    Quote Quote  



Similar Threads