diff --git a/lbry/extras/daemon/daemon.py b/lbry/extras/daemon/daemon.py index 014a69194..1ffec6cf0 100644 --- a/lbry/extras/daemon/daemon.py +++ b/lbry/extras/daemon/daemon.py @@ -3174,12 +3174,13 @@ class Daemon(metaclass=JSONRPCServerType): self, claim_id, bid=None, file_path=None, channel_id=None, channel_name=None, channel_account_id=None, clear_channel=False, account_id=None, wallet_id=None, claim_address=None, funding_account_ids=None, - preview=False, blocking=False, replace=False, **kwargs): + preview=False, blocking=False, replace=False, validate_file=False, optimize_file=False, **kwargs): """ Update an existing stream claim and if a new file is provided announce it to lbrynet. Usage: stream_update ( | --claim_id=) [--bid=] [--file_path=] + [--validate_file] [--optimize_file] [--file_name=] [--file_size=] [--file_hash=] [--fee_currency=] [--fee_amount=] [--fee_address=] [--clear_fee] @@ -3199,6 +3200,11 @@ class Daemon(metaclass=JSONRPCServerType): --claim_id= : (str) id of the stream claim to update --bid= : (decimal) amount to back the claim --file_path= : (str) path to file to be associated with name. + --validate_file : (bool) validate that the video container and encodings match + common web browser support or that optimization succeeds if specified. + FFmpeg is required and file_path must be specified. + --optimize_file : (bool) transcode the video & audio if necessary to ensure common + web browser support. FFmpeg is required and file_path must be specified. --file_name= : (str) override file name, defaults to name from file_path. --file_size= : (str) override file size, otherwise automatically computed. --file_hash= : (str) override file hash, otherwise automatically computed. @@ -3327,6 +3333,10 @@ class Daemon(metaclass=JSONRPCServerType): if fee_address: kwargs['fee_address'] = fee_address + file_path = await self._video_file_analyzer.verify_or_repair( + validate_file, optimize_file, file_path, ignore_non_video=True + ) + if replace: claim = Claim() claim.stream.message.source.CopyFrom( diff --git a/lbry/file_analysis.py b/lbry/file_analysis.py index 550ffc6a1..bce7d7799 100644 --- a/lbry/file_analysis.py +++ b/lbry/file_analysis.py @@ -305,6 +305,9 @@ class VideoFileAnalyzer: if not validate and not repair: return file_path + if ignore_non_video and not file_path: + return file_path + await self._verify_ffmpeg_installed() try: scan_data = await self._get_scan_data(validate, file_path)