0

I'm trying to capture a screen that is in portrait mode using ddgrab(on a 3080, so using nvenc). This was the original command:

ffmpeg -f lavfi -i ddagrab=output_idx=0 -c:v h264_nvenc -cq 18 output.mp4.

My output video comes out sideways as if i was in landscape which is not what I need. I've tried tranposing it with someone else's help like this:

ffmpeg -filter_complex "ddagrab=output_idx=0,hwdownload,format=bgra,transpose=dir=clock,format=nv12[out]" -map "[out]" -c:v h264_nvenc -cq:v 18 output.mp4 .

But the transposing is taking up too much CPU overhead and its significantly slowing my system. I've seen the libnpp and the transpose_npp but there is no compiled version of it for some reason. Then I found this on stackexchange about cuda accelerated openCL filters and know there is a transpose_openCL that I was hoping would solve my problem but I cannot get it to work because I don't really know what I'm doing. I was hoping to get some info on how I could either capture the video as it is displayed to me or apply a filter efficiently to make it correct.

1 Answer 1

0

If asking for rotation on playback from the video player is acceptable, then add -metadata:s:v:0 rotate=90 to your command, or route the original captured file back through ffmpeg as described here: https://stackoverflow.com/questions/25031557/rotate-mp4-videos-without-re-encoding

This guide includes instructions on how to compile ffmpeg with CUDA support, and may get you started with hardware-accelerated filters. Note that unlike NVENC or NVDEC, which otherwise have little-to-no GPU performance impact, OpenCL or CUDA accelerated filters will consume GPU resources and could impact your captured application's performance.

I am not specifically experienced with a capture function for ffmpeg that follows screen rotation settings, but you may have better luck with another ingest mechanism, some other ffmpeg options are detailed here, or with a different NVENC-accelerated capture application, such as OBS.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .