[FFmpeg-user] error with hero 7 white gopro audio stream

Harry Levinson hal at umich.edu
Thu Dec 27 21:56:09 EET 2018


It seems that even though there is an error message, the audio stream is
copied to the output file with no perceptible loss.  I thought I had a
different outcome before I posted.

As far as hardware acceleration (hwaccel) is concerned, I found a couple of
useful links and have successfully used my macbook air hardware with the
following command.

$ ffmpeg -y -threads 2 -i GH010087.MP4 -vf
"lenscorrection=cx=0.5:cy=0.5:k1=-0.211:k2=0.0"  -vcodec h264_videotoolbox
-b:v 10000K  out.mp4

Adjust the bitrate (-b:v) and threads as appropriate for your desired
results.

Elsewhere (
https://stackoverflow.com/questions/30832248/is-there-a-way-to-remove-gopro-fisheye-using-ffmpeg)
I found recommended values for GoPro correction to be k1=-0.227 and
k2=-0.022. After running a test grid image through ffmpeg at different
settings I settled on the settings in the example command.

I found these two links helpful for figuring out a working use of hardware
acceleration.
https://forum.videohelp.com/threads/386398-ffmpeg-videotoolbox-options
https://www.reddit.com/r/ffmpeg/comments/59qglv/your_experiences_with_h264_videotoolbox/

I need to do some more research to see if opencl can be used. When I tried,
it errored out but so did my attempts with videotoolbox until I found the
above links for guidance.


On Wed, Dec 26, 2018 at 7:58 PM Harry Levinson <hal at umich.edu> wrote:

> I am trying to use ffmpeg to defish my gopro videos on a mac.  The lens
> correction is working reasonably well though eventually I'd like to have
> hardware acceleration working, but first I am having a more basic problem.
> When ffmpeg gets to the audio stream it complains about the audio stream.
>
>     Error while decoding stream #0:1: Invalid argument:00:47.31
>
> I tried a few stream mapping options but no success.  Below is the most
> basic command and resulting output. I tried another MP4 file and it worked
> fine.
>
> Thanks,
> Harry
>
>
> $ ffmpeg  -i GH010087.MP4    out.MP4
> ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
>   built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
>   configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1_1 --enable-shared
> --enable-pthreads --enable-version3 --enable-hardcoded-tables
> --enable-avresample --cc=clang --host-cflags= --host-ldflags=
> --enable-ffplay --enable-gpl --enable-libmp3lame --enable-libopus
> --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx
> --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma
> --enable-opencl --enable-videotoolbox
>   libavutil      56. 22.100 / 56. 22.100
>   libavcodec     58. 35.100 / 58. 35.100
>   libavformat    58. 20.100 / 58. 20.100
>   libavdevice    58.  5.100 / 58.  5.100
>   libavfilter     7. 40.101 /  7. 40.101
>   libavresample   4.  0.  0 /  4.  0.  0
>   libswscale      5.  3.100 /  5.  3.100
>   libswresample   3.  3.100 /  3.  3.100
>   libpostproc    55.  3.100 / 55.  3.100
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GH010087.MP4':
>   Metadata:
>     major_brand     : mp41
>     minor_version   : 538120216
>     compatible_brands: mp41
>     creation_time   : 2018-02-08T17:33:57.000000Z
>     firmware        : H18.02.01.21.00
>   Duration: 00:00:47.49, start: 0.000000, bitrate: 30131 kb/s
>     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc,
> smpte170m), 1920x1440, 30025 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default)
>     Metadata:
>       creation_time   : 2018-02-08T17:33:57.000000Z
>       handler_name    : GoPro AVC
>       encoder         : GoPro AVC encoder
>       timecode        : 00:23:00:11
>     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
> stereo, fltp, 127 kb/s (default)
>     Metadata:
>       creation_time   : 2018-02-08T17:33:57.000000Z
>       handler_name    : GoPro AAC
>       timecode        : 00:23:00:11
>     Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
>     Metadata:
>       creation_time   : 2018-02-08T17:33:57.000000Z
>       handler_name    : GoPro TCD
>       timecode        : 00:23:00:11
>     Stream #0:3(eng): Data: bin_data (gpmd / 0x646D7067), 30 kb/s (default)
>     Metadata:
>       creation_time   : 2018-02-08T17:33:57.000000Z
>       handler_name    : GoPro MET
>     Stream #0:4(eng): Data: none (fdsc / 0x63736466), 10 kb/s (default)
>     Metadata:
>       creation_time   : 2018-02-08T17:33:57.000000Z
>       handler_name    : GoPro SOS
> File 'out.MP4' already exists. Overwrite ? [y/N] Stream mapping:
>   Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
>   Stream #0:1 -> #0:1 (aac (native) -> aac (native))
> Press [q] to stop, [?] for help
> [libx264 @ 0x7fa020818200] using cpu capabilities: MMX2 SSE2Fast SSSE3
> SSE4.2 AVX FMA3 BMI2 AVX2
> [libx264 @ 0x7fa020818200] profile High, level 5.0
> [libx264 @ 0x7fa020818200] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC
> codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options:
> cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
> psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1
> cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6
> lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
> bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
> b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25
> scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
> qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
> Output #0, mp4, to 'out.MP4':
>   Metadata:
>     major_brand     : mp41
>     minor_version   : 538120216
>     compatible_brands: mp41
>     firmware        : H18.02.01.21.00
>     encoder         : Lavf58.20.100
>     Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661),
> yuvj420p(pc), 1920x1440, q=-1--1, 0.03 fps, 15360 tbn, 30 tbc (default)
>     Metadata:
>       creation_time   : 2018-02-08T17:33:57.000000Z
>       handler_name    : GoPro AVC
>       timecode        : 00:23:00:11
>       encoder         : Lavc58.35.100 libx264
>     Side data:
>       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
>     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
> stereo, fltp, 128 kb/s (default)
>     Metadata:
>       creation_time   : 2018-02-08T17:33:57.000000Z
>       handler_name    : GoPro AAC
>       timecode        : 00:23:00:11
>       encoder         : Lavc58.35.100 aac
> Error while decoding stream #0:1: Invalid argument:00:47.31
> bitrate=12144.0kbits/s speed=0.248x
> frame= 1421 fps=7.2 q=-1.0 Lsize=   75675kB time=00:00:47.46
> bitrate=13060.4kbits/s speed=0.241x
> video:74877kB audio:746kB subtitle:0kB other streams:0kB global
> headers:0kB muxing overhead: 0.069087%
> [libx264 @ 0x7fa020818200] frame I:13    Avg QP:21.87  size:127693
> [libx264 @ 0x7fa020818200] frame P:411   Avg QP:24.67  size: 86490
> [libx264 @ 0x7fa020818200] frame B:997   Avg QP:26.53  size: 39585
> [libx264 @ 0x7fa020818200] consecutive B-frames:  5.1%  2.7%  4.4% 87.8%
> [libx264 @ 0x7fa020818200] mb I  I16..4: 16.3% 73.4% 10.3%
> [libx264 @ 0x7fa020818200] mb P  I16..4: 10.4% 26.9%  3.7%  P16..4: 36.3%
> 11.2%  4.8%  0.0%  0.0%    skip: 6.7%
> [libx264 @ 0x7fa020818200] mb B  I16..4:  1.3%  3.0%  0.6%  B16..8: 42.9%
> 7.5%  1.8%  direct: 6.5%  skip:36.3%  L0:47.6% L1:41.0% BI:11.4%
> [libx264 @ 0x7fa020818200] 8x8 transform intra:65.1% inter:70.0%
> [libx264 @ 0x7fa020818200] coded y,uvDC,uvAC intra: 45.6% 60.7% 9.7%
> inter: 22.0% 30.1% 0.3%
> [libx264 @ 0x7fa020818200] i16 v,h,dc,p: 21% 30% 13% 36%
> [libx264 @ 0x7fa020818200] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 22% 26%  4%
> 6%  4%  8%  4%  7%
> [libx264 @ 0x7fa020818200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 27% 15%  6%
> 8%  5% 12%  5% 11%
> [libx264 @ 0x7fa020818200] i8c dc,h,v,p: 54% 24% 17%  5%
> [libx264 @ 0x7fa020818200] Weighted P-Frames: Y:11.9% UV:9.7%
> [libx264 @ 0x7fa020818200] ref P L0: 57.5% 17.1% 18.6%  6.4%  0.4%
> [libx264 @ 0x7fa020818200] ref B L0: 92.5%  6.0%  1.5%
> [libx264 @ 0x7fa020818200] ref B L1: 97.3%  2.7%
> [libx264 @ 0x7fa020818200] kb/s:12949.80
> [aac @ 0x7fa01f81ec00] Qavg: 262.595
>


More information about the ffmpeg-user mailing list