From 18e1816b7837a21e204d13f7a47d38d611b3c77b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 7 Dec 2011 23:17:34 +0100 Subject: [PATCH] Use the VP8 packetizer for VP8 read from AVIs --- ChangeLog | 3 +++ src/input/r_avi.cpp | 20 ++++++++++++++++++++ src/input/r_avi.h | 1 + 3 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0fde9006e..8d6578968 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2011-12-07 Moritz Bunkus + * mkvmerge: bug fix: VP8 read from AVI could not be put into WebM + compatible files. + * mkvmerge: bug fix: Fixed a rare audio type mis-detection of MP2/MP3 audio tracks in MPEG program streams causing mkvmerge to abort with an error message. diff --git a/src/input/r_avi.cpp b/src/input/r_avi.cpp index f00c8c519..398e379f3 100644 --- a/src/input/r_avi.cpp +++ b/src/input/r_avi.cpp @@ -46,6 +46,7 @@ #include "output/p_pcm.h" #include "output/p_video.h" #include "output/p_vorbis.h" +#include "output/p_vp8.h" #define GAB2_TAG FOURCC('G', 'A', 'B', '2') #define GAB2_ID_LANGUAGE 0x0000 @@ -257,6 +258,9 @@ avi_reader_c::create_video_packetizer() { else if (mpeg1_2::is_fourcc(get_uint32_le(codec))) create_mpeg1_2_packetizer(); + else if (FOURCC('V', 'P', '8', '0') == get_uint32_be(codec)) + create_vp8_packetizer(); + else create_standard_video_packetizer(); } @@ -346,6 +350,19 @@ avi_reader_c::create_mpeg4_p10_packetizer() { } } +void +avi_reader_c::create_vp8_packetizer() { + m_ti.m_private_data = NULL; + m_ti.m_private_size = 0; + m_vptzr = add_packetizer(new vp8_video_packetizer_c(this, m_ti)); + + PTZR(m_vptzr)->set_track_default_duration(1000000000ll / m_fps); + PTZR(m_vptzr)->set_video_pixel_width(AVI_video_width(m_avi)); + PTZR(m_vptzr)->set_video_pixel_height(AVI_video_height(m_avi)); + + show_packetizer_info(0, PTZR(m_vptzr)); +} + void avi_reader_c::create_standard_video_packetizer() { m_vptzr = add_packetizer(new video_packetizer_c(this, m_ti, NULL, m_fps, AVI_video_width(m_avi), AVI_video_height(m_avi))); @@ -917,6 +934,9 @@ avi_reader_c::identify_video() { else if (mpeg1_2::is_fourcc(get_uint32_le(fourcc_str))) type = "MPEG-1/2"; + else if (type == "VP80") + type = "VP8"; + id_result_track(0, ID_RESULT_TRACK_VIDEO, type, join(" ", extended_info)); } diff --git a/src/input/r_avi.h b/src/input/r_avi.h index 10d579043..f1044e701 100644 --- a/src/input/r_avi.h +++ b/src/input/r_avi.h @@ -115,6 +115,7 @@ protected: virtual void create_mpeg1_2_packetizer(); virtual void create_mpeg4_p2_packetizer(); virtual void create_mpeg4_p10_packetizer(); + virtual void create_vp8_packetizer(); virtual void create_video_packetizer(); void extended_identify_mpeg4_l2(std::vector &extended_info);