dickontoo / omxtx

OpenMAX transcoder for the Raspberry Pi
GNU General Public License v2.0
117 stars 36 forks source link

Install from scratch on Pi instructions? #17

Open kevinlieb opened 7 years ago

kevinlieb commented 7 years ago

Can we get instructions how to install on the Pi from scratch? I get errors in make about: /usr/bin/ld: cannot find -lavformat /usr/bin/ld: cannot find -lavcodec /usr/bin/ld: cannot find -lavutil

I downloaded ffmpeg from dickontoo's area but not sure what to do with it.

modified CFLAGS to include: -I/home/pi/ffmpeg

Thanks!

Frodox commented 7 years ago

How to you deal with headers? I get

$ make
gcc -Wall -Wno-format -g -I/opt/vc/include/IL -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -L/usr/local/lib -I/usr/local/include -c omxtx.c
omxtx.c:43:32: fatal error: libavcodec/avcodec.h: No such file or directory
 #include "libavcodec/avcodec.h"
                                ^
compilation terminated.
Makefile:14: recipe for target 'omxtx.o' failed
make: *** [omxtx.o] Error 1

I can write instruction if I can build it..

Frodox commented 7 years ago

@kevinlieb Where did you get "libavcodec/avcodec.h" from? What do you mean

I downloaded ffmpeg from dickontoo's area ..?

tim-devel commented 7 years ago

libavcodec-dev or something like that I would assume

Frodox commented 7 years ago

@timstanley1985 oh, thank you! I use dpkg -S to find package, which was wrong.. After installing libavformat-dev libavcodec-dev I can compiles it fine. Now the problem - how to use omxtx..? I want to encode video with x264 codec, but looks like it allows only to change bitrait..

dickontoo commented 7 years ago

It will transcode from MPEG 2 and VC-1 if you have the correct licence keys, which you can buy (cheaply) from the Foundation. Otherwise you're limited to whatever the Pi's hardware will do without the licences (which I think is just H.264 and related codecs).

Frodox commented 7 years ago

@dickontoo hmmm, well, I just want to have analog of command:

Rpi $ raspivid -fps 25 -t 10000 -o 10-fhd.h264
Rpi $ scp 10-fhd.h264 ...
Linux-pc $ avconv -r 25 -i 10-fhd.h264 -vcodec h264 -acodec copy 10-fhd.mkv

running of

Rpi $ ./omxtx -b 10000000 10-fhd.h264 10-fhd.mkv

works strange, because I get very short video (80ms) with 2 575.000 fps, instead of 10s and 25 fps..

is it possible? Or, it is not use-case for omxtx?

dickontoo commented 7 years ago

I'm not sure what you're trying to do there -- raspivid records to H.264 already. omxtx is really for converting pre-recorded data in a suitable container into H.264 from some other codec. You could try repacking the raw file with something like:

ffmpeg -i 10-fhd.h264 -r 25 -codec copy 10-fhd.mkv

before transcoding it, but I'm not sure what that will buy you. Better to set the bitrate in raspivid first (I assume that's possible; I haven't looked at it in years).