How to prevent HDHomeRun from recording shows

This workaround leaves behind a “stub” 100K file in place of the original HDHomeRun video with just the original metadata so that HDHR recognizes it and doesn’t record the show again


Step 1: Download the necessary files

  1. Create a folder called C:\PartCopy
  2. Download the following 2 files and put them into the above folder

Step 2: First Modify your profile to include this:

PostCustomCommandPath=C:\PartCopy\MakeStub.bat
PostCustomCommandParameters="%sourcefile%" 0d 100000d
PostCustomCommandHangPeriod=600
PostCustomCommandCritical=true
PostCustomCommandUISession=false
PostCustomCommandShowWindow=false
PostCustomCommandExitCodeCheck=false

The 0d indicates start from the 0 (decimal) position and 100000d indicates copy the first 100K bytes (decimal)

Step 3 (Optional): Archiving instead of deleting the original file

This script MakeStub.bat will delete the original file and replace it with a stub. If you want to archive the original file instead of delete it, edit the batch file (MakeStub.bat) and replace the line

del %1

with

move %1 "C:\ArchivedFiles"

This will move the original file into the folder C:\ArchivedFiles, you can change the folder name as appropriate.

It didn’t work for me. Here’s a snippet of my error code and my profile

2017-07-09T23:40:56 MCEBuddy.Transcode.CustomCommand --> Custom command parameters read ->

PostCustomCommandPath = c:\partcopy\partcopy.exe 
PostCustomCommandParameters = "%sourcefile%" "%originalfilepath%\%originalfilename%.%originalext%" 0d 100000d 
PostCustomCommandHangPeriod = 600 
PostCustomCommandCritical = True 
PostCustomCommandUISession = False 
PostCustomCommandShowWindow = False 
PostCustomCommandExitCodeCheck = False
2017-07-09T23:40:56 MCEBuddy.Transcode.CustomCommand --> About to run custom command with parameters: 
PostCustomCommandPath = c:\partcopy\partcopy.exe 
PostCustomCommandParameters = "\\WDMYCLOUD\HDHomeRun\Orphan Black\Orphan Black S05E05 20170708 [20170709-0200].mpg" "\\WDMYCLOUD\HDHomeRun\Orphan Black\Orphan Black S05E05 20170708 [20170709-0200].mpg" 0d 100000d 
PostCustomCommandHangPeriod = 600 
PostCustomCommandCritical = True 
PostCustomCommandUISession = False 
PostCustomCommandShowWindow = False 
PostCustomCommandExitCodeCheck = False
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base --> Launching process c:\partcopy\partcopy.exe
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base --> Process arguments "\\WDMYCLOUD\HDHomeRun\Orphan Black\Orphan Black S05E05 20170708 [20170709-0200].mpg" "\\WDMYCLOUD\HDHomeRun\Orphan Black\Orphan Black S05E05 20170708 [20170709-0200].mpg" 0d 100000d
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base --> UI Session Admin Process : False
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base --> Setting process priority to Normal
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base -->  P a r t C o p y   -   V e r s i o n   1 . 1 2   R e l e a s e   1   B u i l d   3 
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base -->  C o p y r i g h t   ( C )   2 0 0 5 - 2 0 1 4   J o h n   B u o r o ,   V i r t u a l O b j e c t i v e s . 
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base -->  A l l   R i g h t s   R e s e r v e d . 
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base -->  T h i s   p r o g r a m   i s   F r e e w a r e   a n d   m u s t   n o t   b e   d i s t r i b u t e d   o r   s o l d   f o r   p r o f i t . 
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base -->  
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base -->  U s i n g   C o m m a n d - L i n e   P a r a m e t e r s 
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base -->  S o u r c e   F i l e   =   \ \ W D M Y C L O U D \ H D H o m e R u n \ O r p h a n   B l a c k \ O r p h a n   B l a c k   S 0 5 E 0 5   2 0 1 7 0 7 0 8   [ 2 0 1 7 0 7 0 9 - 0 2 0 0 ] . m p g 
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base -->  D e s t i n a t i o n   F i l e   =   \ \ W D M Y C L O U D \ H D H o m e R u n \ O r p h a n   B l a c k \ O r p h a n   B l a c k   S 0 5 E 0 5   2 0 1 7 0 7 0 8   [ 2 0 1 7 0 7 0 9 - 0 2 0 0 ] . m p g 
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base -->  E R R O R :   S o u r c e   a n d   d e s t i n a t i o n   f i l e s   c a n n o t   b e   t h e   s a m e ! 
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base -->  S t a r t   P o s i t i o n   =   0 d 
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base -->  O f f s e t   L e n g t h   =   1 0 0 0 0 0 d 
2017-07-09T23:40:56 MCEBuddy.AppWrapper.Base -->  
--> Process exited with code 1

my profile

[HDHomeRun H.264 high quality]
Description=Use this to remove the commercials and convert the source video into a SiliconDust HDHomeRun compatible MPG file with (H.264/AC3) video/audio.
order=handbrake,ffmpeg 
ffmpeg-general=-threads 0 
ffmpeg-video=-ss 3 -vf yadif=0:-1:1,hqdn3d -vcodec libx264 -b 1800k -x264opts me=hex:trellis=2:subq=8:partitions=all:8x8dct=1:ref=5:rc-lookahead=50:keyint=25:min-keyint=20:bframes=3:weightb=1:level=4.0:b-pyramid=normal:direct=auto:mixed-refs=1:deblock=-1,-1:no-fast-pskip=1:no-dct-decimate=1:b-adapt=2:threads=auto -map 0:v -sn
ffmpeg-audio=-acodec ac3 -ab 192k -map 0:a 
ffmpeg-audioac3=-acodec ac3 -ab 384K -map 0:a 
ffmpeg-ext=.ts 
ffmpeg-audiodelay=skip 
handbrake-general=--decomb --denoise="weak" --loose-anamorphic --verbose=2 -T -f mp4 -O
handbrake-video=--start-at duration:3 -e x264 -b 1800 -x me=hex:trellis=2:subq=8:partitions=all:8x8dct:ref=5:rc-lookahead=50:keyint=25:keyint-min=20:bframes=3:weight-b:level-idc=40:b-pyramid=normal:direct-pred=auto:mixed-refs:deblock=-1,-1:nofast-pskip:nodct-decimate:b-adapt=2:threads=auto
handbrake-audio=-E ffac3 -R auto -B 192 -D 0 -a 1,2,3,4,5 
handbrake-audioac3=-E ffac3 -R auto -B 384 -D 0 -a 1,2,3,4,5 
handbrake-ext=.mp4 
handbrake-remuxto=.ts 
handbrake-audiodelay=skip 
PreConversionCommercialRemover=true 
RenameExt=.mpg
PostCustomCommandPath=C:\PartCopy\PartCopy.exe
PostCustomCommandParameters=""%sourcefile%" "%originalfilepath%\%originalfilename%.%originalext%" 0d 100000d"
PostCustomCommandHangPeriod=600
PostCustomCommandCritical=true
PostCustomCommandUISession=false
PostCustomCommandShowWindow=false
PostCustomCommandExitCodeCheck=false

Please enclose the content to in code quotes ``` or mark it as preformatted text so it preserves the characters and makes it more readable (edit your post for now).

I’m going to take a guess here and say that you’ve enabled one of these options:

Either Skip copying original files or Skip remuxing files

If so you need to ensure that NEITHER of these options are checked, that’s probably why it’s failing because when you don’t copy the "%sourcefile% is the same as the %originalfilepath%\%originalfilename%.%originalext% which is what PartCopy is complaining about, source and destination are the same. If you check one of these options you will end up with this problem. Uncheck these options and it’ll work.

Also note that your PostCustomCommandParameters is missing double quotes ("), the entire set of parameter is enclosed in double quotes:

PostCustomCommandParameters=""%sourcefile%" "%originalfilepath%\%originalfilename%.%originalext%" 0d 100000d"

I checked. The two skipped boxes are unchecked.

I do have the following in my Monitor Location Expert settings
archive original file checked
Delete Original File unchecked,
archive folder designated.
Exclude folder blank
Minimum age before processing 1 minute.
Monitor converted videos checked
remonitor recorded videos checked.

Could any of this cause the issue?

I

Unlikely. Can you attach your conversion log.

You’re right, just verified, this problem does occur with the latest builds. To solve this issue, we will need a batch file to overwrite the original file. I’ve created a batch file and updated the instructions in the first post. Try it out and it should work now.

It looks like it’s now making the file, but it seems to delete the original file (not archive it) then move the 10k file to my archive folder.

Yes that’s correct. This script will overwrite the original file. If you want to archive instead of delete just modify the batch file to move the original to an archive folder instead of deleting it.

Here is an example of a batch file (replace the content of MakeStub.bat) that can be used to Archive the original instead of deleting it and leave behind the stub

PartCopy %1 %1.tmp %2 %3
move %1 C:\ArchivedFiles
move %1.tmp %1

I’ve updated the original instructions to reflect this.

1 Like

Works like a charm. Thanks!

Next I need to experiment on making a profile that only makes the 100k file to backfill all my old recordings.

1 Like

That’s easy. Use the Rename only option in the Conversion Task and use the same profile with the custom command in it. It doesn’t matter what profile you’re using because when you enable rename only it only renames and not recodes but at the end the custom command will still run creating your 100k stubs. Make sure commercial detection turned off.

Is this still the preferred method to prevent the HDHomerun from recording shows again? I converted all my recordings using the HDHR H.265 profile and moved them to another folder and archived the old files.

Yes, it’s still the best way to prevent recording.