From 9fb58a4b4887401ef2f60571671c791a1ff58d12 Mon Sep 17 00:00:00 2001 From: Jonathan Baecker Date: Fri, 7 Jun 2019 10:04:58 +0200 Subject: [PATCH 1/8] add link for wiki entry --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9047ec11..87fcb780 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Features - have all values in a separate config file - dynamic playlist - replace missing playlist or clip with a dummy clip -- playing clips from watched folder +- playing clips from [watched folder](https://github.com/ffplayout/ffplayout-engine/wiki/Watch-Folder) - send emails with error message - overlay a logo - trim and fade the last clip, to get full 24 hours, if the duration is less then 6 seconds add a dummy clip From 27d8f510997fb90b46239de49189a210f7aa604f Mon Sep 17 00:00:00 2001 From: Jonathan Baecker Date: Fri, 7 Jun 2019 10:16:39 +0200 Subject: [PATCH 2/8] import watchdog only when is needed --- ffplayout.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ffplayout.py b/ffplayout.py index b6382763..ac89ab03 100755 --- a/ffplayout.py +++ b/ffplayout.py @@ -41,9 +41,6 @@ from subprocess import PIPE, CalledProcessError, Popen, check_output from threading import Thread from types import SimpleNamespace -from watchdog.events import PatternMatchingEventHandler -from watchdog.observers import Observer - # ------------------------------------------------------------------------------ # read variables from config file # ------------------------------------------------------------------------------ @@ -1091,4 +1088,8 @@ def main(): if __name__ == '__main__': + if not _general.playlist_mode: + from watchdog.events import PatternMatchingEventHandler + from watchdog.observers import Observer + main() From c84196e5142cde9591f8b5adc7792742ea6d6d78 Mon Sep 17 00:00:00 2001 From: Jonathan Baecker Date: Fri, 7 Jun 2019 10:53:42 +0200 Subject: [PATCH 3/8] remove redundant info --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 87fcb780..e87dc268 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ [![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) -This is a playout application based on python and ffmpeg. - The purpose with ffplayout is to provide a 24/7 broadcasting solution that plays a *json* playlist for every day, while keeping the current playlist editable. #### Check [ffplayout-gui](https://github.com/ffplayout/ffplayout-gui): web-based GUI for ffplayout. From 02bf222c4f69634547d7035b3cf66b657b547624 Mon Sep 17 00:00:00 2001 From: Jonathan Baecker Date: Fri, 7 Jun 2019 10:56:20 +0200 Subject: [PATCH 4/8] watchdog is optional --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e87dc268..525fbc13 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Features Requirements ----- - python version 3.5+ -- python module **watchdog** +- python module **watchdog** (onyl when playlist_mode = False) - **ffmpeg** and **ffprobe** (**ffplay** if you want to play on desktop) - RAM and CPU depends on video resolution, minimum 4 threads and 3GB RAM for 720p are recommend From 218dd39b225205ddd65d967d89351c637881442e Mon Sep 17 00:00:00 2001 From: Jonathan Baecker Date: Fri, 7 Jun 2019 10:58:29 +0200 Subject: [PATCH 5/8] watchdog is optional --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 525fbc13..66fb37d7 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Features Requirements ----- - python version 3.5+ -- python module **watchdog** (onyl when playlist_mode = False) +- python module **watchdog** (onyl when `playlist_mode = False`) - **ffmpeg** and **ffprobe** (**ffplay** if you want to play on desktop) - RAM and CPU depends on video resolution, minimum 4 threads and 3GB RAM for 720p are recommend From 224df805df87acfc140734d99520bcb645f25dfd Mon Sep 17 00:00:00 2001 From: Jonathan Baecker Date: Fri, 7 Jun 2019 13:31:47 +0200 Subject: [PATCH 6/8] add log info --- ffplayout.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ffplayout.py b/ffplayout.py index ac89ab03..f2cf72b3 100755 --- a/ffplayout.py +++ b/ffplayout.py @@ -1050,6 +1050,7 @@ def main(): watcher = None get_source = GetSourceIter(encoder) else: + logger.info("start folder mode") media = MediaStore(_folder.extensions) media.fill(_folder.storage) From 8a36d68ef4c2549acfd8dc60adb19954b60841fb Mon Sep 17 00:00:00 2001 From: Jonathan Baecker Date: Fri, 7 Jun 2019 13:31:52 +0200 Subject: [PATCH 7/8] spelling --- ffplayout.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffplayout.conf b/ffplayout.conf index eba646ab..fb42e322 100644 --- a/ffplayout.conf +++ b/ffplayout.conf @@ -15,7 +15,7 @@ # ------------------------------------------------------------------------------ -# set playlist_mode to false if you want to play clips from the [FOLDER] section +# set playlist_mode to False if you want to play clips from the [FOLDER] section # sometimes it can happen, that a file is corrupt but still playable, # this can produce an streaming error over all following files From 8f7055ed3960540b94bed488f42da9192a497b1b Mon Sep 17 00:00:00 2001 From: Jonathan Baecker Date: Fri, 7 Jun 2019 13:34:48 +0200 Subject: [PATCH 8/8] logging instead of printing --- ffplayout.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ffplayout.py b/ffplayout.py index f2cf72b3..05625c48 100755 --- a/ffplayout.py +++ b/ffplayout.py @@ -651,19 +651,19 @@ class MediaWatcher: self._media.add(event.src_path) - print('Add file to media list: "{}"'.format(event.src_path)) + logger.info('Add file to media list: "{}"'.format(event.src_path)) def on_moved(self, event): self._media.remove(event.src_path) self._media.add(event.dest_path) - print('Moved file from "{}" to "{}"'.format(event.src_path, - event.dest_path)) + logger.info('Move file from "{}" to "{}"'.format(event.src_path, + event.dest_path)) def on_deleted(self, event): self._media.remove(event.src_path) - print('Removed file from media list: "{}"'.format(event.src_path)) + logger.info('Remove file from media list: "{}"'.format(event.src_path)) def stop(self): self.observer.stop()