Skip to content
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

Does anybody try capture 4K videos by bmdtools + ffmpeg? #27

Closed
snowater opened this issue Nov 13, 2013 · 19 comments
Closed

Does anybody try capture 4K videos by bmdtools + ffmpeg? #27

snowater opened this issue Nov 13, 2013 · 19 comments

Comments

@snowater
Copy link

I have a Decklink 4K Extreme, I use it capture 4K videos and at the same time encode it by ffmpeg, I founed this process can't reach 25 fps. My ffmpeg call libx264 to encode 4K videos, it will reach 85fps on my computer. So I wonder why i Capture by bmdtool and encode by ffmpeg only 13fps.
My command is :
bmdcapture -m 25 -F nut -f pipe:1 | ffmpeg -i - -vcodec libx264 -profile:v high422 -r 25 -f mpegts udp://239.1.1.1:1234

Thanks for your advice
xueshui

@lu-zero
Copy link
Owner

lu-zero commented Nov 13, 2013

ffmpeg is not supported. You might try avconv + bmdtools or with libbmd
built-in capture.
On Nov 13, 2013 2:12 PM, "xueshui" notifications@github.com wrote:

I have a Decklink 4K Extreme, I use it capture 4K videos and at the same
time encode it by ffmpeg, I founed this process can't reach 25 fps. My
ffmpeg call libx264 to encode 4K videos, it will reach 85fps on my
computer. So I wonder why i Capture by bmdtool and encode by ffmpeg only
13fps.
My command is :
bmdcapture -m 25 -F nut -f pipe:1 | ffmpeg -i - -vcodec libx264 -profile:v
high422 -r 25 -f mpegts udp://239.1.1.1:1234

Thanks for your advice
xueshui


Reply to this email directly or view it on GitHubhttps://github.com//issues/27
.

@snowater
Copy link
Author

Firstly, i found it is ok when the video size is 1080P.
Secondly, I think I can't capture and encode the 4k video in real-time just because the pipe speed is not enough!
Each time, the system stop because the queue is full and then stop capture. I increased the buffer size, but the system will stop still, just it will run more time before stoping. So i think the problem is the pipe speed is not enough, the capture video data can't send to the ffmpeg through the pipe in real-time.
Do you konw how to solve it ?
Thank you in advance ! Thank you !

@lu-zero
Copy link
Owner

lu-zero commented Nov 20, 2013

As I wrote before you would need the avconv+libbmd integration, I'm going
to update it this days btw.

@snowater
Copy link
Author

Ok, I will try the avconv + bmdtools and then I will tell you the result. Thank you !

@lu-zero
Copy link
Owner

lu-zero commented Nov 21, 2013

libbmd =) https://github.com/lu-zero/libbmd/blob/master/README.md

I hadn't time to update it today so it might not build, ping me on irc in
case you can't pick the matching commit.

On Thu, Nov 21, 2013 at 2:53 AM, xueshui notifications@github.com wrote:

Ok, I will try the avconv + bmdtools and then I will tell you the result.
Thank you !


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-28951611
.

@snowater
Copy link
Author

Excuse me, I have some problems when i build the libbmd .
My process is as follows:

  1. aclocal : create aclocal.m4 file
  2. autoconf : create configure file
  3. autoheader : create config.h.in
  4. automake --add-missing
    then it appears error as follows:
    ./configure: line 2893: syntax error near unexpected token TOOLS,' ./configure: line 2893:PKG_HAVE_WITH_MODULES(TOOLS, libavformat libavcodec libswscale)'

I have installed libav on my computer.
How can I solve this problem?

@lu-zero
Copy link
Owner

lu-zero commented Nov 21, 2013

autoreconf -i is what I use, that macro should be in the m4/pkg.m4 (I'm
actively using and promoting pkgconf over pkg-config)

On Thu, Nov 21, 2013 at 10:16 AM, xueshui notifications@github.com wrote:

Excuse me, I have some problems when i build the libbmd .
My process is as follows:

  1. aclocal : create aclocal.m4 file
  2. autoconf : create configure file
  3. autoheader : create config.h.in
  4. automake --add-missing

then it appears error as follows:
./configure: line 2893: syntax error near unexpected token TOOLS,'
./configure: line 2893:PKG_HAVE_WITH_MODULES(TOOLS, libavformat
libavcodec libswscale)'

I have installed libav on my computer.


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-28967863
.

@snowater
Copy link
Author

Hi, I have compiled the libbmd and libav, and my command is
./avconv -analyzeduration 0 -f bmd -video_mode 23 -video_connection 4 -video_format 0 -i default -vcodec libx264 -preset ultrafast -profile:V high422 -r 24 test.mkv
But the program has no response!
Through debuged the libav, I found the function has_codec_parameters is executed in a loop, and the founction is called by the function avformat_find_stream_info. So it didn't call the libbmd.
I suppose the program may not parse the command correctly.
And I found the command didn't contain any device information, does it know which device should be used?
Thank you!

@snowater
Copy link
Author

snowater commented Dec 1, 2013

Hello, I think the program may have some problems with the input.
The main function calls avconv_parse_options function, and the avconv_parse_options function calls open_input_file function.
The open_input_file function must reads a video stream to find the information of the stream, and then decide what to do. But at that time, there is no Decklink hardware be selected, therefore there is no stream be read in the function. So it will executed the for( ; ; ) in a loop. Certainly, I can't get the result which i wanted.
Perhaps the problem lies here. But how should I do to deal with the problem?

@lu-zero
Copy link
Owner

lu-zero commented Dec 1, 2013

That code (using an older libbmd) is surprisingly used in production in
about 1k devices, so I'm quite sure it works =)

On Sun, Dec 1, 2013 at 1:03 PM, xueshui notifications@github.com wrote:

Hello, I think the program may have some problems with the input.
The main function calls avconv_parse_options function, and the
avconv_parse_options function calls open_input_file function.
The open_input_file function must reads a video stream to find the
information of the stream, and then decide what to do. But at that time,
there is no Decklink hardware be selected, therefore there is no stream be
read in the function. So it will executed the for( ; ; ) in a loop.
Certainly, I can't get the result which i wanted.
Perhaps the problem lies here. But how should I do to deal with the
problem?


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-29572365
.

@Badbits
Copy link

Badbits commented Dec 18, 2013

You're trying to encode 4k video in REALTIME with h264 and a preset set as high, what cpu are you using? I think you may have much better results with ultrafast. As for libbmd, update should have better results.

@lu-zero
Copy link
Owner

lu-zero commented Feb 27, 2014

Probably I should start providing direct encoding support in bmdtools in a bit.

@rayvbr
Copy link

rayvbr commented Mar 18, 2014

Xueshui, did you ever manage to solve the issue with the low-fps output of the bmdtools when capturing 4K? I'm having the same issues...

@lu-zero
Copy link
Owner

lu-zero commented Mar 18, 2014

@rayvbr could you arrange so I can have a direct look at the issue?

On Tue, Mar 18, 2014 at 11:57 AM, rayvbr notifications@github.com wrote:

Xueshui, did you ever manage to solve the issue with the low-fps output of
the bmdtools when capturing 4K? I'm having the same issues...

Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-37919885
.

@rayvbr
Copy link

rayvbr commented Mar 19, 2014

@lu-zero thanks for the offer. Fortunately, I've already solved the problem using a work-around. When I tried to encode the output from bmdcapture in MJPEG (via libav), I got a fps of about 20 (with 24fps content). It doesn't seem to be a CPU or memory issue, since the results are the same on different machines and the CPU is not heavily loaded. However, when I encode it with x264 (with preset ultrafast) I can get to 24fps without any problems (and even to 30fps).

@lu-zero
Copy link
Owner

lu-zero commented Mar 19, 2014

If you could provide me some 4k content I'd like to check what's going
wrong with mjpeg (if you open a bug on bugzilla.libav.org would be great as
well).

On Wed, Mar 19, 2014 at 4:50 PM, rayvbr notifications@github.com wrote:

@lu-zero https://github.com/lu-zero thanks for the offer. Fortunately,
I've already solved the problem using a work-around. When I tried to encode
the output from bmdcapture in MJPEG (via libav), I got a fps of about 20
(with 24fps content). It doesn't seem to be a CPU or memory issue, since
the results are the same on different machines and the CPU is not heavily
loaded. However, when I encode it with x264 (with preset ultrafast) I can
get to 24fps without any problems (and even to 30fps).

Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-38067373
.

@rayvbr
Copy link

rayvbr commented Mar 19, 2014

How would you like me to provide the content? I'm currently using bmdcapture in combination with the Decklink 4K Extreme.

@lu-zero
Copy link
Owner

lu-zero commented Mar 19, 2014

h264 encoded is fine, having it in raw would be great as well. If you have
copy.com I can get it from there.

On Wed, Mar 19, 2014 at 5:33 PM, rayvbr notifications@github.com wrote:

How would you like me to provide the content? I'm currently using
bmdcapture in combination with the Decklink 4K Extreme.

Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-38073641
.

@snowater
Copy link
Author

@rayvbr Hi, I'm glad to hear you have solved this problems, could you list your command of your system. Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants