Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
#1 | Link |
|
Registered User
Join Date: Dec 2003
Posts: 267
|
ffmpeg wav copy question
This seems to work but I'm wondering if it does the conversion without altering the audio data. It basically just extracts the pcm data to a raw file, then folds it back into a new wav file.
Code:
ffmpeg -i input.wav -f s16le -acodec pcm_s16le output.raw && ffmpeg -f s16le -ar 48000 -ac 2 -i output.raw output.wav thanks for any help, babag |
|
|
|
|
|
#2 | Link |
|
Registered User
Join Date: Jun 2024
Location: South Africa
Posts: 603
|
I tested it on a 16-bit 48 kHz file. Using WinMerge, the resulting output.wav is, apart from the header I think, identical to the original.
However, the danger with FFmpeg is that auto-inserted filters can be invoked in other cases. Without asserting -c copy, we are open to alteration. Add -loglevel trace to see what is happening. Indeed, whenever processing in FFmpeg, check it with a higher loglevel; for in circumstances one might not expect, the auto-inserted filters come into play behind the scenes. Once the script has been verified, remove loglevel and use it as normal, till you make another change. Does a simple -c copy not give the desired header? Code:
ffmpeg -i input.wav -c copy output.wav Last edited by GeoffreyA; 2nd January 2026 at 08:03. |
|
|
|
|
|
#4 | Link |
|
Moderator
![]() Join Date: Feb 2005
Location: Spain
Posts: 7,362
|
If your input.wav is the showed in post https://forum.doom9.org/showthread.p...38#post2026238 please, instead open a new thread, answer my question about how do you obtain this file with ffmpeg.
Maybe using: ffmpeg -i 5.1.wav -af "pan=stereo|FL=c4|FR=c5" "simple BL-BR like FLFR.wav" |
|
|
|
|
|
#5 | Link |
|
Registered User
Join Date: Dec 2003
Posts: 267
|
this seems to work well:
Code:
ffmpeg -i surround_input_file.m4a -af "pan=stereo|c0=c4|c1=c5" stereo_output_file_ch5_ch6.wav when i first started playing with extractions of channels with ffmpeg i was using "channelsplit=channel_layout=5.1" but the results for channels higher than 1/2 carried different header info that gave some of my software problems. it's my understanding that, once i switched to a filter like "pan," i opened up the possibility that data would be altered. "copy" is always the way to get a 1:1 transfer of the data but using a filter might carry with it recompression or some alteration. my question is, if i use pan (and only the pan filter) as in the above example, might the data from the two channels being extracted be altered or is this, in effect, a copy operation? thanks, babag |
|
|
|
|
|
#10 | Link |
|
Registered User
Join Date: Aug 2024
Location: Between my two ears
Posts: 859
|
pan is a channel mixing filter that's able to do pure channel mapping (copying)
https://trac.ffmpeg.org/wiki/AudioChannelManipulation (this explains basically everything) |
|
|
|
|
|
#11 | Link |
|
Registered User
Join Date: Dec 2003
Posts: 267
|
I was unclear on "the expression you give it." Am I right that what you're saying is that, while my example above keeps the channels discrete, other examples might mix channels, causing recompression, like this:
Code:
ffmpeg -i input.mp3 -af "pan=stereo|c0<c0+c1|c1<c0+c1" output.ogg babag |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|