Project

General

Profile

Post Remove Command issue

Added by John Hanley almost 5 years ago

In my post processor command I trigger FFMPEG to transcode from a TS container to a MKV container and compress the video a tad. It works fine:

/usr/bin/ffmpeg i "%f" -f matroska -crf 22 -c:a libvorbis -vf scale=-1:720 -y "/video/%t%p.mkv"

In my post remove command I want to call rm to delete the file I just created with ffmpeg. My command is:

rm f "/video/%t%p.mkv"

It doesn't work. The file remains.

I am curious that the file that was created by ffmpeg has single quotes around it: 'Blue Bloods-S01E09.mkv'

Can anyone spot my error as to why it doesn't delete this file?

Many thanks!


Replies (6)

RE: Post Remove Command issue - Added by Hiro Protagonist almost 5 years ago

The filename displays with single quotes because it contains a space.
Possibly that is what is causing your 'rm' to fail.

In your recording profile, try selecting "Replace whitespace in title with '-'".

RE: Post Remove Command issue - Added by John Hanley almost 5 years ago

Yes, I've done that. The spaces get stripped out when tvheadend creates my .ts file. However, when running the post processor command, the spaces do not get stripped out. ie. the %t argument still contains spaces.

Any other suggestions how to correct this?

Thanks!
John

RE: Post Remove Command issue - Added by Hiro Protagonist almost 5 years ago

Actually I'm a bit puzzled about your use of %f, %t etc.

Could you post the full script?

You could either extract the original filename and changethe .ts to .mkv, or use sed or tr to change the whitespace to another character in the title.

RE: Post Remove Command issue - Added by John Hanley almost 5 years ago

There is no script. Just the single post processor command in tvheadend that I posted above.

%f is tvheadend's argument for the full path name.

RE: Post Remove Command issue - Added by Hiro Protagonist almost 5 years ago

John Hanley wrote:

There is no script.

Sounds like you need one - could try a one-liner, something like:

rm /video/$(basename "%f" | sed s/ts$/mkv/)

%f is tvheadend's argument for the full path name.

So you're re-muxing to mkv but keeping the ts?

RE: Post Remove Command issue - Added by John Hanley almost 5 years ago

So you're re-muxing to mkv but keeping the ts?

That was the idea. But I just found that I can record directly to mkv and adjust compression so I will give that a go instead.

My big issue was my Chromecast crashing when playing TS files over Plex. I tried converting to MP4 but the closed captioning was not copied adequately. But the mkv container seems to handle closed captioning fine. Hopefully compressing the file as well will cause Chromecast to not crash.

If that doesn’t work, I will guess it’s a Chromecast issue.

    (1-6/6)