Adding support for file title without renaming file, updating docker files.

This commit is contained in:
Junio Calu 2024-04-21 15:47:29 -03:00
parent 751b4362e6
commit 61fab0fcef
7 changed files with 15 additions and 6 deletions

View File

@ -14,7 +14,7 @@ RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
FROM base FROM base
ARG FFPLAYOUT_VERSION=0.21.0 ARG FFPLAYOUT_VERSION=0.21.3
COPY README.md *.rpm /tmp/ COPY README.md *.rpm /tmp/
RUN dnf update -y && \ RUN dnf update -y && \

View File

@ -132,7 +132,7 @@ RUN \
FROM base FROM base
ARG FFPLAYOUT_VERSION=0.21.0 ARG FFPLAYOUT_VERSION=0.21.3
ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib

View File

@ -1,5 +1,6 @@
FROM nvidia/cuda:12.0.1-cudnn8-runtime-centos7 FROM nvidia/cuda:12.0.1-cudnn8-runtime-centos7
ENV FFPLAYOUT_VERSION=0.21.3
ENV NVIDIA_VISIBLE_DEVICES all ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,video,utility ENV NVIDIA_DRIVER_CAPABILITIES compute,video,utility
@ -95,11 +96,11 @@ RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
RUN yum update -y \ RUN yum update -y \
&& yum install -y dejavu-sans-fonts sudo wget \ && yum install -y dejavu-sans-fonts sudo wget \
&& wget -q -O /tmp/ffplayout-0.21.0-1.x86_64.rpm "https://github.com/ffplayout/ffplayout/releases/download/v0.20.2/ffplayout-0.21.0-1.x86_64.rpm" \ && wget -q -O /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm "https://github.com/ffplayout/ffplayout/releases/download/v${FFPLAYOUT_VERSION}/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm" \
&& yum install -y /tmp/ffplayout-0.21.0-1.x86_64.rpm \ && yum install -y /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm \
&& yum clean all \ && yum clean all \
&& echo 'Docker!' | passwd --stdin root \ && echo 'Docker!' | passwd --stdin root \
&& rm /tmp/ffplayout-0.21.0-1.x86_64.rpm \ && rm /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm \
&& mkdir -p /home/ffpu && chown -R ffpu: /home/ffpu \ && mkdir -p /home/ffpu && chown -R ffpu: /home/ffpu \
&& systemctl enable ffplayout \ && systemctl enable ffplayout \
&& systemctl enable ffpapi && systemctl enable ffpapi

View File

@ -132,6 +132,7 @@ fn time_before() -> NaiveDateTime {
struct ProgramItem { struct ProgramItem {
source: String, source: String,
start: String, start: String,
title: Option<String>,
r#in: f64, r#in: f64,
out: f64, out: f64,
duration: f64, duration: f64,
@ -1189,6 +1190,7 @@ async fn get_program(
let p_item = ProgramItem { let p_item = ProgramItem {
source, source,
start: start.format("%Y-%m-%d %H:%M:%S%.3f%:z").to_string(), start: start.format("%Y-%m-%d %H:%M:%S%.3f%:z").to_string(),
title: item.title,
r#in: item.seek, r#in: item.seek,
out: item.out, out: item.out,
duration: item.duration, duration: item.duration,

View File

@ -239,6 +239,7 @@ pub fn prepare_output_cmd(
/// map media struct to json object /// map media struct to json object
pub fn get_media_map(media: Media) -> Value { pub fn get_media_map(media: Media) -> Value {
json!({ json!({
"title": media.title,
"seek": media.seek, "seek": media.seek,
"out": media.out, "out": media.out,
"duration": media.duration, "duration": media.duration,

View File

@ -39,6 +39,7 @@ impl JsonPlaylist {
pub fn new(date: String, start: f64) -> Self { pub fn new(date: String, start: f64) -> Self {
let mut media = Media::new(0, "", false); let mut media = Media::new(0, "", false);
media.begin = Some(start); media.begin = Some(start);
media.title = None;
media.duration = DUMMY_LEN; media.duration = DUMMY_LEN;
media.out = DUMMY_LEN; media.out = DUMMY_LEN;
Self { Self {

View File

@ -65,6 +65,8 @@ pub struct Media {
#[serde(skip_serializing, skip_deserializing)] #[serde(skip_serializing, skip_deserializing)]
pub index: Option<usize>, pub index: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
#[serde(rename = "in")] #[serde(rename = "in")]
pub seek: f64, pub seek: f64,
pub out: f64, pub out: f64,
@ -138,6 +140,7 @@ impl Media {
Self { Self {
begin: None, begin: None,
index: Some(index), index: Some(index),
title: None,
seek: 0.0, seek: 0.0,
out: duration, out: duration,
duration, duration,
@ -218,7 +221,8 @@ impl Media {
impl PartialEq for Media { impl PartialEq for Media {
fn eq(&self, other: &Self) -> bool { fn eq(&self, other: &Self) -> bool {
self.seek == other.seek self.title == other.title
&& self.seek == other.seek
&& self.out == other.out && self.out == other.out
&& self.duration == other.duration && self.duration == other.duration
&& self.source == other.source && self.source == other.source