I am using Jetson Xavier AGX and I have obtained the YUV values after decoding using nvv4l2decoder. I was wondering if there is a way I can extract the YUV values after decoding, do some alteration to the Y value (Example: increase the Y value by 10) and encode it back to check the visual differences.
If it does not need to be in real time. You can save it to a file, modify the file and use the file as encoder input. It will be two commands:
gst-launch-1.0 filesrc location=input.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! nvvidconv ! videox-raw ! filesink location=decoded.yuv
gst-launch-1.0 filesrc location=decoded.yuv ! videoparse ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=NV12’ ! nvv4l2h264enc ! h264parse ! qtmux ! filesink location=output.mp4
Hi, thank for answering. I have 2 follow up questions.
- Is there a way to do this in real time ?
- Also, after saving the file what are some efficient ways in which the .yuv file can be accessed so as to modify the Y value ?
For real time processing, you can run like:
... ! nvv4l2decoder ! nvvidconv ! 'video/x-raw(memory:NVMM), format=I420' ! nvv4l2h264enc ! ...
And add code in nvvidconv for processing frame data. And then rebuild/replace the plugin. Please download the source code package to get the code.
Or is it also possible to build a plugin that processes frame data ? If yes, where can I find the proper guide to build a custom plugin so I can achieve my goal ?
Since nvvidconv plugin is an existing implementation, it would be easier to customize the plugin. Developing a whole new plugin would take more time.