]> git.nihav.org Git - nihav.git/commitdiff
avimux: handle raw video
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 23 Mar 2025 17:19:54 +0000 (18:19 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 23 Mar 2025 17:19:54 +0000 (18:19 +0100)
nihav-commonfmt/src/muxers/avi.rs

index b1b176a6a906e020b9bec0c6462649076305506e..1b32ad4a4fb7490b4fccec06198a4679646c597a 100644 (file)
@@ -207,7 +207,9 @@ impl<'a> MuxCore<'a> for AVIMuxer<'a> {
             match strm.get_media_type() {
                 StreamType::Video => {
                     self.bw.write_buf(b"vids")?;
-                    let fcc = find_avi_fourcc(strm.get_info().get_name());
+                    let fcc = if strm.get_info().get_name() == "rawvideo-ms" {
+                            Some(*b"DIB ")
+                        } else { find_avi_fourcc(strm.get_info().get_name()) };
                     if fcc.is_none() {
                         return Err(MuxerError::UnsupportedFormat);
                     }
@@ -276,7 +278,9 @@ impl<'a> MuxCore<'a> for AVIMuxer<'a> {
                         self.bw.write_u16le(1)?;
                         self.bw.write_u16le(8)?;
                     }
-                    let fcc = find_avi_fourcc(strm.get_info().get_name());
+                    let fcc = if strm.get_info().get_name() == "rawvideo-ms" {
+                                Some([0; 4])
+                            } else { find_avi_fourcc(strm.get_info().get_name()) };
                     if fcc.is_none() {
                         return Err(MuxerError::UnsupportedFormat);
                     }