anthwlock / untrunc

Restore a truncated mp4/mov. Improved version of ponchio/untrunc
GNU General Public License v2.0
1.9k stars 182 forks source link

Added missing flag for ffmpeg-3.3.9 #28

Closed suuuehgi closed 5 years ago

suuuehgi commented 5 years ago

make FF_VER=3.3.9 fails with

g++ .build_3.3.9/track.o .build_3.3.9/codec.o .build_3.3.9/atom.o .build_3.3.9/common.o .build_3.3.9/sps-info.o .build_3.3.9/mp4.o .build_3.3.9/nal-slice.o .build_3.3.9/nal.o .build_3.3.9/main.o .build_3.3.9/avc-config.o .build_3.3.9/file.o -Lffmpeg-3.3.9/libavformat -lavformat -Lffmpeg-3.3.9/libavcodec -lavcodec -Lffmpeg-3.3.9/libavutil -lavutil -lpthread -lz -lbz2 -lX11 -ldl -lva -lva-drm -lva-x11 -llzma -o untrunc
/usr/bin/ld: ffmpeg-3.3.9/libavutil/libavutil.a(hwcontext_vdpau.o): in function `vdpau_device_create':
/home/user/untrunc/ffmpeg-3.3.9/libavutil/hwcontext_vdpau.c:439: undefined reference to `vdp_device_create_x11'
collect2: error: ld returned 1 exit status
make: *** [Makefile:87: untrunc] Error 1
anthwlock commented 5 years ago

Now I get this:

/usr/bin/ld: cannot find -lvdpau

Maybe ./configure ... --disable-vdpau helps? If it does tell me, so I can add it.

suuuehgi commented 5 years ago

Now I get this:

/usr/bin/ld: cannot find -lvdpau

You probably need to install libvdpau or similar. --disable-vdpau would drop vdpau hardware acceleration capabilities.

anthwlock commented 5 years ago

untrunc does not use vdpau hardware acceleration, and many people don't have a NVIDIA Graphics card.

suuuehgi commented 5 years ago

--disable-vdpau

Afaics it is insufficient since libavutil that comes with ffmpeg 3.3.9 is linked agains vdpau. This might be a bug in the old ffmpeg version regarding the above mentioned flag.

/usr/bin/ld: ffmpeg-3.3.9/libavutil/libavutil.a(hwcontext_vdpau.o): in function `vdpau_device_create':
/tmp/untrunc/ffmpeg-3.3.9/libavutil/hwcontext_vdpau.c:439: undefined reference to `vdp_device_create_x11'
collect2: error: ld returned 1 exit status
make: *** [Makefile:87: untrunc] Error 1
anthwlock commented 5 years ago

libavutil that comes with ffmpeg 3.3.9 is linked agains vdpau

I gues wether libavutil links against libvdpau depends on --disable-vdpau. After you added --disable-vdpau to Makefile:69, did you make clean the existing ffmpeg-3.3.9/ build?

suuuehgi commented 5 years ago

After you added --disable-vdpau to Makefile:69, did you make clean the existing ffmpeg-3.3.9/ build?

sticker You are right! Although I did a make clean, this was not clean. rm -rf untrunc && git clone is clean. And then it compiles successfully with --disable-vdpau on line 69 appended to Makefile.

anthwlock commented 5 years ago

Added this with 1db84d7