diff --git a/Cargo.lock b/Cargo.lock index 74ae6e162..afee822dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -487,6 +487,15 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "bitreader" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "886559b1e163d56c765bc3a985febb4eee8009f625244511d8ee3c432e08c066" +dependencies = [ + "cfg-if", +] + [[package]] name = "bitstream-io" version = "2.6.0" @@ -1194,6 +1203,15 @@ dependencies = [ "zune-inflate", ] +[[package]] +name = "fallible_collections" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88c69768c0a15262df21899142bc6df9b9b823546d4b4b9a7bc2d6c448ec6fd" +dependencies = [ + "hashbrown 0.13.2", +] + [[package]] name = "fancy-regex" version = "0.11.0" @@ -1512,6 +1530,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.14.5" @@ -2471,6 +2498,20 @@ dependencies = [ "syn 2.0.89", ] +[[package]] +name = "mp4parse" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63a35203d3c6ce92d5251c77520acb2e57108c88728695aa883f70023624c570" +dependencies = [ + "bitreader", + "byteorder", + "fallible_collections", + "log", + "num-traits", + "static_assertions", +] + [[package]] name = "multimap" version = "0.10.0" @@ -4436,6 +4477,7 @@ dependencies = [ "metrics-exporter-prometheus", "minijinja", "minijinja-contrib", + "mp4parse", "ngrok", "nohash-hasher", "once_cell", diff --git a/proto/v3/generate.proto b/proto/v3/generate.proto index 2f91ef864..e344d901d 100644 --- a/proto/v3/generate.proto +++ b/proto/v3/generate.proto @@ -64,6 +64,14 @@ message Image { string mimetype = 2; } +message Video { + /// Binary video data. + bytes data = 1; + + /// Video MIME type. + string mimetype = 2; +} + message InputChunk { oneof chunk { /// Plain text data @@ -71,8 +79,7 @@ message InputChunk { /// Image data Image image = 2; /// Video URLs - string video = 3; - + Video video = 3; } } diff --git a/router/Cargo.toml b/router/Cargo.toml index 9258fe035..161ddc8e2 100644 --- a/router/Cargo.toml +++ b/router/Cargo.toml @@ -64,6 +64,7 @@ uuid = { version = "1.9.1", default-features = false, features = [ csv = "1.3.0" ureq = "=2.9" pyo3 = { workspace = true } +mp4parse = "0.17.0" [build-dependencies]