[libav-bugs] [Bug 455] avconv always requires that output filename has a proper suffix while sometimes this shouldn't be needed

bugzilla-daemon at aruru.libav.org bugzilla-daemon at aruru.libav.org
Thu Feb 21 08:23:12 CET 2013


http://bugzilla.libav.org/show_bug.cgi?id=455

Anton Khirnov <anton at khirnov.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anton at khirnov.net

--- Comment #3 from Anton Khirnov <anton at khirnov.net> 2013-02-21 08:23:12 CET ---
(In reply to comment #2)
> (In reply to comment #1)
> > It's not really a matter of filename suffix, it's that there is no format
> > specified. If you don't specify a format, it can use the suffix to guess what
> > you want, but if you don't have either one there is no way for it to know that
> > in this case you want the output to be in raw mp3 format.
> 
> Thanks for the quick reply.
> 
> I know that the suffix is used to determine the format usually, but it's not
> the case here. It is not that I want to convert the audio to mp3. What I'm
> really trying to do is to extract the audio stream from the video WITHOUT ANY
> CONVERSION. That's why I use "-c:a copy" and the audio format can thus be
> determined from the original video file.
> 
> In fact, what suffix I specify is not relevant here. Whether I specify a mp3 or
> a wav as suffix, the resulting output file is always mp2, as "-c:a copy" is
> used and the format of the original audio stream is mp2. That is, both of the
> following commands will result in a mp2 format file with different names:
> 
>   avconv -i input.mpg -map 0:a -c:a copy output.mp3
>   avconv -i input.mpg -map 0:a -c:a copy output.wav
> 
> To check that they are all mp2 files:
> 
> jesse2004 at MovingCastle:~$ avconv -i output.mp3 
> avconv version 0.8.5-6:0.8.5-1~bpo60+1, Copyright (c) 2000-2012 the Libav
> developers
>   built on Jan 24 2013 20:38:51 with gcc 4.4.5
> [mp3 @ 0x8ef0fe0] max_analyze_duration reached
> Input #0, mp3, from 'output.mp3':
>   Metadata:
>     encoder         : Lavf53.21.1
>   Duration: 00:02:19.41, start: 0.000000, bitrate: 224 kb/s
>     Stream #0.0: Audio: mp2, 44100 Hz, stereo, s16, 224 kb/s
> At least one output file must be specified
> 
> jesse2004 at MovingCastle:~$ avconv -i output.wav
> avconv version 0.8.5-6:0.8.5-1~bpo60+1, Copyright (c) 2000-2012 the Libav
> developers
>   built on Jan 24 2013 20:38:51 with gcc 4.4.5
> [wav @ 0x97abfe0] max_analyze_duration reached
> Input #0, wav, from 'output.wav':
>   Duration: 00:02:19.41, bitrate: 224 kb/s
>     Stream #0.0: Audio: mp2, 44100 Hz, stereo, s16, 224 kb/s
> At least one output file must be specified
> 
> So, the suffix isn't really used to determine the output format in this case.

There seems to be a confusion of terms here.
What avconv and Justin meant by 'format' is the container format. The bistream
format of the encoded data -- what you are calling the format and what is
preserved by -c:a copy -- avconv calls the 'codec' (which is not completely
technically accurate, but w/e).

It's true that the codec is known due to -c:a copy, but you must still specify
the container format you want to mux into. If you want to just dump the raw
encoded audio, without any container around it, you can abuse one of the pcm
muxers -- e.g. -f s16le. It should do what you want as long as there is just
one audio stream in your input.

-- 
Configure bugmail: http://bugzilla.libav.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the libav-bugs mailing list