diff options
author | wm4 <wm4@nowhere> | 2012-10-29 00:06:51 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-30 19:50:24 +0100 |
commit | 219e1ab1e7dd5a91e7e55adc90c0daf242783842 (patch) | |
tree | b7a6affc48c2dd4c176f5101a4c040b29ec82e30 /stream/stream_ffmpeg.c | |
parent | 0c95e139a989ec3b18e97c3aab87adbe028d6185 (diff) | |
download | mpv-219e1ab1e7dd5a91e7e55adc90c0daf242783842.tar.bz2 mpv-219e1ab1e7dd5a91e7e55adc90c0daf242783842.tar.xz |
demux_lavf: add a hack to work around other hacks
mplayer (and all forks) use a single FourCC field to map codecs. This is
what sh_video->format and sh_audio->format is used for. Basically it's a
key into the codecs.conf table to find out what decoder to use. (There's
only one video codec and one major audio codec left - both libavcodec.
But we still have to deal with mapping coming from non-libavformat
demuxers.)
It seems this causes some video codecs to fail, such as WV1F in AVI [1].
demux_lavf generally throws away the codec_tag from libavformat if the
codec is MPEG-in-AVI. There are probably other cases like this. Add a
hack to enforce passing the correct codec tag when only ffmpeg demuxers
and decoders involved.
Note: the sample [1] needs to be flipped. With --demuxer=avi, this is
done correctly, because unlike demux_lavf, the demuxer uses the FourCC
directly for the sh_video->format tag, and finds the correct codecs.conf
entry (which contains the flip flag). We could just add a "whitelist" of
codec tags which can be passed through to sh_video->format, but I don't
want to do that just for such an obscure format as the sample at hand.
Note 2: when demux_lavf is used, the AVCodecContext could be passed
directly to vd_ffmpeg/ad_ffmpeg. The code to convert to/from the
internal mplayer stream headers is probably still needed, as there are
non-ffmpeg demuxers and audio decoders.
[1] http://samples.mplayerhq.hu/V-codecs/WV1F/AVI/title2.avi
Diffstat (limited to 'stream/stream_ffmpeg.c')
0 files changed, 0 insertions, 0 deletions