FFmpeg Not Transcoding In Real Time
up vote
0
down vote
favorite
Been setting up a recording build for a friend to resemble mine, but I can't seem to get things to work in real-time despite sufficient (as far as I can tell) hardware.
System specs: 8600K, GTX 1050ti, 16Gb RAM, 1tb 860 EVO
Test command (updated for simplicity):
ffmpeg -y -hide_banner -thread_queue_size 9999 -f dshow -rtbufsize 2147.48M -video_size 1920x1080 -framerate 60 `
-i video="@device_pnp_\?usb#vid_07ca&pid_0570&mi_00#7&3886ab1a&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}global" `
-thread_queue_size 9999 -f dshow -rtbufsize 2147.48M -video_size 1920x1080 -framerate 60 `
-i video="@device_pnp_\?usb#vid_07ca&pid_0570&mi_00#7&24df76f&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}global" `
-map 0 -c:v h264_nvenc -r 60 -preset: llhp -pix_fmt yuv420p -b:v 1M -minrate 1M -maxrate 1M -bufsize 1M `
C:UsersJordanVideosFFmpegLeftLeft.ts `
-map 1 -c:v h264_nvenc -r 60 -preset: llhp -pix_fmt yuv420p -b:v 1M -minrate 1M -maxrate 1M -bufsize 1M `
C:UsersJordanVideosFFmpegRightRight.ts
The goal of this command is to record 2 seperate syncronized outputs. However, for one reason or another this command is not transcoding video in real-time, which is a big issue when you're trying to record, not simply convert a file. When I omit one of the two outputs or if I halve the resolution of each input / output everything works in real-time. This would make me believe there is a bottleneck in the system somewhere but when monitoring everything in task manager nothing is even close to capping out (GPU encoder, cpu, ram, and SSD below 30% usage).
Furthermore when I try recording both streams in one 4K60 video via OBS things work perfectly fine, as in real-time. So I don't understand how transcoding two 1080p60 streams in FFmpeg would be anymore intensive than one 4K60 stream in OBS...
I have since swapped the 1050ti out for a GTX 1080 with no difference in performance. This would lead me to believe the CPU is at fault. It looks like FFmpeg is really only hitting 1-2 threads... any way to force it to use more?
-threads doesn't seem to have any affect regardless of where I inject it into the command. What's really weird is I have have a very similar command but I'm doing two 4K60 streams as opposed two 1080p60 streams with a GTX 1080 and 6800K... As far as I can tell the 8600K has higher per thread performance in comparison to the 6800K so I'm not sure how I'm able to get away with so much more.
Any insight would be higly appreciated.
audio video ffmpeg encoding decoding
|
show 10 more comments
up vote
0
down vote
favorite
Been setting up a recording build for a friend to resemble mine, but I can't seem to get things to work in real-time despite sufficient (as far as I can tell) hardware.
System specs: 8600K, GTX 1050ti, 16Gb RAM, 1tb 860 EVO
Test command (updated for simplicity):
ffmpeg -y -hide_banner -thread_queue_size 9999 -f dshow -rtbufsize 2147.48M -video_size 1920x1080 -framerate 60 `
-i video="@device_pnp_\?usb#vid_07ca&pid_0570&mi_00#7&3886ab1a&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}global" `
-thread_queue_size 9999 -f dshow -rtbufsize 2147.48M -video_size 1920x1080 -framerate 60 `
-i video="@device_pnp_\?usb#vid_07ca&pid_0570&mi_00#7&24df76f&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}global" `
-map 0 -c:v h264_nvenc -r 60 -preset: llhp -pix_fmt yuv420p -b:v 1M -minrate 1M -maxrate 1M -bufsize 1M `
C:UsersJordanVideosFFmpegLeftLeft.ts `
-map 1 -c:v h264_nvenc -r 60 -preset: llhp -pix_fmt yuv420p -b:v 1M -minrate 1M -maxrate 1M -bufsize 1M `
C:UsersJordanVideosFFmpegRightRight.ts
The goal of this command is to record 2 seperate syncronized outputs. However, for one reason or another this command is not transcoding video in real-time, which is a big issue when you're trying to record, not simply convert a file. When I omit one of the two outputs or if I halve the resolution of each input / output everything works in real-time. This would make me believe there is a bottleneck in the system somewhere but when monitoring everything in task manager nothing is even close to capping out (GPU encoder, cpu, ram, and SSD below 30% usage).
Furthermore when I try recording both streams in one 4K60 video via OBS things work perfectly fine, as in real-time. So I don't understand how transcoding two 1080p60 streams in FFmpeg would be anymore intensive than one 4K60 stream in OBS...
I have since swapped the 1050ti out for a GTX 1080 with no difference in performance. This would lead me to believe the CPU is at fault. It looks like FFmpeg is really only hitting 1-2 threads... any way to force it to use more?
-threads doesn't seem to have any affect regardless of where I inject it into the command. What's really weird is I have have a very similar command but I'm doing two 4K60 streams as opposed two 1080p60 streams with a GTX 1080 and 6800K... As far as I can tell the 8600K has higher per thread performance in comparison to the 6800K so I'm not sure how I'm able to get away with so much more.
Any insight would be higly appreciated.
audio video ffmpeg encoding decoding
It's not using more threads because you are compressing withnvenc
.
– chew socks
Dec 2 at 21:42
Most of that CPU is probably audio, actually. You could try remove all the audio related flags and putting in-an
in their place to test this.
– chew socks
Dec 2 at 21:45
Thank you for the comment, I tried removing all audio and put -an in place. Things are still starting far below real-time and then creeping up, looks like it would take about 40-50 minutes... What I don't understand is if I use the same command on my PC (change the capture cards) everything just works right from the get go and it has a theoretically inferior CPU. Could it be something to do with this CPU lacking hyper threading? nvenc is encoding but the CPU is still decoding right? The GPUs encoder is barely being touched.
– Nimble
Dec 3 at 3:12
Your inputs are dshow, so there's not much "decoding" to speak of, mostly memory I/O ops.
– Gyan
Dec 3 at 5:44
Wouldn't that infer that the CPU isn't needed much in the process? The reason I suggested he get an 8600K over the 8700K is I assumed the GPU was doing all the heavy lifting. I'm just comparing his PC to mine and really the only notable difference is that my CPU hyperthreads while his does not. It's all very frustrating, been here about a millions times with FFmpeg though and I eventually figure it out.
– Nimble
Dec 3 at 6:09
|
show 10 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Been setting up a recording build for a friend to resemble mine, but I can't seem to get things to work in real-time despite sufficient (as far as I can tell) hardware.
System specs: 8600K, GTX 1050ti, 16Gb RAM, 1tb 860 EVO
Test command (updated for simplicity):
ffmpeg -y -hide_banner -thread_queue_size 9999 -f dshow -rtbufsize 2147.48M -video_size 1920x1080 -framerate 60 `
-i video="@device_pnp_\?usb#vid_07ca&pid_0570&mi_00#7&3886ab1a&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}global" `
-thread_queue_size 9999 -f dshow -rtbufsize 2147.48M -video_size 1920x1080 -framerate 60 `
-i video="@device_pnp_\?usb#vid_07ca&pid_0570&mi_00#7&24df76f&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}global" `
-map 0 -c:v h264_nvenc -r 60 -preset: llhp -pix_fmt yuv420p -b:v 1M -minrate 1M -maxrate 1M -bufsize 1M `
C:UsersJordanVideosFFmpegLeftLeft.ts `
-map 1 -c:v h264_nvenc -r 60 -preset: llhp -pix_fmt yuv420p -b:v 1M -minrate 1M -maxrate 1M -bufsize 1M `
C:UsersJordanVideosFFmpegRightRight.ts
The goal of this command is to record 2 seperate syncronized outputs. However, for one reason or another this command is not transcoding video in real-time, which is a big issue when you're trying to record, not simply convert a file. When I omit one of the two outputs or if I halve the resolution of each input / output everything works in real-time. This would make me believe there is a bottleneck in the system somewhere but when monitoring everything in task manager nothing is even close to capping out (GPU encoder, cpu, ram, and SSD below 30% usage).
Furthermore when I try recording both streams in one 4K60 video via OBS things work perfectly fine, as in real-time. So I don't understand how transcoding two 1080p60 streams in FFmpeg would be anymore intensive than one 4K60 stream in OBS...
I have since swapped the 1050ti out for a GTX 1080 with no difference in performance. This would lead me to believe the CPU is at fault. It looks like FFmpeg is really only hitting 1-2 threads... any way to force it to use more?
-threads doesn't seem to have any affect regardless of where I inject it into the command. What's really weird is I have have a very similar command but I'm doing two 4K60 streams as opposed two 1080p60 streams with a GTX 1080 and 6800K... As far as I can tell the 8600K has higher per thread performance in comparison to the 6800K so I'm not sure how I'm able to get away with so much more.
Any insight would be higly appreciated.
audio video ffmpeg encoding decoding
Been setting up a recording build for a friend to resemble mine, but I can't seem to get things to work in real-time despite sufficient (as far as I can tell) hardware.
System specs: 8600K, GTX 1050ti, 16Gb RAM, 1tb 860 EVO
Test command (updated for simplicity):
ffmpeg -y -hide_banner -thread_queue_size 9999 -f dshow -rtbufsize 2147.48M -video_size 1920x1080 -framerate 60 `
-i video="@device_pnp_\?usb#vid_07ca&pid_0570&mi_00#7&3886ab1a&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}global" `
-thread_queue_size 9999 -f dshow -rtbufsize 2147.48M -video_size 1920x1080 -framerate 60 `
-i video="@device_pnp_\?usb#vid_07ca&pid_0570&mi_00#7&24df76f&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}global" `
-map 0 -c:v h264_nvenc -r 60 -preset: llhp -pix_fmt yuv420p -b:v 1M -minrate 1M -maxrate 1M -bufsize 1M `
C:UsersJordanVideosFFmpegLeftLeft.ts `
-map 1 -c:v h264_nvenc -r 60 -preset: llhp -pix_fmt yuv420p -b:v 1M -minrate 1M -maxrate 1M -bufsize 1M `
C:UsersJordanVideosFFmpegRightRight.ts
The goal of this command is to record 2 seperate syncronized outputs. However, for one reason or another this command is not transcoding video in real-time, which is a big issue when you're trying to record, not simply convert a file. When I omit one of the two outputs or if I halve the resolution of each input / output everything works in real-time. This would make me believe there is a bottleneck in the system somewhere but when monitoring everything in task manager nothing is even close to capping out (GPU encoder, cpu, ram, and SSD below 30% usage).
Furthermore when I try recording both streams in one 4K60 video via OBS things work perfectly fine, as in real-time. So I don't understand how transcoding two 1080p60 streams in FFmpeg would be anymore intensive than one 4K60 stream in OBS...
I have since swapped the 1050ti out for a GTX 1080 with no difference in performance. This would lead me to believe the CPU is at fault. It looks like FFmpeg is really only hitting 1-2 threads... any way to force it to use more?
-threads doesn't seem to have any affect regardless of where I inject it into the command. What's really weird is I have have a very similar command but I'm doing two 4K60 streams as opposed two 1080p60 streams with a GTX 1080 and 6800K... As far as I can tell the 8600K has higher per thread performance in comparison to the 6800K so I'm not sure how I'm able to get away with so much more.
Any insight would be higly appreciated.
audio video ffmpeg encoding decoding
audio video ffmpeg encoding decoding
edited Dec 3 at 22:35
asked Dec 2 at 19:28
Nimble
12
12
It's not using more threads because you are compressing withnvenc
.
– chew socks
Dec 2 at 21:42
Most of that CPU is probably audio, actually. You could try remove all the audio related flags and putting in-an
in their place to test this.
– chew socks
Dec 2 at 21:45
Thank you for the comment, I tried removing all audio and put -an in place. Things are still starting far below real-time and then creeping up, looks like it would take about 40-50 minutes... What I don't understand is if I use the same command on my PC (change the capture cards) everything just works right from the get go and it has a theoretically inferior CPU. Could it be something to do with this CPU lacking hyper threading? nvenc is encoding but the CPU is still decoding right? The GPUs encoder is barely being touched.
– Nimble
Dec 3 at 3:12
Your inputs are dshow, so there's not much "decoding" to speak of, mostly memory I/O ops.
– Gyan
Dec 3 at 5:44
Wouldn't that infer that the CPU isn't needed much in the process? The reason I suggested he get an 8600K over the 8700K is I assumed the GPU was doing all the heavy lifting. I'm just comparing his PC to mine and really the only notable difference is that my CPU hyperthreads while his does not. It's all very frustrating, been here about a millions times with FFmpeg though and I eventually figure it out.
– Nimble
Dec 3 at 6:09
|
show 10 more comments
It's not using more threads because you are compressing withnvenc
.
– chew socks
Dec 2 at 21:42
Most of that CPU is probably audio, actually. You could try remove all the audio related flags and putting in-an
in their place to test this.
– chew socks
Dec 2 at 21:45
Thank you for the comment, I tried removing all audio and put -an in place. Things are still starting far below real-time and then creeping up, looks like it would take about 40-50 minutes... What I don't understand is if I use the same command on my PC (change the capture cards) everything just works right from the get go and it has a theoretically inferior CPU. Could it be something to do with this CPU lacking hyper threading? nvenc is encoding but the CPU is still decoding right? The GPUs encoder is barely being touched.
– Nimble
Dec 3 at 3:12
Your inputs are dshow, so there's not much "decoding" to speak of, mostly memory I/O ops.
– Gyan
Dec 3 at 5:44
Wouldn't that infer that the CPU isn't needed much in the process? The reason I suggested he get an 8600K over the 8700K is I assumed the GPU was doing all the heavy lifting. I'm just comparing his PC to mine and really the only notable difference is that my CPU hyperthreads while his does not. It's all very frustrating, been here about a millions times with FFmpeg though and I eventually figure it out.
– Nimble
Dec 3 at 6:09
It's not using more threads because you are compressing with
nvenc
.– chew socks
Dec 2 at 21:42
It's not using more threads because you are compressing with
nvenc
.– chew socks
Dec 2 at 21:42
Most of that CPU is probably audio, actually. You could try remove all the audio related flags and putting in
-an
in their place to test this.– chew socks
Dec 2 at 21:45
Most of that CPU is probably audio, actually. You could try remove all the audio related flags and putting in
-an
in their place to test this.– chew socks
Dec 2 at 21:45
Thank you for the comment, I tried removing all audio and put -an in place. Things are still starting far below real-time and then creeping up, looks like it would take about 40-50 minutes... What I don't understand is if I use the same command on my PC (change the capture cards) everything just works right from the get go and it has a theoretically inferior CPU. Could it be something to do with this CPU lacking hyper threading? nvenc is encoding but the CPU is still decoding right? The GPUs encoder is barely being touched.
– Nimble
Dec 3 at 3:12
Thank you for the comment, I tried removing all audio and put -an in place. Things are still starting far below real-time and then creeping up, looks like it would take about 40-50 minutes... What I don't understand is if I use the same command on my PC (change the capture cards) everything just works right from the get go and it has a theoretically inferior CPU. Could it be something to do with this CPU lacking hyper threading? nvenc is encoding but the CPU is still decoding right? The GPUs encoder is barely being touched.
– Nimble
Dec 3 at 3:12
Your inputs are dshow, so there's not much "decoding" to speak of, mostly memory I/O ops.
– Gyan
Dec 3 at 5:44
Your inputs are dshow, so there's not much "decoding" to speak of, mostly memory I/O ops.
– Gyan
Dec 3 at 5:44
Wouldn't that infer that the CPU isn't needed much in the process? The reason I suggested he get an 8600K over the 8700K is I assumed the GPU was doing all the heavy lifting. I'm just comparing his PC to mine and really the only notable difference is that my CPU hyperthreads while his does not. It's all very frustrating, been here about a millions times with FFmpeg though and I eventually figure it out.
– Nimble
Dec 3 at 6:09
Wouldn't that infer that the CPU isn't needed much in the process? The reason I suggested he get an 8600K over the 8700K is I assumed the GPU was doing all the heavy lifting. I'm just comparing his PC to mine and really the only notable difference is that my CPU hyperthreads while his does not. It's all very frustrating, been here about a millions times with FFmpeg though and I eventually figure it out.
– Nimble
Dec 3 at 6:09
|
show 10 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
The problem was with the capture cards, I pulled one from his system and put it in mine and was able to replicate the issue. This is not reproducible with any of my other capture cards and I have 4 of them.
The issue seems to be caused by Avermedia's stream engine bloatware stored on the card itself. The card actually shows as two devices, one without stream engine in the name and one with, if you select the one with the issues are alleviated but still present. Anyways seeing as I can confirm the issue is non-existent on Elgato's HD60 Pro we've placed an order for 2 of those.
In retrospect bloatware / unconventional firmware easily explains the extremely hard to diagnose issues. Luckily we purchased the Avermedia Live Gamer HD 2s on deal and can resell them for a full refund, good riddance.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
The problem was with the capture cards, I pulled one from his system and put it in mine and was able to replicate the issue. This is not reproducible with any of my other capture cards and I have 4 of them.
The issue seems to be caused by Avermedia's stream engine bloatware stored on the card itself. The card actually shows as two devices, one without stream engine in the name and one with, if you select the one with the issues are alleviated but still present. Anyways seeing as I can confirm the issue is non-existent on Elgato's HD60 Pro we've placed an order for 2 of those.
In retrospect bloatware / unconventional firmware easily explains the extremely hard to diagnose issues. Luckily we purchased the Avermedia Live Gamer HD 2s on deal and can resell them for a full refund, good riddance.
add a comment |
up vote
0
down vote
accepted
The problem was with the capture cards, I pulled one from his system and put it in mine and was able to replicate the issue. This is not reproducible with any of my other capture cards and I have 4 of them.
The issue seems to be caused by Avermedia's stream engine bloatware stored on the card itself. The card actually shows as two devices, one without stream engine in the name and one with, if you select the one with the issues are alleviated but still present. Anyways seeing as I can confirm the issue is non-existent on Elgato's HD60 Pro we've placed an order for 2 of those.
In retrospect bloatware / unconventional firmware easily explains the extremely hard to diagnose issues. Luckily we purchased the Avermedia Live Gamer HD 2s on deal and can resell them for a full refund, good riddance.
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
The problem was with the capture cards, I pulled one from his system and put it in mine and was able to replicate the issue. This is not reproducible with any of my other capture cards and I have 4 of them.
The issue seems to be caused by Avermedia's stream engine bloatware stored on the card itself. The card actually shows as two devices, one without stream engine in the name and one with, if you select the one with the issues are alleviated but still present. Anyways seeing as I can confirm the issue is non-existent on Elgato's HD60 Pro we've placed an order for 2 of those.
In retrospect bloatware / unconventional firmware easily explains the extremely hard to diagnose issues. Luckily we purchased the Avermedia Live Gamer HD 2s on deal and can resell them for a full refund, good riddance.
The problem was with the capture cards, I pulled one from his system and put it in mine and was able to replicate the issue. This is not reproducible with any of my other capture cards and I have 4 of them.
The issue seems to be caused by Avermedia's stream engine bloatware stored on the card itself. The card actually shows as two devices, one without stream engine in the name and one with, if you select the one with the issues are alleviated but still present. Anyways seeing as I can confirm the issue is non-existent on Elgato's HD60 Pro we've placed an order for 2 of those.
In retrospect bloatware / unconventional firmware easily explains the extremely hard to diagnose issues. Luckily we purchased the Avermedia Live Gamer HD 2s on deal and can resell them for a full refund, good riddance.
edited Dec 4 at 17:06
answered Dec 4 at 6:41
Nimble
12
12
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1380250%2fffmpeg-not-transcoding-in-real-time%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It's not using more threads because you are compressing with
nvenc
.– chew socks
Dec 2 at 21:42
Most of that CPU is probably audio, actually. You could try remove all the audio related flags and putting in
-an
in their place to test this.– chew socks
Dec 2 at 21:45
Thank you for the comment, I tried removing all audio and put -an in place. Things are still starting far below real-time and then creeping up, looks like it would take about 40-50 minutes... What I don't understand is if I use the same command on my PC (change the capture cards) everything just works right from the get go and it has a theoretically inferior CPU. Could it be something to do with this CPU lacking hyper threading? nvenc is encoding but the CPU is still decoding right? The GPUs encoder is barely being touched.
– Nimble
Dec 3 at 3:12
Your inputs are dshow, so there's not much "decoding" to speak of, mostly memory I/O ops.
– Gyan
Dec 3 at 5:44
Wouldn't that infer that the CPU isn't needed much in the process? The reason I suggested he get an 8600K over the 8700K is I assumed the GPU was doing all the heavy lifting. I'm just comparing his PC to mine and really the only notable difference is that my CPU hyperthreads while his does not. It's all very frustrating, been here about a millions times with FFmpeg though and I eventually figure it out.
– Nimble
Dec 3 at 6:09