StreaMonitor icon indicating copy to clipboard operation
StreaMonitor copied to clipboard

[Request] Tip for saving space

Open sminato27 opened this issue 3 years ago • 10 comments

Can u add a feature to FFMPEG transcode the files into H265 after stream ends? Actually I'm using Tdarr to compress the files using an FFMPEG transcode plugin and I'm saving like 50% more space with minimum visible quality loss (probably I haven't configured it properly). image

sminato27 avatar Oct 30 '22 04:10 sminato27

It is possible to set custom transcoding chain for the ffmpeg downloader so it can convert even while downloading. The drawback is that it needs a lot resources or a decent GPU.

lossless1024 avatar Oct 30 '22 19:10 lossless1024

So when u can, I would like to request u to add this feature as an configurable thing like, if I want I can enable transcoding while downloading or just download without transcode. It'll help us af.

sminato27 avatar Oct 30 '22 22:10 sminato27

You can manually do this. In the downloaders/ffmpeg.py you can edit the output preset. Simply replace the -c:v copy -c:a copy with the preset line on the attached screenshot.

lossless1024 avatar Oct 31 '22 11:10 lossless1024

Would be better if you make a config anyways @lossless1024

xAstroBoy avatar Nov 03 '22 12:11 xAstroBoy

Would I need to install anything? Also, @sminato27 could you include that entire preset line you're using in a reply? I'd like to try that out - but want to make sure I have the entire line.

nolageek avatar Nov 21 '22 21:11 nolageek

same, would try it to use in the post-processing for VR videos , as they occupy a lot of space.

xAstroBoy avatar Nov 21 '22 21:11 xAstroBoy

First of all: I think the above screenshot is NVIDIA specific.

Check this: FFmpeg hevc-nvenc encoder info

You need to make sure that your ffmpeg is compiled with libx265 and all stuff is installed. To check you can run ffmpeg --version search for --enable-libx265

For the downloader in ffmpeg.py change the cmd list to this:

cmd = [
        'ffmpeg',
        '-user_agent', self.headers['User-Agent'],
        '-i', url,
        '-c:a', 'copy',
        '-c:v', 'libx265',
        '-vtag', 'hevc1'
        filename
    ]

The list generally follows the element = command line argpart so every full string of a command line is a list element.

Check this for examples: Convert x264 to x265 with ffmpeg

VR extractor still uses ffmpy so in stripchatvr_wss.py change to this:

ff = FFmpeg(inputs={tmpfilename: '-ignore_editlist 1'}, outputs={filename: '-c:v libx265 -c:a copy -vtag hevc1'})

ffmpy supports strings as well as lists as argument.

This should change video codec and keep audio codec.

Use at own rsik. I don't know whether the codec is the right one or so. No detail knowledge on x265.

Best Regards

DerBunteBall avatar Nov 21 '22 21:11 DerBunteBall

@sminato27: This Tidarr Plugin?

If yes the command line Tidarr gives is not only platform specific also video file specific.

Best Regards

DerBunteBall avatar Nov 21 '22 21:11 DerBunteBall

@nolageek sry, couldn't copy it here but the entire line is on the ss. @DerBunteBall yes, it's Tdarr.

sminato27 avatar Nov 21 '22 22:11 sminato27

When it's the plugin in posted it figures out stuff form the source file. So the line wouldn't be usable for other files which not apply the parameters of the source file. If it's usable it oculd lead to strange effects or other defaults I think.

I think the line will be different for different files in Tidarr.

It should be the best way to implement a post processor which is used by the ffmpeg download and the VR downloader.

DerBunteBall avatar Nov 21 '22 22:11 DerBunteBall