So I\'ve been using Handbrake command line to encode my video collection to store on my NAS so I can use it on my HTPC. I was looking for a way to output both to the screen so I
I would use Tee-Object for this:
./HandbrakeCLI.exe -i infile -o outfile ... 2>&1 | Tee-Object -File movie.log
Added in the 2>&1
to capture errors to the log as well as the screen.
What you really want to do is to grab the tail.exe binary from the UnxUtils package and run it as follows:
tail -f D:\Conversions\Completed\Movies\9.29.1010.log
Unfortunately you will need to do that in a second command prompt (or PowerShell) window, but it will "follow" that file and display the lines from the log as they are added.
If you really want to keep that in a single window, you will need PowerShell v2 and you can start the encoding as a job (allowing it to run in the background) and then follow that command with a call to tail for displaying the results:
Start-Job -ScriptBlock { ./HandbrakeCLI.exe -i "in" -o "out" "params" > log.txt }
tail -f log.txt