Re: [FFmpeg-user] hw_decode.c on osx?

2020-04-20 Thread Carl Eugen Hoyos
Am Mo., 20. Apr. 2020 um 13:45 Uhr schrieb Edward Park :
>
> > you've probably already seen carl eugen's post referring to ticket 8615.
> > looks like this may be a regression ...  to answer your question, though,
> > i'm on a 2018 mini (i7); gpu is "Intel UHD Graphics 630", which should
> > support hardware decoding for hevc (and certainly for h264).
> Yes, I have, and I noticed it was about a dozen commits behind origin HEAD.
> So I pulled and rebuilt, and got the exact same error. Like decode was not 
> even starting with vda or vt, encode still worked fine.
>
> Something interesting I noticed was when I ran ffmpeg -hwaccels it only 
> showed videotoolbox once.
> It always listed it twice which I thought was weird, but only once now that 
> it's not working.

I expect the two bugs to be unrelated.

> So does that mean it listed it once for decompression and once for 
> compression via VideoToolbox?
> So it built without decode support but with encode support?

The ticket indicates decoding was broken (not removed in any way).

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] hw_decode.c on osx?

2020-04-20 Thread Edward Park
Hi,
> you've probably already seen carl eugen's post referring to ticket 8615.  
> looks like this may be a regression ...  to answer your question, though,
> i'm on a 2018 mini (i7); gpu is "Intel UHD Graphics 630", which should
> support hardware decoding for hevc (and certainly for h264).
Yes, I have, and I noticed it was about a dozen commits behind origin HEAD.
So I pulled and rebuilt, and got the exact same error. Like decode was not even 
starting with vda or vt, encode still worked fine.

Something interesting I noticed was when I ran ffmpeg -hwaccels it only showed 
videotoolbox once.
It always listed it twice which I thought was weird, but only once now that 
it's not working. 
So does that mean it listed it once for decompression and once for compression 
via VideoToolbox? So it built
without decode support but with encode support?

Turning off avx optimizations doesn't do anything to help this time.

Worked at 55d830f69a2ff3ca191d97862200d4cc480d25b7
kumowoon1025@rfarm1 ffmpeg % ./ffmpeg_g -buildconf && ./ffmpeg_g -hide_banner 
-hwaccels
ffmpeg version N-96726-g018a42790c Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --prefix=/tmp/ffocl --enable-gpl
  libavutil  56. 40.100 / 56. 40.100
  libavcodec 58. 68.102 / 58. 68.102
  libavformat58. 38.100 / 58. 38.100
  libavdevice58.  9.103 / 58.  9.103
  libavfilter 7. 75.100 /  7. 75.100
  libswscale  5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc55.  6.100 / 55.  6.100

  configuration:
--prefix=/tmp/ffocl
--enable-gpl
Hardware acceleration methods:
videotoolbox
videotoolbox


Not working now
kumowoon1025@rfarm1 ffmpeg % ./ffmpeg_g -buildconf && ./ffmpeg_g -hide_banner 
-hwaccels
ffmpeg version N-97394-gcacdac819f Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple clang version 11.0.3 (clang-1103.0.32.29)
  configuration: --prefix=/tmp/ffocl --enable-gpl
  libavutil  56. 42.102 / 56. 42.102
  libavcodec 58. 80.100 / 58. 80.100
  libavformat58. 42.100 / 58. 42.100
  libavdevice58.  9.103 / 58.  9.103
  libavfilter 7. 79.100 /  7. 79.100
  libswscale  5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc55.  6.100 / 55.  6.100

  configuration:
--prefix=/tmp/ffocl
--enable-gpl
Hardware acceleration methods:
videotoolbox



Diff of config.h

9c9
< #define CC_IDENT "Apple clang version 11.0.3 (clang-1103.0.32.29)"
---
> #define CC_IDENT "Apple clang version 11.0.0 (clang-1100.0.33.17)"
392c392
< #define CONFIG_AVIO_LIST_DIR_EXAMPLE 1
---
> #define CONFIG_AVIO_DIR_CMD_EXAMPLE 1
476d475
< #define CONFIG_LIBRABBITMQ 0
758d756
< #define CONFIG_CDTOONS_DECODER 1
878d875
< #define CONFIG_MV30_DECODER 1
918a916
> #define CONFIG_SDX2_DPCM_DECODER 1
1042d1039
< #define CONFIG_HCA_DECODER 1
1077d1073
< #define CONFIG_SIREN_DECODER 1
1130c1126
< #define CONFIG_DERF_DPCM_DECODER 1
---
> #define CONFIG_PCM_ZORK_DECODER 1
1134d1129
< #define CONFIG_SDX2_DPCM_DECODER 1
1155d1149
< #define CONFIG_ADPCM_IMA_ALP_DECODER 1
1157d1150
< #define CONFIG_ADPCM_IMA_APM_DECODER 1
1164d1156
< #define CONFIG_ADPCM_IMA_MTF_DECODER 1
1184d1175
< #define CONFIG_ADPCM_ZORK_DECODER 1
1578d1568
< #define CONFIG_WEBP_PARSER 1
1754d1743
< #define CONFIG_CAS_FILTER 1
1873d1861
< #define CONFIG_MASKEDTHRESHOLD_FILTER 1
1899d1886
< #define CONFIG_OVERLAY_CUDA_FILTER 0
1902d1888
< #define CONFIG_PAD_OPENCL_FILTER 0
1985d1970
< #define CONFIG_TMEDIAN_FILTER 1
2081d2065
< #define CONFIG_ALP_DEMUXER 1
2088d2071
< #define CONFIG_APM_DEMUXER 1
2127d2109
< #define CONFIG_DERF_DEMUXER 1
2155d2136
< #define CONFIG_FWSE_DEMUXER 1
2169d2149
< #define CONFIG_HCA_DEMUXER 1
2578d2557
< #define CONFIG_LIBAMQP_PROTOCOL 0


And this is the working build's config.h on the right.
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
#define FFMPEG_CONFIGURATION "--prefix=/tmp/ffocl --enable-gpl"
#define FFMPEG_LICENSE "GPL version 2 or later"
#define CONFIG_THIS_YEAR 2020
#define FFMPEG_DATADIR "/tmp/ffocl/share/ffmpeg"
#define AVCONV_DATADIR "/tmp/ffocl/share/ffmpeg"
#define CC_IDENT "Apple clang version 11.0.0 (clang-1100.0.33.17)"
#define av_restrict restrict
#define EXTERN_PREFIX "_"
#define EXTERN_ASM _
#define BUILDSUF ""
#define SLIBSUF ".dylib"
#define HAVE_MMX2 HAVE_MMXEXT
#define SWS_MAX_FILTER_SIZE 256
#define ARCH_AARCH64 0
#define ARCH_ALPHA 0
#define ARCH_ARM 0
#define ARCH_AVR32 0
#define ARCH_AVR32_AP 0
#define ARCH_AVR32_UC 0
#define ARCH_BFIN 0
#define ARCH_IA64 0
#define ARCH_M68K 0
#define ARCH_MIPS 0
#define ARCH_MIPS64 0
#define ARCH_PARISC 0
#define ARCH_PPC 0
#define ARCH_PPC64 0
#define ARCH_S390 0
#define ARCH_SH4 0
#define ARCH_SPARC 0
#define ARCH_SPARC64 0
#define ARCH_TILEGX 0
#define ARCH_TILEPRO 0
#define ARCH_TOMI 0
#define ARCH_X86 1
#define ARCH_X86_32 0
#define ARCH_X86_64 1
#define HAVE_ARMV5TE 0
#define 

Re: [FFmpeg-user] hw_decode.c on osx?

2020-04-18 Thread su.00048--- via ffmpeg-user
on 2020.04.18 07:15 -0400, ted park wrote:

> > videotoolbox decodes to CMSampleBuffer, which is CoreMedia's generic buffer
> > wrapper class.  a couple levels down, it's probably a CVPixelBuffer.  if 
> > it's
> > working for you, i'd be curious to know what hardware and what os version
> > you're running on, and what type of file you're feeding to hw_decode.
> 
> Oh okay, makes sense. The one I tried it on had a W5700, I tried again on a
> dual nehalem Xserve with no gpu (almost, has  a GT120 for console/desktop
> monitor) and got similar errors
> 
> xserve:~ admin$ $OLDPWD/hw_decode videotoolbox hd-bars-h264.mov 
> hd-bars-h264.raw
> [h264 @ 0x7fb74d001800] Failed setup for format videotoolbox_vld: hwaccel 
> initialisation returned error.
> Failed to get HW surface format.
> [h264 @ 0x7fb74d001800] decode_slice_header error
> [h264 @ 0x7fb74d001800] no frame!
> Error during decoding
> 
> xserve:~ admin$ $OLDPWD/hw_decode videotoolbox hd-bars-hevc.mp4 
> hd-bars-hevc.raw
> [hevc @ 0x7fd8a8018a00] get_buffer() failed
> [hevc @ 0x7fd8a8018a00] videotoolbox: invalid state
> [hevc @ 0x7fd8a8018a00] hardware accelerator failed to decode picture
> Error during decoding
> Error during decoding
> 
> The difference would be I didn't expect it to work in the first place I
> guess. Do you know hardware decoding works in ffplay? It's harder to tell for
> mac frameworks imo, I'd try attaching to ffplay and seeing if you can get it
> to use a hardware decoder. Which gpu does the machine have?

you've probably already seen carl eugen's post referring to ticket 8615.  
looks like this may be a regression ...  to answer your question, though,
i'm on a 2018 mini (i7); gpu is "Intel UHD Graphics 630", which should
support hardware decoding for hevc (and certainly for h264).

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] hw_decode.c on osx?

2020-04-18 Thread su.00048--- via ffmpeg-user
on 2020.04.18 17:03 +0200, carl eugen wrote:

> Am Fr., 17. Apr. 2020 um 14:37 Uhr schrieb su.00048---:
> > 
> > i have ffmpeg building successfully on osx (10.14.6; xcode 11.3.1),
> > and am using the generated libraries in a personal video project i'm
> > working on.  now i'm ready to start thinking about implementing hardware
> > decoding ...  i tried adapting some of the code from hw_decode.c, but
> > ran into runtime errors.  thinking that it was my code that was at
> > fault, i then compiled hw_decode by itself, but i get the same errors
> > even there.  is anyone aware of hw_decode.c not working on osx?
> > 
> > trying to decode known good videos, either h264 or hevc, results in
> > some internal errors (see below).  the videos behave as expected when
> > opened with my locally built versions of ffplay or ffmpeg, however.
> > 
> > h264 example:
> > 
> >% hwdecode videotoolbox h264.mov h264.out
> > 
> >[h264 @ 0x7f8a2b003e00] get_buffer() failed
> >Assertion src->f->buf[0] failed at libavcodec/h264_picture.c:70
> >Abort
> > 
> > hevc fails differently:
> > 
> >% hwdecode videotoolbox hevc.mov hevc.out
> > 
> >[hevc @ 0x7f8464814600] get_buffer() failed
> >[hevc @ 0x7f8464814600] videotoolbox: invalid state
> >[hevc @ 0x7f8464814600] hardware accelerator failed to decode picture
> >Error during decoding
> >Error during decoding
> > 
> > there are no significant warnings, etc., when building the executable,
> > so i'm pretty sure everything is ok there.  videotoolbox shows up as
> > being available in the output of configure.
> > 
> > any suggestions as to what might be going wrong?
> 
> Did you see ticket #8615?

no, i hadn't seen that.  thanks.  

that does look very much like the same issue.  compiler version in the bug
report looks like the same one i'm using, so it could be that the reporter is
also still on mojave.  i don't have a catalina machine to test on, so i can't
check to see if things are any different there.  my builds are based on commit
59e3a9aede5e2f9271c82583d8724c272ce33a0a (2020.04.13; same day), if that's any
help ...  now that i know this is presumably a bug, if i get some time, i will
try to investigate what's going on, but i'm not very familiar with the ffmpeg
codebase ...  anyway, will keep monitoring issue 8615 in the meanwhile.  thanks
again for the info.

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] hw_decode.c on osx?

2020-04-18 Thread Carl Eugen Hoyos
Am Fr., 17. Apr. 2020 um 14:37 Uhr schrieb su.00048--- via ffmpeg-user
:
>
>
> i have ffmpeg building successfully on osx (10.14.6; xcode 11.3.1),
> and am using the generated libraries in a personal video project i'm
> working on.  now i'm ready to start thinking about implementing hardware
> decoding ...  i tried adapting some of the code from hw_decode.c, but
> ran into runtime errors.  thinking that it was my code that was at
> fault, i then compiled hw_decode by itself, but i get the same errors
> even there.  is anyone aware of hw_decode.c not working on osx?
>
> trying to decode known good videos, either h264 or hevc, results in
> some internal errors (see below).  the videos behave as expected when
> opened with my locally built versions of ffplay or ffmpeg, however.
>
> h264 example:
>
> % hwdecode videotoolbox h264.mov h264.out
>
> [h264 @ 0x7f8a2b003e00] get_buffer() failed
> Assertion src->f->buf[0] failed at libavcodec/h264_picture.c:70
> Abort
>
> hevc fails differently:
>
> % hwdecode videotoolbox hevc.mov hevc.out
>
> [hevc @ 0x7f8464814600] get_buffer() failed
> [hevc @ 0x7f8464814600] videotoolbox: invalid state
> [hevc @ 0x7f8464814600] hardware accelerator failed to decode picture
> Error during decoding
> Error during decoding
>
> there are no significant warnings, etc., when building the executable,
> so i'm pretty sure everything is ok there.  videotoolbox shows up as
> being available in the output of configure.
>
> any suggestions as to what might be going wrong?

Did you see ticket #8615?

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] hw_decode.c on osx?

2020-04-18 Thread Ted Park
Hi,

> videotoolbox decodes to CMSampleBuffer, which is CoreMedia's generic buffer
> wrapper class.  a couple levels down, it's probably a CVPixelBuffer.  if it's
> working for you, i'd be curious to know what hardware and what os version
> you're running on, and what type of file you're feeding to hw_decode.


Oh okay, makes sense. The one I tried it on had a W5700, I tried again on a 
dual nehalem Xserve with no gpu (almost, has  a GT120 for console/desktop 
monitor) and got similar errors

xserve:~ admin$ $OLDPWD/hw_decode videotoolbox hd-bars-h264.mov hd-bars-h264.raw
[h264 @ 0x7fb74d001800] Failed setup for format videotoolbox_vld: hwaccel 
initialisation returned error.
Failed to get HW surface format.
[h264 @ 0x7fb74d001800] decode_slice_header error
[h264 @ 0x7fb74d001800] no frame!
Error during decoding

xserve:~ admin$ $OLDPWD/hw_decode videotoolbox hd-bars-hevc.mp4 hd-bars-hevc.raw
[hevc @ 0x7fd8a8018a00] get_buffer() failed
[hevc @ 0x7fd8a8018a00] videotoolbox: invalid state
[hevc @ 0x7fd8a8018a00] hardware accelerator failed to decode picture
Error during decoding
Error during decoding

The difference would be I didn't expect it to work in the first place I guess. 
Do you know hardware decoding works in ffplay? It's harder to tell for mac 
frameworks imo, I'd try attaching to ffplay and seeing if you can get it to use 
a hardware decoder. Which gpu does the machine have?

Regards,
Ted Park

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] hw_decode.c on osx?

2020-04-17 Thread su.00048--- via ffmpeg-user
on 2020.04.17 09:02 -0400, ffmpeg-user@ffmpeg.org wrote:

> Hi,
> 
> > i have ffmpeg building successfully on osx (10.14.6; xcode 11.3.1),
> > and am using the generated libraries in a personal video project i'm
> > working on.  now i'm ready to start thinking about implementing hardware
> > decoding ...  i tried adapting some of the code from hw_decode.c, but 
> > ran into runtime errors.  thinking that it was my code that was at
> > fault, i then compiled hw_decode by itself, but i get the same errors
> > even there.  is anyone aware of hw_decode.c not working on osx?
> 
> The example's working fine for me. (I think... I don't know what kind of
> format videotoolbox decodes to but if I squint and tilt my head a little the
> hex dump looks like it might be raw pixel buffer bytes of some sort lol)

thanks ted for your reply.

videotoolbox decodes to CMSampleBuffer, which is CoreMedia's generic buffer
wrapper class.  a couple levels down, it's probably a CVPixelBuffer.  if it's
working for you, i'd be curious to know what hardware and what os version
you're running on, and what type of file you're feeding to hw_decode.

> Did you read the readme in the folder the example is in? I'm wondering when
> you say you compiled hw_decode by itself you literally mean just the compile
> step using cc.

originally, i just took some of the code from hw_decode.c and adapted it for
use within my app.  when i got the errors, my first thought was that i was
doing something wrong, so i wanted to isolate that by just running the
executable produced by compiling hw_decode.c as a standalone program from the
commandline.  i've built that a few different ways now (to be clear, these are
successful compilations producing an executable program), but they all exhibit
the same runtime errors (shown in my original message).  as far as build
methods, here's what i've tried so far:

1) build the hw_decode executable (a separate target in xcode), linking against
the ffmpeg libraries built locally in an earlier project step.  i know these
libraries are generally functional, because i'm linking against them in my main
application, and it works as expected (except for the hardware decoding).

2) build the executable linking against the precompiled libraries downloaded
from https://ffmpeg.zeranoe.com/builds/.

3) build the examples "in-tree" (method 2 from the README you suggested).
this again will link against the locally built libraries, similar to (1) above.

here are some (i am assuming pertinent) excerpts from the output of the
configure stage during these builds:

> External libraries:
> appkit  coreimage   zlib
> avfoundationiconv
> bzlib   securetransport
> 
> External libraries providing hardware acceleration:
> audiotoolboxvideotoolbox
> 
> Libraries:
> avcodec avformatswscale
> avdeviceavutil
> avfilterswresample
>
> ...
>
> Enabled hwaccels:
> h263_videotoolbox   hevc_videotoolbox   mpeg2_videotoolbox
> h264_videotoolbox   mpeg1_videotoolbox  mpeg4_videotoolbox

am i incorrect in assuming that one should be able to build the ffmpeg libs on
osx with hardware decoding support for h264 and hevc?  the hwaccel intro wiki
page seems to suggest it should work ...

thanks.



___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] hw_decode.c on osx?

2020-04-17 Thread Ted Park
Hi,

> i have ffmpeg building successfully on osx (10.14.6; xcode 11.3.1),
> and am using the generated libraries in a personal video project i'm
> working on.  now i'm ready to start thinking about implementing hardware
> decoding ...  i tried adapting some of the code from hw_decode.c, but 
> ran into runtime errors.  thinking that it was my code that was at
> fault, i then compiled hw_decode by itself, but i get the same errors
> even there.  is anyone aware of hw_decode.c not working on osx?

The example's working fine for me. (I think... I don't know what kind of format 
videotoolbox decodes to but if I squint and tilt my head a little the hex dump 
looks like it might be raw pixel buffer bytes of some sort lol)
Did you read the readme in the folder the example is in? I'm wondering when you 
say you compiled hw_decode by itself you literally mean just the compile step 
using cc.

Regards,
Ted Park

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] hw_decode.c on osx?

2020-04-17 Thread su.00048--- via ffmpeg-user

i have ffmpeg building successfully on osx (10.14.6; xcode 11.3.1),
and am using the generated libraries in a personal video project i'm
working on.  now i'm ready to start thinking about implementing hardware
decoding ...  i tried adapting some of the code from hw_decode.c, but 
ran into runtime errors.  thinking that it was my code that was at
fault, i then compiled hw_decode by itself, but i get the same errors
even there.  is anyone aware of hw_decode.c not working on osx?

trying to decode known good videos, either h264 or hevc, results in
some internal errors (see below).  the videos behave as expected when
opened with my locally built versions of ffplay or ffmpeg, however.

h264 example:

% hwdecode videotoolbox h264.mov h264.out

[h264 @ 0x7f8a2b003e00] get_buffer() failed
Assertion src->f->buf[0] failed at libavcodec/h264_picture.c:70
Abort

hevc fails differently:

% hwdecode videotoolbox hevc.mov hevc.out

[hevc @ 0x7f8464814600] get_buffer() failed
[hevc @ 0x7f8464814600] videotoolbox: invalid state
[hevc @ 0x7f8464814600] hardware accelerator failed to decode picture
Error during decoding
Error during decoding

there are no significant warnings, etc., when building the executable,
so i'm pretty sure everything is ok there.  videotoolbox shows up as
being available in the output of configure.  

any suggestions as to what might be going wrong?  

thanks.

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".