slhck / ffmpeg-debug-qp

FFmpeg Debug Script for QP Values
Other
75 stars 24 forks source link

Idea: Direct mode without datalog #28

Closed lars18th closed 1 year ago

lars18th commented 4 years ago

Hi,

I suggest this idea: Include support for [-l | -k | -n] where -n represents: -n, --no-logfile "not use a logfile, compute directly".

After incorporating my PR #26 (re-adapted to the current code), it will be possible to use the function log_callback() to adapt the output. Then in a direct mode instead of writing to a file, the datalog lines can be passed over the STDIN/STDOUT to the python parser directly. In this case, a chunk of lines are preferable to overcome troubles. In fact, the idea is to buffer a complete frame and flush when it ends (at the line with the pkt_size lable).

What you think?

slhck commented 4 years ago

Sounds like a good idea. We should modify or buffer the lines so that they're easier to parse.

In principle, if we did that, thinking a bit further, we could also just directly write the CSV and LD-JSON output from the binary. It's only my lack of willingness to do that in C++ that has prevented this so far.

lars18th commented 4 years ago

Sounds like a good idea. We should modify or buffer the lines so that they're easier to parse.

In principle, if we did that, thinking a bit further, we could also just directly write the CSV and LD-JSON output from the binary. It's only my lack of willingness to do that in C++ that has prevented this so far.

Well, I prefer to leave the option to save the logfile. However, regarding the idea of removing the python code it can be useful. But as you mentioned this will implies a lot of work using C/C++ libraries (for parsing, CSV and JSON support). So, I suggest to first implement this option.

Regards.