-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hardware encoding to the compositor API.
- Loading branch information
1 parent
6731fb5
commit 6a8dd1e
Showing
8 changed files
with
177 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
use anyhow::Result; | ||
use compositor_api::types::Resolution; | ||
use serde_json::json; | ||
use std::time::Duration; | ||
|
||
use integration_tests::{ | ||
examples::{self, run_example}, | ||
ffmpeg::start_ffmpeg_receive, | ||
}; | ||
|
||
const VIDEO_RESOLUTION: Resolution = Resolution { | ||
width: 1280, | ||
height: 720, | ||
}; | ||
|
||
const IP: &str = "127.0.0.1"; | ||
const OUTPUT_PORT: u16 = 8004; | ||
|
||
fn main() { | ||
run_example(client_code); | ||
} | ||
|
||
fn client_code() -> Result<()> { | ||
start_ffmpeg_receive(Some(OUTPUT_PORT), None)?; | ||
|
||
examples::post( | ||
"input/input_1/register", | ||
&json!({ | ||
"type": "mp4", | ||
"path": "examples/assets/BigBuckBunny.mp4", | ||
"video_decoder": "vulkan_video", | ||
}), | ||
)?; | ||
|
||
examples::post( | ||
"output/output_1/register", | ||
&json!({ | ||
"type": "rtp_stream", | ||
"port": OUTPUT_PORT, | ||
"ip": IP, | ||
"video": { | ||
"resolution": { | ||
"width": VIDEO_RESOLUTION.width, | ||
"height": VIDEO_RESOLUTION.height, | ||
}, | ||
"encoder": { | ||
"type": "ffmpeg_h264", | ||
"preset": "ultrafast" | ||
}, | ||
"initial": { | ||
"root": { | ||
"id": "input_1", | ||
"type": "input_stream", | ||
"input_id": "input_1", | ||
} | ||
} | ||
} | ||
}), | ||
)?; | ||
|
||
std::thread::sleep(Duration::from_millis(500)); | ||
|
||
examples::post("start", &json!({}))?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.