lisamelton / video_transcoding

Tools to transcode, inspect and convert videos.
MIT License
2.39k stars 160 forks source link

query-handbrake-log appears to have an issue with OS X Automator #65

Closed bmhayward closed 8 years ago

bmhayward commented 8 years ago

Don,

Not quite sure this is a bug, but thought I'd submit it.

Here's the situation, using OS X Automator's Run Shell Script with the query-handbrake-log command: /usr/local/bin/query-handbrake-log t "/Users/hayward/Desktop/Transcode/Logs" > "/Users/hayward/Desktop/time.txt"

you receive the following error: The action “Run Shell Script” encountered an error. /usr/local/bin/query-handbrake-log: invalid byte sequence in US-ASCII

I found this discussion, which seems to be relevant: https://github.com/CocoaPods/CocoaPods/issues/1538

From that discussion, if I structured the commands in the Run Shell Script as: export LC_ALL="en_US.UTF-8" /usr/local/bin/query-handbrake-log t "/Users/hayward/Desktop/Transcode/Logs" > "/Users/hayward/Desktop/time.txt"

everything works as it should.

If you need anything else, please let me know.

Thanks, Brent

lisamelton commented 8 years ago

@bmhayward Wow, that is weird. Thanks for opening this.

I'm not sure this is a bug in query-handbrake-log so much as a peculiar interaction between the Ruby interpreter (or libraries) and Automator.

Are there any non-ASCII characters in the filenames you're passing to query-handbrake-log?

bmhayward commented 8 years ago

Don,

Nothing out of the ordinary as far as non-ASCII characters. What I posted is the exact set of commands I tested with.

When I first tried using query-handbrake-log with Automator nothing would happen, so I just moved on. I had some time today to go back dig in and that is what I found. What I wanted was a way to drop a single log file or a folder of log files on an app and process. Initially, I thought it would just take a few minutes to bang that out with Automator.

Anyway, at least I now know how to use it with Automator and maybe save someone else the trouble in the future.

Thanks, Brent

lisamelton commented 8 years ago

@bmhayward OK, I think this is an Automator issue then. Basically, it's requiring input in UTF-8 format. And if it somehow can't figure out whether something is definitely UTF-8, then it just barfs. Which is pretty stupid. And yet another reason I never use Automator.

So, I'll close this as "won't fix" for now and chalk it all up to experience. :) However, I may eventually figure out how to add this to the "FAQ" in the "README" document.

Thanks, again!

lisamelton commented 8 years ago

@bmhayward Thinking about it again, this is not really a frequently asked question since you're the only one who's ever asked me about this. :) Which is impressive, BTW.

So, maybe this should go in a new "TIPS" sub-section within the larger "Guide" section of the "README" document? I don't know yet but I'll noodle on this some more.

bmhayward commented 8 years ago

@donmelton TIPS sub-section sounds great.

Here is the completed OS X app to try out. Transcode Log Analysis.zip

I will post it to github as part of the entire workflow solution sometime in the next week. In the mean time, you can read about the workflow solution in the attached TL;DR. TL;DR.zip

Any suggestions, corrections or additions are greatly appreciated.

Thanks again, Brent

lisamelton commented 8 years ago

@bmhayward Very cool. I look forward to seeing it online. :)

bmhayward commented 8 years ago

@donmelton closing the loop, Transcode Log Analyzer.app is now available as part of the Transcode workflow solution, https://github.com/bmhayward/Transcode.git

Any thoughts, suggestions, ideas, bugs, etc. would be greatly appreciated :-)

hughker commented 8 years ago

@bmhayward the ReadME alone is pretty awesome, can't wait to give your Transcode app a try. I must've missed the part where it's actually an all-in-one awesomeness for all your transcoding needs. Are you on Gitter? If not, might I suggest syncing up your repo to it so we all can chat on there without clogging up issues?

bmhayward commented 8 years ago

@hughker I'm now on Gitter, https://gitter.im.bmhayward/Transcode.

Thanks for the tip!