Merge pull request #221 from jb-alvarado/master

more ignores, ignore errors on server, add info for srt ingest
This commit is contained in:
jb-alvarado 2022-10-26 17:20:31 +02:00 committed by GitHub
commit f231d73980
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 75 additions and 25 deletions

View File

@ -1,5 +1,20 @@
# Changelog # Changelog
## [1.6.2](https://github.com/ffplayout/ffplayout/compare/v0.16.1...v0.16.2) (2022-10-26)
### ffplayout
- ignore more ffmpeg errors and ignore them also on ingest server [2f8c2de](https://github.com/ffplayout/ffplayout/pull/221/commits/2f8c2deebc857c23f0bdc96ef977aaa174981fd3)
- update dependencies [bdf43f7](https://github.com/ffplayout/ffplayout/pull/221/commits/bdf43f7e6bd765ebb88afac7761a0a246b5cdfb4)
- fix null output, when is set per command line parameter [5b910d6](https://github.com/ffplayout/ffplayout/pull/221/commits/5b910d6e65d6cd1800fffe914a859a2b121be3cf)
- revert to video bitrate and mp2 audio codec [c326c3b](https://github.com/ffplayout/ffplayout/pull/221/commits/c326c3b61fdedf2cd4f609c74160ad5e3c470f43)
- When video bitrate is not fixed the delta delay is more unstable and can reach error threshold. Same is with audio codec pcm_bluray, maybe because it changes the format to m2ts. s302m would be best option, but is not working correctly with loudnorm filter.
- print version in debug level [241d8ee](https://github.com/ffplayout/ffplayout/pull/221/commits/241d8ee3f661f0c2585cd288a695cb5099b05677)
### Dokumentation
- add info for srt ingest [2f8c2de](https://github.com/ffplayout/ffplayout/pull/221/commits/2f8c2deebc857c23f0bdc96ef977aaa174981fd3)
## [1.6.1](https://github.com/ffplayout/ffplayout/compare/v0.16.0...v0.16.1) (2022-10-25) ## [1.6.1](https://github.com/ffplayout/ffplayout/compare/v0.16.0...v0.16.1) (2022-10-25)
### ffplayout ### ffplayout
@ -7,7 +22,7 @@
- rearrange custom filters (fix missing output mapping on multiple outputs) [9cb3a62](https://github.com/ffplayout/ffplayout/pull/217/commits/9cb3a6206938adcf1fbe4ce0ec763cad9e812c76) - rearrange custom filters (fix missing output mapping on multiple outputs) [9cb3a62](https://github.com/ffplayout/ffplayout/pull/217/commits/9cb3a6206938adcf1fbe4ce0ec763cad9e812c76)
- switch decoder audio codec to pcm_bluray [8b3a80f](https://github.com/ffplayout/ffplayout/pull/218/commits/8b3a80f5602eda240c6a59178c33886c9e81cb1d) - switch decoder audio codec to pcm_bluray [8b3a80f](https://github.com/ffplayout/ffplayout/pull/218/commits/8b3a80f5602eda240c6a59178c33886c9e81cb1d)
- deserialize drawtext message with struct object and add single quotes around values [1373182](https://github.com/ffplayout/ffplayout/pull/218/commits/1373182c2ad457d34bff449385e73203b9ba5791) - deserialize drawtext message with struct object and add single quotes around values [1373182](https://github.com/ffplayout/ffplayout/pull/218/commits/1373182c2ad457d34bff449385e73203b9ba5791)
- update dependencies - update dependencies [a246a60](https://github.com/ffplayout/ffplayout/commit/a246a6018eb024cbeac11dd206b76eaffd7fd20c)
### Development ### Development

17
Cargo.lock generated
View File

@ -397,11 +397,12 @@ dependencies = [
[[package]] [[package]]
name = "async-lock" name = "async-lock"
version = "2.5.0" version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685"
dependencies = [ dependencies = [
"event-listener", "event-listener",
"futures-lite",
] ]
[[package]] [[package]]
@ -961,7 +962,7 @@ dependencies = [
[[package]] [[package]]
name = "ffplayout" name = "ffplayout"
version = "0.16.1" version = "0.16.2"
dependencies = [ dependencies = [
"chrono", "chrono",
"clap", "clap",
@ -1011,7 +1012,7 @@ dependencies = [
[[package]] [[package]]
name = "ffplayout-lib" name = "ffplayout-lib"
version = "0.16.1" version = "0.16.2"
dependencies = [ dependencies = [
"chrono", "chrono",
"crossbeam-channel", "crossbeam-channel",
@ -1720,9 +1721,9 @@ dependencies = [
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.136" version = "0.2.137"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55edcf6c0bb319052dea84732cf99db461780fd5e8d3eb46ab6ff312ab31f197" checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89"
[[package]] [[package]]
name = "libsqlite3-sys" name = "libsqlite3-sys"
@ -2191,9 +2192,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]] [[package]]
name = "pkg-config" name = "pkg-config"
version = "0.3.25" version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"
[[package]] [[package]]
name = "polling" name = "polling"

View File

@ -2,10 +2,16 @@
With live ingest you have the possibility to switch from playlist, or folder mode to a live stream. With live ingest you have the possibility to switch from playlist, or folder mode to a live stream.
It works in a way, that it crate a ffmpeg instance in _listen_ (_server_) mode. For example when you stream over RTMP to it, you can set the ingest input parameters to: It works in a way, that it create a ffmpeg instance in _listen_ (_server_) mode. For example when you stream over RTMP to it, you can set the ingest input parameters to:
``` ```
-f live_flv -listen 1 -i rtmp://localhost:1936/live/stream -f live_flv -listen 1 -i rtmp://0.0.0.0:1936/live/my-secrete-streaming-key
```
For SRT you could use:
```
-f mpegts -i 'srt://0.0.0.0:40077?mode=listener&passphrase=12345abcde'
``` ```
Have in mind, that the ingest mode **can't** pull from a server, it only can act as its own server and listen for income. Have in mind, that the ingest mode **can't** pull from a server, it only can act as its own server and listen for income.

View File

@ -4,7 +4,7 @@ description = "24/7 playout based on rust and ffmpeg"
license = "GPL-3.0" license = "GPL-3.0"
authors = ["Jonathan Baecker jonbae77@gmail.com"] authors = ["Jonathan Baecker jonbae77@gmail.com"]
readme = "README.md" readme = "README.md"
version = "0.16.1" version = "0.16.2"
edition = "2021" edition = "2021"
default-run = "ffplayout" default-run = "ffplayout"

View File

@ -10,6 +10,7 @@ use simplelog::*;
use ffplayout_lib::utils::{ use ffplayout_lib::utils::{
controller::ProcessUnit::*, test_tcp_port, Media, PlayoutConfig, ProcessControl, controller::ProcessUnit::*, test_tcp_port, Media, PlayoutConfig, ProcessControl,
FFMPEG_IGNORE_ERRORS,
}; };
use ffplayout_lib::vec_strings; use ffplayout_lib::vec_strings;
@ -53,7 +54,9 @@ fn server_monitor(
proc_ctl.kill_all(); proc_ctl.kill_all();
} }
log_line(line, level); if !FFMPEG_IGNORE_ERRORS.iter().any(|i| line.contains(*i)) {
log_line(line, level);
}
} }
Ok(()) Ok(())

View File

@ -29,6 +29,8 @@ use ffplayout::utils::Args;
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
use ffplayout_lib::utils::{mock_time, time_now}; use ffplayout_lib::utils::{mock_time, time_now};
const VERSION: &str = env!("CARGO_PKG_VERSION");
#[derive(Serialize, Deserialize)] #[derive(Serialize, Deserialize)]
struct StatusData { struct StatusData {
time_shift: f64, time_shift: f64,
@ -42,7 +44,7 @@ struct StatusData {
/// ///
/// When file not exists we create it, and when it exists we get its values. /// When file not exists we create it, and when it exists we get its values.
fn status_file(stat_file: &str, playout_stat: &PlayoutStatus) { fn status_file(stat_file: &str, playout_stat: &PlayoutStatus) {
debug!("Status file path: <b><magenta>{stat_file}</></b>"); debug!("Start ffplayout v{VERSION}, status file path: <b><magenta>{stat_file}</></b>");
if !PathBuf::from(stat_file).exists() { if !PathBuf::from(stat_file).exists() {
let data = json!({ let data = json!({

View File

@ -10,7 +10,7 @@ pub mod arg_parse;
pub use arg_parse::Args; pub use arg_parse::Args;
use ffplayout_lib::{ use ffplayout_lib::{
filter::Filters, filter::Filters,
utils::{time_to_sec, PlayoutConfig, ProcessMode::*}, utils::{time_to_sec, OutputMode::*, PlayoutConfig, ProcessMode::*},
vec_strings, vec_strings,
}; };
@ -79,6 +79,12 @@ pub fn get_config(args: Args) -> PlayoutConfig {
if let Some(output) = args.output { if let Some(output) = args.output {
config.out.mode = output; config.out.mode = output;
if config.out.mode == Null {
config.out.output_count = 1;
config.out.output_filter = None;
config.out.output_cmd = Some(vec_strings!["-f", "null", "-"]);
}
} }
if let Some(volume) = args.volume { if let Some(volume) = args.volume {

View File

@ -4,7 +4,7 @@ description = "Library for ffplayout"
license = "GPL-3.0" license = "GPL-3.0"
authors = ["Jonathan Baecker jonbae77@gmail.com"] authors = ["Jonathan Baecker jonbae77@gmail.com"]
readme = "README.md" readme = "README.md"
version = "0.16.1" version = "0.16.2"
edition = "2021" edition = "2021"
[dependencies] [dependencies]

View File

@ -19,11 +19,15 @@ pub const IMAGE_FORMAT: [&str; 21] = [
]; ];
// Some well known errors can be safely ignore // Some well known errors can be safely ignore
pub const FFMPEG_IGNORE_ERRORS: [&str; 5] = [ pub const FFMPEG_IGNORE_ERRORS: [&str; 9] = [
"ac-tex damaged", "ac-tex damaged",
"corrupt decoded frame in stream",
"corrupt input packet in stream",
"end mismatch left", "end mismatch left",
"Packet corrupt",
"Referenced QT chapter track not found", "Referenced QT chapter track not found",
"skipped MB in I-frame at", "skipped MB in I-frame at",
"Thread message queue blocking",
"Warning MVs not available", "Warning MVs not available",
]; ];
@ -290,6 +294,11 @@ impl PlayoutConfig {
config.processing.audio_tracks = 1 config.processing.audio_tracks = 1
} }
let bitrate = format!(
"{}k",
config.processing.width * config.processing.height / 16
);
config.processing.cmd = Some(vec_strings![ config.processing.cmd = Some(vec_strings![
"-pix_fmt", "-pix_fmt",
"yuv420p", "yuv420p",
@ -299,12 +308,18 @@ impl PlayoutConfig {
"mpeg2video", "mpeg2video",
"-g", "-g",
"1", "1",
"-qscale:v", "-b:v",
"2", &bitrate,
"-minrate",
&bitrate,
"-maxrate",
&bitrate,
"-bufsize",
&bitrate,
"-c:a", "-c:a",
"pcm_bluray", "mp2",
"-mpegts_m2ts_mode", "-b:a",
"true", "384k",
"-ar", "-ar",
"48000", "48000",
"-ac", "-ac",

View File

@ -640,6 +640,10 @@ pub fn stderr_reader(
for line in buffer.lines() { for line in buffer.lines() {
let line = line?; let line = line?;
if FFMPEG_IGNORE_ERRORS.iter().any(|i| line.contains(*i)) {
continue;
}
if line.contains("[info]") { if line.contains("[info]") {
info!( info!(
"<bright black>[{suffix}]</> {}", "<bright black>[{suffix}]</> {}",
@ -650,9 +654,7 @@ pub fn stderr_reader(
"<bright black>[{suffix}]</> {}", "<bright black>[{suffix}]</> {}",
line.replace("[warning] ", "") line.replace("[warning] ", "")
) )
} else if (line.contains("[error]") || line.contains("[fatal]")) } else if line.contains("[error]") || line.contains("[fatal]") {
&& !FFMPEG_IGNORE_ERRORS.iter().any(|i| line.contains(*i))
{
error!( error!(
"<bright black>[{suffix}]</> {}", "<bright black>[{suffix}]</> {}",
line.replace("[error] ", "").replace("[fatal] ", "") line.replace("[error] ", "").replace("[fatal] ", "")