-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How to log all the output info of crf-search #58
Comments
It doesn't work as you expect currently because we print using the progress bar library. Progress bar stuff avoids output to not-terminals. However, it's possible to suspend the bar and use |
Ah I just gave I guess the real issue is the current stderr output is designed for humans to read on a terminal as the bin is running, rather than as a log. Perhaps the better course of action is to introduce proper logging that can be enabled and used in these cases. |
So these results are also printed by the progress bar library?
I was hoping they could be saved in a variable and then printed through another stream or something similar. If that is not as simple or possible, then I would appreciate if ab-av1 itself was able of logging, I guess by adding a parameter to the command line or something like that. Sorry for bothering with this request, although I'm not a programmer, I was hoping I could solve it myself. Thank you for your help. |
I've made a simple change that will print the crf-search attempts also when stderr is not a terminal (#61). This approach won't generally work for printing sample-encode logs etc, so adding a logging option is still perhaps the way to go for a full verbose output. But perhaps this change will work for you for now? |
It kinda works? I mean, the results are output through stderr now, but they are messy to read, as they are mixed with other stderr error messages, like this:
I don't know why that error appears, if it wasn't there it wouldn't be so messy. Alternatively, is it possible to output it through any other stream? just not stderr, to not mix it with the error logs, maybe the warning or debug stream? |
The idea is stdout is the program result only, which in this case is the human readable output of the successful crf search. Stderr is used for progress bars, updates/logs & errors. It isn't usual to use more than the two standard streams so I'd prefer not to.
Nor me, I don't recognise the error at all. A Windows/powershell thing presumably? |
I understand. However, the attempts could be considered part of the result, as they provide very useful context to understand how the program achieved the final result, and Anyway, I'm trying to get rid of the powershell error message, but it seems to be a default error streamed through stderr everytime powershell runs a non native executable, such as ab-av1. I was able to make the message smaller by adding
So now I get:
I'll try to completely get rid of it if it is even possible. |
Trying to get rid of that powershell error message was giving me a headache, I made some advancement using the Start-Process powershell command to run ab-av1, it got rid of the error message but then had other problems trying to log, so nevermind. I took a simpler approach. Thanks to your latest commit to help me with this issue I learnt what lines affect these options. In the end I found it a lot easier to download the repo and change your code to output the crf-search samples in the stdout, and compile that modified ab-av1 version.
This solution will work for me perfectly fine, but I would not like to get stuck in this version if you make other improvements to the program. So I would be very grateful if you could eventually add a proper logging natively supported option as you initially suggested in the future. Sorry for bothering you with this and thank you for all your help and support. |
I've merged #209 log support. Let me know if that is enough to resolve this. |
Hi, first of all, thank you for this awesome tool.
I've written a small powershell script to batch process a folder with multiple video files and run crf-search with all of them for a given target vmaf. It is probably poorly written, but it is simple, works well and I'm happy with it.
Now I'm having some trouble trying to log all the information shown in the powershell terminal when I run crf-search, maybe because I'm not sure how to do it correctly.
I find extremely useful the information of the several attempts ab-av1 makes to find the most suitable crf for the target vmaf and their estimated filesize. I think it is very helpful info to make a final decision on what settings to finally choose, as I might have incorrectly assessed my initial target and the filesize difference with a bit lower/higher vmaf might be or not be worth it for a certain video file, so I could benefit more from a crf in between the tested ones to get a more quality/size efficient result.
This is the script I'm running:
When I run it like this, with
*>&1
to redirect all streams into my logfile, I don't see the usual progress bar and multiple crf-search attempts in my terminal, nor it logs them into the logfile, which is what I'm interested in. Instead, I get the following result:I don't know why that error appears, but it does not bother me much. The problem is that it does not log the other crf tests, only the final one for my target vmaf. Exactly the same happens when the error stream is redirected with
2>&1
.Then, if I change the redirect
*>&1
option to, let say, verbose4>&1
, as well as any other redirect, this is what I get:As you can see, the error disappears, but again, only the final result of the crf-search command is logged. I tried with the other redirects as explained by microsoft's documentation (https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_redirection?view=powershell-7.2) with the same result.
So it seems I am unable to save the whole process shown in the terminal into a file, including the results of the binary search to find the best crf value. This is what I would expect to save into the log (copy pasted from my terminal):
What am I doing wrong? could you help me save all the information into a text file?
Thank you in advance.
The text was updated successfully, but these errors were encountered: