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

Video IO Example #119

Closed
infinityplusb opened this issue Aug 2, 2017 · 12 comments
Closed

Video IO Example #119

infinityplusb opened this issue Aug 2, 2017 · 12 comments

Comments

@infinityplusb
Copy link

What other things are required to get the example at:
dcv/examples/video/source/app.d
working?

Creating a new dub project and adding

"dependencies": {
		"dcv": "~>0.2.1"
	},

to dub.json doesn't seem to be sufficient.
Could someone take the time to walk me through what should be the "other" assumed steps please.

@ljubobratovicrelja
Copy link
Member

Just adding dcv as dependency (as you have already done) should be enough. Although FFmpeg libs (libav*) should be installed on you machine. Could you paste here the output that you're getting when trying to build it?

Important detail about the video IO module - which OS are you running?

Also, the example has it's own dub configuration (dub.json), so you could just run it with:

cd dcv/examples/video
dub -- [args]

By [args] I mean arguments that are described in the readme of the example. That should be it.

@infinityplusb
Copy link
Author

At the moment, I'm trying it on Ubuntu 16.04, dmd v2.074.0, dub version 1.3.0.
My issue is compiling (not at the usage level yet).

I did initially have an issue linking to FFMPEG.

Linking...
/usr/bin/ld: cannot find -lglfw
/usr/bin/ld: cannot find -lavdevice
/usr/bin/ld: cannot find -lavfilter
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
dmd failed with exit code 1.

I git cloned it and compiled and that seems to have fixed those messages.

https://github.com/FFmpeg/FFmpeg.git ffmpeg
cd ffmpeg
./configure
make
sudo make install

My issue is now limited to linking to glfw

...
Linking...
/usr/bin/ld: cannot find -lglfw
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
dmd failed with exit code 1.

I tried the same thing, downloaded the source files, and built them.
They are in /usr/local/include/GLFW but the linker doesn't recognise them.
I even tried adding in the location of the into dub.json

...
"lflags": [
	"-L/usr/local/include/GLFW"
]

but to no avail.
How did you configure glfw?

@ljubobratovicrelja
Copy link
Member

Glad you got FFmpeg working, that was the hard part. GLFW should be easier.

/usr/local/include/GLFW

That should be your include directory. What you're looking for is the libglfw.so (or libglfw.a) file (library). After make install when building glfw3 from source, lib file should be present in /usr/local/lib (given that your include directory is in /usr/local/include). Anyhow, what is most probably the issue is that the lib file is not named libglfw.so, but rather libglfw.so.3.x or whatever. Just find your lib file (I believe you can use find /usr/local/lib -name "libglfw*" command in terminal), and make a symlink to it, named "libglfw.so" (or .a) in /usr/local/lib path so that the linker can auto-find it (sudo ln -s /usr/local/lib/libglfw.so.3.x /usr/local/lib/libglfw.so, replacing that .so.3.x with proper extension).

Sorry if I'm stating bunch of obvious stuff, I'm just trying to help. :)

And btw

How did you configure glfw?

Default configuration should do. The only thing you could set is if you'd like static or shared linking (.a or .so). But that's totally up to you, and dcv should work either way.

@infinityplusb
Copy link
Author

Apparently I should just use

sudo apt install libglfw3-dev

So simple! However, I now get other errors, but related to d so that's an improvement!

Linking...
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(input_26b_47c.o): In function `_D3dcv2io5video5input11InputStream9frameSizeMxFNdZi':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream9frameSizeMxFNdZi+0x4a): undefined reference to `avpicture_get_size'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(input_26b_47c.o): In function `_D3dcv2io5video5input11InputStream10dumpFormatMxFZv':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream10dumpFormatMxFZv+0x81): undefined reference to `av_dump_format'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(common_25d_37c.o): In function `_D3dcv2io5video6common9AVStarter6__ctorMFZC3dcv2io5video6common9AVStarter':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/common.d:(.text._D3dcv2io5video6common9AVStarter6__ctorMFZC3dcv2io5video6common9AVStarter+0xd): undefined reference to `av_register_all'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/common.d:(.text._D3dcv2io5video6common9AVStarter6__ctorMFZC3dcv2io5video6common9AVStarter+0x17): undefined referenceto `avcodec_register_all'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/common.d:(.text._D3dcv2io5video6common9AVStarter6__ctorMFZC3dcv2io5video6common9AVStarter+0x1c): undefined referenceto `avfilter_register_all'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/common.d:(.text._D3dcv2io5video6common9AVStarter6__ctorMFZC3dcv2io5video6common9AVStarter+0x21): undefined referenceto `avdevice_register_all'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(output_26d_4fd.o): In function `_D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb+0x3cb): undefined reference to `sws_getContext'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb+0x438): undefined reference to `avformat_write_header'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(output_26d_4fd.o): In function `_D3dcv2io5video6output12OutputStream5closeMFZv':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream5closeMFZv+0x16): undefined reference to `av_write_trailer'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream5closeMFZv+0x77): undefined reference to `sws_freeContext'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(output_26d_4fd.o): In function `_D3dcv2io5video6output12OutputStream10writeFrameMFC3dcv4core5image5ImageZb':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream10writeFrameMFC3dcv4core5image5ImageZb+0x183): undefined reference to `sws_scale'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream10writeFrameMFC3dcv4core5image5ImageZb+0x296): undefined reference to `av_interleaved_write_frame'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(output_26d_4fd.o): In function `_D3dcv2io5video6output12OutputStream12allocPictureMFE6ffmpeg9libavutil6pixfmt13AVPixelFormatiiZPS6ffmpeg9libavutil5frame7AVFrame':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream12allocPictureMFE6ffmpeg9libavutil6pixfmt13AVPixelFormatiiZPS6ffmpeg9libavutil5frame7AVFrame+0x4f): undefined reference to `avpicture_get_size'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream12allocPictureMFE6ffmpeg9libavutil6pixfmt13AVPixelFormatiiZPS6ffmpeg9libavutil5frame7AVFrame+0x7a): undefined reference to `avpicture_fill'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
dmd failed with exit code 1.

@ljubobratovicrelja
Copy link
Member

sudo apt install libglfw3-dev

Ah, yes... you could have just done that. :) Ignore my previous answer.

Which FFmpeg did you build? DCV (or rather ffmpegd) should work with version 2.x. I'm currently using 2.8.x on my system. If you've just git cloned the FFmpeg repo, you've most probably built 3.x version (master). You should checkout for e.g. n2.8.12 in your git clone and then rebuild it.

Also, if you still got the source building directories on your hard drive, just call sudo make uninstall to remove 3.x version, before building 2.x.

@infinityplusb
Copy link
Author

So, using

sudo apt install libglfw3-dev

I had a .a file in /usr/local/lib so I just created a symlink to have a .so

sudo ln -s /usr/local/lib/libglfw3.a /usr/local/lib/libglfw.so

Now my build just looks like

Linking...
/usr/bin/ld: /usr/local/lib/libglfw.so(x11_window.c.o): undefined reference to symbol 'XConvertSelection'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
dmd failed with exit code 1.

It's probably the version of ffmpeg that is the issue. I got the latest version (3.3 I think) so I'll have a go at fixing that.

Sorry if I'm stating bunch of obvious stuff, I'm just trying to help. :)

No need to apologise. It's usually something basic/stupid that I'm doing wrong!

@ljubobratovicrelja
Copy link
Member

sudo ln -s /usr/local/lib/libglfw3.a /usr/local/lib/libglfw.so

No, you shouldn't have done that. *.a is the extension for static libraries, while *.so is for shared. Theres a fundamental difference between the two, and you cannot just change the extension (I never have done that before, so I'm unsure what is the result). You should probably get some info on the topic - quick google gives me something worth taking a look.

Anyhow, just remove the symlink you've created (/usr/local/lib/linglfw.so), and you should be good from the glfw side.

It's probably the version of ffmpeg that is the issue. I got the latest version (3.3 I think) so I'll have a go at fixing that.

Yes, you should definitely try that. I hope that will do it.

@infinityplusb
Copy link
Author

No, you shouldn't have done that. *.a is the extension for static libraries, while *.so is for shared.
Whoops! Undone!

Ok with ffmpeg 2.8.12, and rebuilding glfw from source I now get

Linking...
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(input_26b_47c.o): In function `_D3dcv2io5video5input11InputStream9frameSizeMxFNdZi':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream9frameSizeMxFNdZi+0x4a): undefined reference to `avpicture_get_size'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(input_26b_47c.o): In function `_D3dcv2io5video5input11InputStream10dumpFormatMxFZv':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream10dumpFormatMxFZv+0x81): undefined reference to `av_dump_format'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(input_26b_47c.o): In function `_D3dcv2io5video5input11InputStream4openMFxAyaE3dcv2io5video5input15InputStreamTypeZb':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream4openMFxAyaE3dcv2io5video5input15InputStreamTypeZb+0x6b): undefinedreference to `av_find_input_format'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(input_26b_47c.o): In function `_D3dcv2io5video5input11InputStream5closeMFZv':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream5closeMFZv+0x25): undefined reference to `avcodec_close'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream5closeMFZv+0x36): undefined reference to `avformat_close_input'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(input_26b_47c.o): In function `_D3dcv2io5video5input11InputStream9seekFrameMFmZv':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream9seekFrameMFmZv+0x207): undefined reference to `av_seek_frame'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(input_26b_47c.o): In function `_D3dcv2io5video5input11InputStream8seekTimeMFdZv':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream8seekTimeMFdZv+0xff): undefined reference to `av_seek_frame'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(input_26b_47c.o): In function `_D3dcv2io5video5input11InputStream13readFrameImplMFKC3dcv4core5image5ImageZb':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream13readFrameImplMFKC3dcv4core5image5ImageZb+0x3c): undefined reference to `av_init_packet'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream13readFrameImplMFKC3dcv4core5image5ImageZb+0x41): undefined reference to `av_frame_alloc'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream13readFrameImplMFKC3dcv4core5image5ImageZb+0xea): undefined reference to `av_read_frame'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream13readFrameImplMFKC3dcv4core5image5ImageZb+0x138): undefined reference to `avcodec_decode_video2'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream13readFrameImplMFKC3dcv4core5image5ImageZb+0x2b9): undefined reference to `av_frame_free'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream13readFrameImplMFKC3dcv4core5image5ImageZb+0x2c5): undefined reference to `av_free_packet'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(input_26b_47c.o): In function `_D3dcv2io5video5input11InputStream19openInputStreamImplMFPS6ffmpeg11libavformat8avformat13AVInputFormatxAyaZb':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream19openInputStreamImplMFPS6ffmpeg11libavformat8avformat13AVInputFormatxAyaZb+0x40): undefined reference to `avformat_open_input'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream19openInputStreamImplMFPS6ffmpeg11libavformat8avformat13AVInputFormatxAyaZb+0x53): undefined reference to `avformat_find_stream_info'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(input_26b_47c.o): In function `_D3dcv2io5video5input11InputStream16openCodecContextMFPiPS6ffmpeg11libavformat8avformat15AVFormatContextE6ffmpeg9libavutil6avutil11AVMediaTypeZi':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream16openCodecContextMFPiPS6ffmpeg11libavformat8avformat15AVFormatContextE6ffmpeg9libavutil6avutil11AVMediaTypeZi+0x2d): undefined reference to `av_find_best_stream'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream16openCodecContextMFPiPS6ffmpeg11libavformat8avformat15AVFormatContextE6ffmpeg9libavutil6avutil11AVMediaTypeZi+0x58): undefined reference to `avcodec_find_decoder'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/input.d:(.text._D3dcv2io5video5input11InputStream16openCodecContextMFPiPS6ffmpeg11libavformat8avformat15AVFormatContextE6ffmpeg9libavutil6avutil11AVMediaTypeZi+0x80): undefined reference to `avcodec_open2'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(common_25d_37c.o): In function `_D3dcv2io5video6common9AVStarter6__ctorMFZC3dcv2io5video6common9AVStarter':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/common.d:(.text._D3dcv2io5video6common9AVStarter6__ctorMFZC3dcv2io5video6common9AVStarter+0xd): undefined reference to `av_register_all'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/common.d:(.text._D3dcv2io5video6common9AVStarter6__ctorMFZC3dcv2io5video6common9AVStarter+0x12): undefined referenceto `avformat_network_init'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/common.d:(.text._D3dcv2io5video6common9AVStarter6__ctorMFZC3dcv2io5video6common9AVStarter+0x17): undefined referenceto `avcodec_register_all'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/common.d:(.text._D3dcv2io5video6common9AVStarter6__ctorMFZC3dcv2io5video6common9AVStarter+0x1c): undefined referenceto `avfilter_register_all'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/common.d:(.text._D3dcv2io5video6common9AVStarter6__ctorMFZC3dcv2io5video6common9AVStarter+0x21): undefined referenceto `avdevice_register_all'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(output_26d_4fd.o): In function `_D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb+0xf2): undefined reference to `av_guess_format'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb+0x104): undefined reference to `av_guess_format'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb+0x115): undefined reference to `avformat_alloc_context'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb+0x169): undefined reference to `avcodec_find_encoder'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb+0x17a): undefined reference to `avcodec_find_encoder_by_name'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb+0x191): undefined reference to `avformat_new_stream'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb+0x1aa): undefined reference to `avcodec_alloc_context3'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb+0x2a3): undefined reference to `avcodec_open2'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb+0x3cb): undefined reference to `sws_getContext'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream4openMFxAyaxS3dcv2io5video6output16OutputDefinitionZb+0x438): undefined reference to `avformat_write_header'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(output_26d_4fd.o): In function `_D3dcv2io5video6output12OutputStream5closeMFZv':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream5closeMFZv+0x16): undefined reference to `av_write_trailer'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream5closeMFZv+0x3d): undefined reference to `avcodec_close'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream5closeMFZv+0x5e): undefined reference to `av_frame_free'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream5closeMFZv+0x77): undefined reference to `sws_freeContext'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(output_26d_4fd.o): In function `_D3dcv2io5video6output12OutputStream10writeFrameMFC3dcv4core5image5ImageZb':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream10writeFrameMFC3dcv4core5image5ImageZb+0xed): undefined reference to `av_init_packet'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream10writeFrameMFC3dcv4core5image5ImageZb+0x183): undefined reference to `sws_scale'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream10writeFrameMFC3dcv4core5image5ImageZb+0x1dd): undefined reference to `avcodec_encode_video2'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream10writeFrameMFC3dcv4core5image5ImageZb+0x296): undefined reference to `av_interleaved_write_frame'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream10writeFrameMFC3dcv4core5image5ImageZb+0x2ce): undefined reference to `av_packet_unref'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream10writeFrameMFC3dcv4core5image5ImageZb+0x2d7): undefined reference to `av_free_packet'
../../../../.dub/packages/dcv-0.2.1/dcv/.dub/build/library-release-nobounds-linux.posix-x86_64-dmd_2074-C01393F9FE8486DC2DCDCE9FDED0A091/libdcv_io.a(output_26d_4fd.o): In function `_D3dcv2io5video6output12OutputStream12allocPictureMFE6ffmpeg9libavutil6pixfmt13AVPixelFormatiiZPS6ffmpeg9libavutil5frame7AVFrame':
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream12allocPictureMFE6ffmpeg9libavutil6pixfmt13AVPixelFormatiiZPS6ffmpeg9libavutil5frame7AVFrame+0x26): undefined reference to `av_frame_alloc'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream12allocPictureMFE6ffmpeg9libavutil6pixfmt13AVPixelFormatiiZPS6ffmpeg9libavutil5frame7AVFrame+0x4f): undefined reference to `avpicture_get_size'
../../../../.dub/packages/dcv-0.2.1/dcv/source/dcv/io/video/output.d:(.text._D3dcv2io5video6output12OutputStream12allocPictureMFE6ffmpeg9libavutil6pixfmt13AVPixelFormatiiZPS6ffmpeg9libavutil5frame7AVFrame+0x7a): undefined reference to `avpicture_fill'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
dmd failed with exit code 1.

@carun
Copy link
Contributor

carun commented Dec 2, 2017

I encountered the similar issue on Ubuntu 17.10 with stock FFmpeg and OpenGL. All I had to do was this:

sudo apt install libglfw3-dev libavcodec-dev libavformat-dev libavdevice-dev libavfilter-dev libavutil-dev libswscale-dev

@carun
Copy link
Contributor

carun commented Jan 14, 2018

@ljubobratovicrelja Is this still an issue? Can it be closed?

@carun
Copy link
Contributor

carun commented Jan 14, 2018

@infinityplusb ping

@ljubobratovicrelja
Copy link
Member

Is this still an issue? Can it be closed?

Sorry for not responding earlier. I'd say yes - you've posted a very neat way of solving this on Ubuntu (and thank you for that :), which @infinityplusb was also using at the time, so I'm closing this one. Anyone feel free to reopen for further discussion if problem resurfaces on some other platform.

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

3 participants