Optware / Optware-ng

279 stars 52 forks source link

[ffmpeg] package very old - why? #235

Closed GammaC0de closed 6 years ago

GammaC0de commented 6 years ago

ffmpeg on the repo is very old (2.5.4+git20150217-rev075178-8).

Can it be updated? if not, why?

alllexx88 commented 6 years ago

I've upgraded ffmpeg to latest stable release 3.4. It's always a bit troublesome to upgrade ffmpeg, since ffmpeg libs API changes a lot, and packages that depend on ffmpeg need upgrading/patching.

GammaC0de commented 6 years ago

Hi, Thanks for the update but there is something wrong with this build: (and the version says SVN-r0.5.1-4:0.5.1-3, not 3.4) Notice the "Unknown/unsupported CodecID A_OPUS" and "unrecognized option '-sub_charenc'"

Maybe this is related to unupdated libmatroska? Shouln't ffmpeg's git branch be release/3.4?

ffmpeg -i "_____ ______ _ ___ 7.video.mp4" -i "_____ ______ _ ___ 7.audio.webm" -map 0:v:0 -map 1:a:0 -y -vcodec copy -acodec copy -scodec copy -ss 00:0:0.00 -sub_charenc utf8 "_____ ______ _ ___ 7.mkv"

FFmpeg version SVN-r0.5.1-4:0.5.1-3, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --disable-encoder=h263 --disable-encoder=h263p --disable-encoder=mpeg2video --disable-encoder=mpeg4 --disable-encoder=msmpeg4v1 --disable-encoder=msmpeg4v2 --disable-encoder=msmpeg4v3 --extra-version=4:0.5.1-3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdc1394 --disable-altivec --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.72. 2
  libavformat   52.31. 0 / 52.64. 2
  libavdevice   52. 1. 0 / 52. 2. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0.11. 0
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Mar 12 2010 22:49:34, gcc: 4.4.3

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (25/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '_____ ______ _ ___ 7.video.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
  Duration: 00:53:08.08, start: 1594.080000, bitrate: 812 kb/s
    Stream #0.0(und): Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 25 tbr, 90k tbn, 50 tbc
[matroska @ 0x1003a0b0]Unknown entry 0x56AA
[matroska @ 0x1003a0b0]Unknown entry 0x56BB
[matroska @ 0x1003a0b0]Unknown/unsupported CodecID A_OPUS.
[matroska @ 0x1003a0b0]Estimating duration from bitrate, this may be inaccurate
Input #1, matroska, from '_____ ______ _ ___ 7.audio.webm':
  Metadata:
    doctype         : webm
  Duration: 00:26:34.10, start: 0.000000, bitrate: N/A
    Stream #1.0(eng): Audio: 0x0000, 48000 Hz, 2 channels
ffmpeg: unrecognized option '-sub_charenc'

Same files and same command on windows does work well:

C:\>ffmpeg -i "_____ ______ _ ___ 7.video.mp4" -i "_____ ______ _ ___ 7.audio.webm" -map 0:v:0 -map 1:a:0 -y -vcodec copy -acodec copy -scodec copy -ss 00:0:0.00 -sub_charenc utf8 "_____ ______ _ ___ 7.mkv"

ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '_____ ______ _ ___ 7.video.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    creation_time   : 2017-12-01T11:43:13.000000Z
  Duration: 00:26:34.04, start: 0.000000, bitrate: 1625 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 0 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2017-12-01T11:43:13.000000Z
      handler_name    : VideoHandler
Input #1, matroska,webm, from '_____ ______ _ ___ 7.audio.webm':
  Metadata:
    encoder         : google/video-file
  Duration: 00:26:34.10, start: -0.007000, bitrate: 130 kb/s
    Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Output #0, matroska, to '_____ ______ _ ___ 7.mkv':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    encoder         : Lavf57.83.100
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 0 kb/s, 25 fps, 25 tbr, 1ktbn, 90k tbc (default)
    Metadata:
      creation_time   : 2017-12-01T11:43:13.000000Z
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: opus ([255][255][255][255] / 0xFFFFFFFF), 48000 Hz, stereo, fltp (default)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 5360 fps=0.0 q=-1.0 size=   42075kB time=00:03:39.32 bitrate=1571.6kbits/
frame= 9414 fps=9405 q=-1.0 size=   82768kB time=00:06:21.48 bitrate=1777.4kbits
frame=13603 fps=9063 q=-1.0 size=  120872kB time=00:09:09.04 bitrate=1803.5kbits
frame=18988 fps=9480 q=-1.0 size=  158333kB time=00:12:44.44 bitrate=1696.8kbits
frame=24834 fps=9922 q=-1.0 size=  203386kB time=00:16:38.28 bitrate=1669.0kbits
frame=29513 fps=9828 q=-1.0 size=  250944kB time=00:19:45.44 bitrate=1734.1kbits
frame=34800 fps=9934 q=-1.0 size=  304609kB time=00:23:16.92 bitrate=1786.3kbits
frame=39726 fps=10126 q=-1.0 Lsize=  341583kB time=00:26:34.08 bitrate=1755.4kbits/s speed= 406x
video:315849kB audio:24888kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.248350%
alllexx88 commented 6 years ago

Hi, If you look here, you can see that commit 01e291a592452f27b3a4e811536aaaf94096e244 is tagged as n3.4. The binary version info doesn't say 3.4, since I previously used the aforementioned git commit instead of the release tarball. Now I've switched to release tarball. Also, Unknown/unsupported CodecID A_OPUS error occurred because ffmpeg was built without libopus, which is fixed in version 3.4-2. As for unrecognized option '-sub_charenc', I'm not sure...

GammaC0de commented 6 years ago

Well, there is a difference in Optware-ng's configuration and the official build configuration (Optware-ng's has many features disabled):

I think '-sub_charenc', is related to --enable-iconv, not sure.

Official build:

  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx

Optware-ng's configuration:

configuration: --disable-encoder=h263 --disable-encoder=h263p --disable-encoder=mpeg2video --disable-encoder=mpeg4 --disable-encoder=msmpeg4v1 --disable-encoder=msmpeg4v2 --disable-encoder=msmpeg4v3 --extra-version=4:0.5.1-3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdc1394 --disable-altivec --enable-shared --disable-static
GammaC0de commented 6 years ago

Still same results with the updated package: Here is Ubuntu 16LTS's configuration:

configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv

Output withe ffmpeg 3.4-2:

# ffmpeg -i "_____ ______ _ ___ 7.video.mp4" -i "_____ ______ _ ___ 7.audio.webm" -map 0:v:0 -map 1:a:0 -y -vcodec copy -acodec copy -scodec copy -ss 00:0:0.00 "_____ ______ _ ___ 7.mkv"
FFmpeg version SVN-r0.5.1-4:0.5.1-3, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --disable-encoder=h263 --disable-encoder=h263p --disable-encoder=mpeg2video --disable-encoder=mpeg4 --disable-encoder=msmpeg4v1 --disable-encoder=msmpeg4v2 --disable-encoder=msmpeg4v3 --extra-version=4:0.5.1-3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdc1394 --disable-altivec --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.72. 2
  libavformat   52.31. 0 / 52.64. 2
  libavdevice   52. 1. 0 / 52. 2. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0.11. 0
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Mar 12 2010 22:49:34, gcc: 4.4.3

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (25/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '_____ ______ _ ___ 7.video.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
  Duration: 00:53:08.08, start: 1594.080000, bitrate: 812 kb/s
    Stream #0.0(und): Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 25 tbr, 90k tbn, 50 tbc
[matroska @ 0x1003a0b0]Unknown entry 0x56AA
[matroska @ 0x1003a0b0]Unknown entry 0x56BB
[matroska @ 0x1003a0b0]Unknown/unsupported CodecID A_OPUS.
[matroska @ 0x1003a0b0]Estimating duration from bitrate, this may be inaccurate
Input #1, matroska, from '_____ ______ _ ___ 7.audio.webm':
  Metadata:
    doctype         : webm
  Duration: 00:26:34.10, start: 0.000000, bitrate: N/A
    Stream #1.0(eng): Audio: 0x0000, 48000 Hz, 2 channels
Output #0, matroska, to '_____ ______ _ ___ 7.mkv':
    Stream #0.0(und): Video: avc1 / 0x31637661, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31, 90k tbn, 25 tbc
    Stream #0.1(eng): Audio: 0x0000, 48000 Hz, 2 channels
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #1.0 -> #0.1 [sync #0.0]
[matroska @ 0x10747250]No wav codec ID found.
Could not write header for output file #0 (incorrect codec parameters ?)
alllexx88 commented 6 years ago

Optware-ng's configuration:

Not quite, Optware-ng ffmpeg configuration is this (did you cite your fw's ffmpeg configuration?):

configuration: --enable-cross-compile --cross-prefix=/home/jenkins/Optware-ng/buildroot-i686/toolchain/buildroot-2017.08/output/host/bin/i686-buildroot-linux-gnu- --arch=i686 --target-os=linux --pkg-config=/home/jenkins/Optware-ng/scripts/pkg-config.sh --enable-version3 --enable-gpl --enable-nonfree --enable-openssl --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libx264 --enable-libfdk-aac --enable-libsoxr --enable-libass --enable-shared --disable-static --enable-postproc --prefix=/opt

Still, I agree, many features are disabled. Mostly that's because Optware-ng is missing the required libs. Among those libs that are present, I think we can try to enable these:

--enable-fontconfig \
--enable-iconv \
--enable-libfreetype \
--enable-libopenjpeg \
--enable-libtheora \
--enable-libwavpack \
--enable-libxml2 \
--enable-lzma \
--enable-zlib \
--enable-gmp
alllexx88 commented 6 years ago

Output withe ffmpeg 3.4-2:

Wrong, you're using your fw's ffmpeg, according to this line:

FFmpeg version SVN-r0.5.1-4:0.5.1-3, Copyright (c) 2000-2009 Fabrice Bellard, et al.

3.4-2 Optware-ng ffmpeg version string is this:

ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
GammaC0de commented 6 years ago

Oh you are right! Can you add somthing like update-alternative for ffmpeg?

I think we can try to enable these:

Yes, please!

Now I have this issue:


/opt/bin/ffmpeg: error while loading shared libraries: libxcb.so.1: cannot open shared object file: No such file or directory``
alllexx88 commented 6 years ago

Can you add somthing like update-alternative for ffmpeg?

Optware-ng doesn't write outside of /opt, and since /usr/bin, where your fw's ffmpeg is installed evidently comes before /opt/bin in PATH, probably, the easiest way to have /opt/bin/ffmpeg called instead of /usr/bin/ffmpeg, is to create a respective alias: alias ffmpeg='/opt/bin/ffmpeg'.

Now I have this issue:

/opt/bin/ffmpeg: error while loading shared libraries: libxcb.so.1: cannot open shared object file: No such file or directory``

I've disabled libxcb* in 3.4-3, and enabled the other features from above

GammaC0de commented 6 years ago

Thanks for the update, now I have this mysterious "Illegal instruction" error:

/home/user# /opt/bin/ffmpeg -i "_____ ______ _ ___ 7.video.mp4" -i "_____ ______ _ ___ 7.audio.webm" -map 0:v:0 -map 1:a:0 -y -vcodec copy -acodec copy -scodec copy -ss 00:0:0.00 "_____ ______ _ ___ 7.mkv"
ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.4.0 (Buildroot 2017.08-g63447f8-dirty)
  configuration: --enable-cross-compile --cross-prefix=/home/jenkins/Optware-ng/buildroot-ppc-603e/toolchain/buildroot-2017.08/output/host/bin/powerpc-buildroot-linux-gnu- --arch=powerpc --target-os=linux --pkg-config=/home/jenkins/Optware-ng/scripts/pkg-config.sh --enable-version3 --enable-gpl --enable-nonfree --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-libxcb-shape --enable-openssl --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libx264 --enable-libfdk-aac --enable-libsoxr --enable-libass --enable-fontconfig --enable-iconv --enable-libfreetype --enable-libopenjpeg --enable-libtheora --enable-libwavpack --enable-libxml2 --enable-lzma --enable-zlib --enable-gmp --enable-shared --disable-static --enable-postproc --prefix=/opt
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Illegal instruction
/home/user#
alllexx88 commented 6 years ago

now I have this mysterious "Illegal instruction" error

Most likely, this is happening because buildroot-ppc-603e feed is using 3.2 kernel headers, which is newer than 2.6.32 kernel your box is running. It makes sense to rebuild the entire feed with 2.6.32 headers, but it'll take some time (few days, I think).

GammaC0de commented 6 years ago

I don't mind waiting :)

alllexx88 commented 6 years ago

OK, the 2.6.32-linux toolchain is ready. I've now launched a failproof test build that tries to build all packages in turns, ignoring build errors: you can watch the build as it goes here. After it's done (takes a while), I'll be fixing build issues next

alllexx88 commented 6 years ago

@GammaC0de The feed is now rebuilt with 2.6.32 linux kernel headers. Please clean /opt, bootstrap the feed afresh, and try ffmpeg again. Thanks

GammaC0de commented 6 years ago

Hi, Clean Optware-ng installation, Same "Illegal instruction" error :(

alllexx88 commented 6 years ago

@GammaC0de Ok... I see from one of your messages above that your fw's ffmpeg was built with --disable-altivec. Maybe, there's something wrong with AltiVec support on your box, let's try without it. ffmpeg-3.4-4 is built with AltiVec optimizations disabled.

GammaC0de commented 6 years ago

OK (fingers crossed ;-) )

alllexx88 commented 6 years ago

@GammaC0de did you get a chance to test ffmpeg 3.4-4? Thanks

GammaC0de commented 6 years ago

3.4-4 !? It's not on the repo...

alllexx88 commented 6 years ago

Right, sorry, the change has somehow got lost. It's on the repo now

GammaC0de commented 6 years ago

Success!

Thank you so much for great support 😀