On 04/24/2011 04:55 PM, Ronald S. Bultje wrote: > Hi, > > On Apr 24, 2011, at 2:58 PM, Justin Ruggles <[email protected]> wrote: >> I was able to get this working. So after the change, here is what the >> ffmpeg behavior would be when using the request_sample_fmt version of >> the patch. >> >> $ ffmpeg -i in.ac3 -acodec pcm_f32le -y out.wav >> decoder initialized to s16 during av_find_stream_info() >> warning about incompatible sample format >> encoder initialized to flt >> decoder request_sample_fmt set to flt >> decoder initialized to flt >> message about the input stream changing format >> >> $ ffmpeg -i in.ac3 -acodec pcm_f64le -y out.wav >> decoder initialized to s16 during av_find_stream_info() >> warning about incompatible sample format >> encoder initialized to dbl >> decoder request_sample_fmt set to flt >> decoder initialized to flt >> message about the input stream changing format >> ffmpeg converts from flt to dbl >> >> $ ffmpeg -request_sample_fmt flt -i in.ac3 -acodec pcm_f32le -y out.wav >> decoder initialized to flt during av_find_stream_info() >> encoder initialized to flt >> decoder initialized to flt >> >> $ ffmpeg -request_sample_fmt flt -i in.ac3 -acodec pcm_s16le -y out.wav >> decoder initialized to flt during av_find_stream_info() >> warning about incompatible sample format >> encoder initialized to s16 >> decoder initialized to flt >> ffmpeg converts float to s16 >> >> $ ffmpeg -request_sample_fmt s16 -i in.ac3 -acodec pcm_f32le -y out.wav >> decoder initialized to s16 during av_find_stream_info() >> warning about incompatible sample format >> encoder initialized to flt >> decoder initialized to s16 >> ffmpeg converts s16 to flt > > Very sweet! ('Nuf said!) > > I assume default (ffmpeg -i f.ac3 -f null -) is still int16? Or say, what > happens when converting to a fmt suppprting both int as well as flt?
The default codec for -f null is pcm_s16le, so it will behave the same as the s16le examples above. As for an encoder supporting flt and s16, it depends. I don't know of any currently, but this is my best guess at the behavior. ffmpeg -i in.ac3 -acodec foo -y out.foo decoder initialized to s16 during av_find_stream_info() encoder initialized to s16 decoder initialized to s16 ffmpeg -i in.ac3 -sample_fmt flt -acodec foo -y out.foo decoder initialized to s16 during av_find_stream_info() encoder initialized to flt decoder request_sample_fmt set to flt decoder initialized to flt message about the input stream changing format ffmpeg -request_sample_fmt flt -i in.ac3 -acodec foo -y out.foo decoder initialized to flt during av_find_stream_info() encoder initialized to flt decoder initialized to flt ffmpeg -request_sample_fmt flt -i in.ac3 -sample_fmt s16 -acodec foo -y out.foo decoder initialized to flt during av_find_stream_info() warning about incompatible sample format encoder initialized to s16 decoder initialized to flt ffmpeg converts s16 to flt -Justin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
