Jump to content
Djoss

[Support] Djoss - HandBrake

500 posts in this topic Last Reply

Recommended Posts

27 minutes ago, huntjules said:

Hello, I have the same issue with read and write permissions, I've checked & read and write is enabled for both source and output folders (I've enclosed pdf doc, showing pics of configs, errors and cut & pasted logs, any guidance appreciated)?

 

Handbreak read&write issues.pdf

 

The destination for you converted videos, inside the container, should be under '/output'.  Did you tried that?

Share this post


Link to post
13 hours ago, giantkingsquid said:

I think it would be better (certainly for my setup using CouchPotato) if the output is put in the output directory itself.

 

Ok, let's got for this way.

 

13 hours ago, giantkingsquid said:

But it's your docker so it's up to you really :)

 

Sure, but I want it to be useful for others :).  I don't use subfolders in the watch directory myself.

 

13 hours ago, giantkingsquid said:

One thing that I noticed is that some torrents include a short sample video. I think this would be ok to get transcoded and outputted as well because most of the auto management tools (like CouchPotato) know to delete the sample movie when it appears in its watch folder.

 

One thing to remember is that currently, the watch folder expects to have only video files.  So if other files are present (like .nfo, .jpg, etc), HandBrake will fail to convert them and these files won't be removed.  However, empty directories can be removed without problem.

  • Upvote 1

Share this post


Link to post

Hi Love this docker and the Latest Update

Is there any chance it could be change to respect directories ?

For example i have my watch folder set up like this 

/watch/TV Shows
/watch/Movies

 

However when the files are converted they are just put straight in to the output folder ignoring if its a tv show or a movie and therefore Sonarr and radarr don't know the conversion has finished i feel like this would be a useful change 

Edited by feves
Formatting
  • Upvote 1

Share this post


Link to post

Ok, looks like I will need to add a parameter for the output format...!

  • Upvote 1

Share this post


Link to post

Thank you it would make it a great docker for my situation

Share this post


Link to post

In my experience, with CouchPotato and SickRage, they can both watch the same output folder and work out which movie files belong to which program. I've been using them both like this for six months now without a single misstep.

 

I assume that they know that they downloaded x.mp4 so ignore all else.

 

DJoss, I haven't had a chance to test the new version yet, will endeavor to today and let you know how it goes. I'll test for this situation as well.

Share this post


Link to post
Quote

 

Hello, I have the same issue with read and write permissions, I've checked & read and write is enabled for both source and output folders (I've enclosed pdf doc, showing pics of configs, errors and cut & pasted logs, any guidance appreciated)?


 

 

@Djoss can correct me if I'm wrong, but mapping /watch and /output to the same unRAID folder is probably not a good idea. Especially since they are both mapped to the root of ALL your shares. I recommend you turn off the docker until someone can give you better advice on how to map the folders, or you might be running at risk of data loss. Or at the very least, map /watch to something else, even if it's just an empty folder on one of your shares. There's a few lines in your log relating to errors processing files from the /watch folder and it doesn't look like it's something you want to be happening.

 

For what it's worth here are my folder mappings as reference, notice that /storage is different to /watch that is different to /output:

5954eee7a8614_ScreenShot2017-06-29at10_12_39pm.png.957393e66609cf5d0a8796f90340c454.png

Edited by Jorgen
missing quote

Share this post


Link to post

Right, a loop would be created if the /watch and /output folders are mapped to the same directory: a video that finished to be converted would be converted again since it will be seen as a new file of the watch folder.

 

If the automatic video conversion feature is not used, the /watch folder can simply be removed from the container settings.

Share this post


Link to post

Personally and I do mean personally this is how I do my setup. I created a Cache Only user share called (HandBrake)

/Handbrake/watch > /mnt/cache/Handbrake/watch

/Handbrake/output > /mnt/cache/Handbrake/output 

/Handbrake/storage > /mnt/cache/Handbrake/storage -------- I only put files I'm considering to convert soon here opposed to my entire system. Or a script will pull one at a time from here 

/config > /mnt/cache/system/appdata/Handbrake

 

Also within that (Handbrake) share I've created a few other folders for some scripts I've written, but I find that creating a Cache Only share lets me tinker around without worrying about spooling up the discs and keeps my system from going a little bonkers and I want to keep HandBrake sand-boxed so it doesn't have free reign over my system

 

@Jorgen I think I was reading that unRAID 6.4 or maybe its soon after that does away with user0. I only mention that because I see you've mapped it. 

************************update***********************

Looks like you already know. Saw your reply in 6.4

Share this post


Link to post

@feves, I pushed an update.  I've added a new environment variable that should fit everyone's need .

Share this post


Link to post

Hi Djoss,

I finally got around to testing your new version. Everything you've done works as expected, however it's still not working for me. The problem I am having is that the Handbrake docker writes the files to Output slowly (obviously), and that both Sickrage and CouchPotato are moving the partially written file to their final destination before the encode is complete. Obviously this freaks out all programs involved!

 

So what I was thinking was that if you initially store the input file name as a variable, then wrote the output file to a randomly named file, for instance you could call it the MD5 hash that you calculate near the top of your script. Then when the conversion in complete and Handbrake is finished, rename the file back to the stored real file name.

 

That way, both Sickrage and CP would not recognize the file and try to move it until it is complete.

 

Second, minor problem (again for my work flow), is that the docker does not remove the directory when it completes the encode. Eg After /watch/movie/movie.mp4 is finished the whole /watch/movie directory should be removed.

 

Thanks mate.

Edited by giantkingsquid

Share this post


Link to post

@giantkingsquid

 

Tis exactly why I let Handbrake do its thing and I move files via scripts I come up with so nothing trips up something else.

Share this post


Link to post
21 minutes ago, kizer said:

@giantkingsquid

 

Tis exactly why I let Handbrake do its thing and I move files via scripts I come up with so nothing trips up something else.

 

Yes I'm sure there are many ways to skin this cat, but if the Djoss' script could prevent this happening with just a few lines of code that would help many users I'm sure. :D

Share this post


Link to post

Yep very true. Especially since hes very egar to help out its even better. :D

Share this post


Link to post
5 hours ago, giantkingsquid said:

That way, both Sickrage and CP would not recognize the file and try to move it until it is complete.

So for a file to not be recognized, do the file need to have an unknown extension or a name that doesn't match a known movie/tv show?  I'm asking because HandBrake uses the extension of the output file to determine the video format.

 

5 hours ago, giantkingsquid said:

Second, minor problem (again for my work flow), is that the docker does not remove the directory when it completes the encode. Eg After /watch/movie/movie.mp4 is finished the whole /watch/movie directory should be removed.

When the conversion terminates, the source video file is removed.  Then its folder will be removed if it is empty.  Are you sure it's the case?

Share this post


Link to post
9 hours ago, Djoss said:

So for a file to not be recognized, do the file need to have an unknown extension or a name that doesn't match a known movie/tv show?  I'm asking because HandBrake uses the extension of the output file to determine the video format.

 

When the conversion terminates, the source video file is removed.  Then its folder will be removed if it is empty.  Are you sure it's the case?

 

Yes that is the case. So if it was called nfljhslfh9w87520455h25g8ghnwto8.mkv it would not be recognized and would be left alone until the transcode finished and it was renamed to the correct name. However if it was was called NCIS_S11E01.mkv and Sickrage had already snatched (downloaded a torrent and sent it to the torrent program) that episode it would try to move it before Handbrake was finished encoding it because it knows it has downloaded that episode and is expecting it to turn up at some point in the future.

 

Yes that is true if the movie file was the only file in the directory. If there is a .nfo, .idx, .jpg or anything else the directory is not removed. Just hit it with a rm -rf :ph34r:

 

Edited by giantkingsquid

Share this post


Link to post
18 hours ago, giantkingsquid said:

Yes that is the case. So if it was called nfljhslfh9w87520455h25g8ghnwto8.mkv it would not be recognized and would be left alone until the transcode finished and it was renamed to the correct name. However if it was was called NCIS_S11E01.mkv and Sickrage had already snatched (downloaded a torrent and sent it to the torrent program) that episode it would try to move it before Handbrake was finished encoding it because it knows it has downloaded that episode and is expecting it to turn up at some point in the future.

I'm not sure it's worth implementing this method, because it is something that covers few specific cases, but not all.  Someone could use a different software that triggers on the renamed file.

 

19 hours ago, giantkingsquid said:

Yes that is true if the movie file was the only file in the directory. If there is a .nfo, .idx, .jpg or anything else the directory is not removed. Just hit it with a rm -rf :ph34r:

I don't think we can remove everything, since some people may add multiple videos in the same subfolder.  When a conversion fails, the source is not removed.  So it seems that too much logic would be needed to perform a proper cleanup.  The notion of "video" and "non-video" file would need to be introduced.

 

I'm wondering if your workflow could be:

  1. Downloaded files are moved to Couchpotato/Sickrage watch folder.
  2. Couchpotato/Sickrage moves files to Handbrake's watch folder.
  3. HandBrake converts video to its output folder, which is the final destination.

This way, HandBrake would only get video files (other files being removed by Couchpotato/Sickrage).

 

The other solution would be to use the hook to move converted videos to the Couchpotato/Sickrage's watch folder.  The same script could also do the cleanup.

  • Upvote 1

Share this post


Link to post
5 hours ago, Djoss said:

I'm not sure it's worth implementing this method, because it is something that covers few specific cases, but not all.  Someone could use a different software that triggers on the renamed file.

 

I don't think we can remove everything, since some people may add multiple videos in the same subfolder.  When a conversion fails, the source is not removed.  So it seems that too much logic would be needed to perform a proper cleanup.  The notion of "video" and "non-video" file would need to be introduced.

 

I'm wondering if your workflow could be:

  1. Downloaded files are moved to Couchpotato/Sickrage watch folder.
  2. Couchpotato/Sickrage moves files to Handbrake's watch folder.
  3. HandBrake converts video to its output folder, which is the final destination.

This way, HandBrake would only get video files (other files being removed by Couchpotato/Sickrage).

 

The other solution would be to use the hook to move converted videos to the Couchpotato/Sickrage's watch folder.  The same script could also do the cleanup.

 

I'll give it a go! Thanks for your help to date :) 

Share this post


Link to post

Not sure why, but when I click on the Apps tab and select HandBrake I get FoldingAtHome when I select your HandBrake Docker. Either I'm going nuts or something else is... Lol 

 

This is the URL Community Applicatons is sending me to.

 

192.168.1.46 is my PC's IP.

http://192.168.1.46/AddContainer?xmlTemplate=default:/var/lib/docker/unraid/templates-community-apps/45.xml

 

*******************************Mind Blown**********************************

If I try it on my new machine I get FoldingAtHome, but on my Regular Server it pulls up Handbrake. I'm really confused here. lol

Took blasting my Docker.img and restoring it to bring back the correct install. Not sure why it wanted to install folding. Lol. I am installing this on a Xeon so maybe it thought it could crank out some numbers or something. O.o

 

Share this post


Link to post
6 hours ago, kizer said:

Not sure why, but when I click on the Apps tab and select HandBrake I get FoldingAtHome when I select your HandBrake Docker. Either I'm going nuts or something else is... Lol 

 

This is the URL Community Applicatons is sending me to.

 

192.168.1.46 is my PC's IP.

http://192.168.1.46/AddContainer?xmlTemplate=default:/var/lib/docker/unraid/templates-community-apps/45.xml

 

*******************************Mind Blown**********************************

If I try it on my new machine I get FoldingAtHome, but on my Regular Server it pulls up Handbrake. I'm really confused here. lol

Took blasting my Docker.img and restoring it to bring back the correct install. Not sure why it wanted to install folding. Lol. I am installing this on a Xeon so maybe it thought it could crank out some numbers or something. O.o

 

Couple of things:

  • Not @Djoss issue, so nothing he can do about it.  If CA ever pops up with an incorrect template, post in the CA thread
  • Obviously your computer believes that you haven't been doing your part for a charitable organization, so it's trying to pick up the slack and do what it can by wanting to install Folding@Home.
  • Always keep CA up to date.  Is It?  (CA AutoUpdate was actually created primarily to keep CA itself up to date)  Last weeks update contained fixes for very strange edge-cases like this.
  • What does the pop up when you hover over the icon show?

Share this post


Link to post

@Squid

 

No, I know it wasn't his fault. It was CA... Lol Just appeared that way at first, but I knew something was up when I compared two machines and they both showed different results so it was instantly a "Ah-Ha" Moment. I just wanted to follow up with a reply/edit on his topic since that is where I first posted up a comment and didn't want to leave him/somebody else hanging. I just blasted the docker.img and oddly enough magic happened and all is well again. I was just totally perplexed why it was trying to install Folding@Home or something of the sort on his Docker. Lol

 

It just took some backyard mechanic trouble shooting to figure out my problem. Bulding a new machine and wanted to kick the tires some and HandBrake is a good Test seeing I wanted to compare speeds of old machine to new machine. :D

Share this post


Link to post

You never did answer two questions though.

 

  1. Did the pop up display the wrong info
  2. Did you take the server's advice/demand and install folding@home?
1 hour ago, kizer said:

. I just blasted the docker.img

So much for being able to troubleshoot  :(

Share this post


Link to post

@Squid

 

No, the popup when you click on it showed Handbrake like it should, but when you clicked on the download button it presented Folding. 

Why Blasting the Docker.img fixed it I have no idea. I'm thinking we should probably take this convo to CA lo so we don't drive Djoss and others batty over something that was a fluke or some how my mistake. lol

Share this post


Link to post
On 7/5/2017 at 4:42 PM, giantkingsquid said:

 

Yes that is the case. So if it was called nfljhslfh9w87520455h25g8ghnwto8.mkv it would not be recognized and would be left alone until the transcode finished and it was renamed to the correct name. However if it was was called NCIS_S11E01.mkv and Sickrage had already snatched (downloaded a torrent and sent it to the torrent program) that episode it would try to move it before Handbrake was finished encoding it because it knows it has downloaded that episode and is expecting it to turn up at some point in the future.

 

Yes that is true if the movie file was the only file in the directory. If there is a .nfo, .idx, .jpg or anything else the directory is not removed. Just hit it with a rm -rf :ph34r:

 

One minor issue.  I have a 'MKV Movies' share that has the recycle bin from the recycle bin plugin.  I have the 'MKV Movies' set up as the watch folder and Handbrake is processing the files in the recycle bin.  The recycle bin is a folder named '.Recycle.Bin' and is a hidden folder.  I think Handbrake should ignore hidden folders if there are any in the watch folder, or just exclude the '.Recycle.Bin' folder.  I think this results in files potentially being processed that the user might have deleted and not wanted processed.

/watch/.Recycle.Bin/How the West Was Won/.How the West Was Won.backdrop/flixster_lookup_cache_How the West Was Won_1962 0af83da1095564fca54befbe3a0333b8

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now