bennetimo / shrinkwrap

Shrink audio and video from cameras and GoPros at high quality, preserving metadata and original file modification times
http://coderunner.io/shrink-videos-with-ffmpeg-and-preserve-metadata/
68 stars 13 forks source link

Converting Hero10 video with Hero7 preset drops error #16

Open jpgreth opened 2 years ago

jpgreth commented 2 years ago

I tried using the gopro7 preset to convert a Hero10 Video. This produces the following output:

docker run -v /mnt/c/Users/abc/Desktop/GoPro\ Testfile/test:/files bennetimo/shrinkwrap --input-extension MP4 --preset gopro7 /files
13:08:33.971 [main] DEBUG shrinkwrap -
  ___ _        _      _
 / __| |_  _ _(_)_ _ | |____ __ ___ _ __ _ _ __
 \__ \ ' \| '_| | ' \| / /\ V  V / '_/ _` | '_ \
 |___/_||_|_| |_|_||_|_\_\ \_/\_/|_| \__,_| .__/
                                          |_|

13:08:33.982 [main] DEBUG shrinkwrap -
Using config:
Input Extension: MP4
Output Extension: mp4
Transcode Audio: true
Transcode Video: true
Backup Metadata: false
Metadata Suffix: -metadata
Overwrite Existing Transcodes: false
Transcoded Files Suffix: -tc
Using Shrinkwrap Preset: gopro7
FFMpeg Additional Options:
Input: /files

13:08:34.013 [main] DEBUG shrinkwrap - Shrinkwrapping file: /files/GX010718.MP4 (1/1)
13:08:34.015 [main] DEBUG shrinkwrap - Executing cmd: List(/bin/sh, -c, ffmpeg -y -noautorotate -i "/files/GX010718.MP4" -copy_unknown  -map_metadata 0 -codec copy -preset medium -map 0:v  -map 0:a  -map 0:m:handler_name:'
                                                                                                      GoPro TCD  '  -map 0:m:handler_name:'
                   GoPro SOS  '  -map 0:m:handler_name:'
                                                        GoPro MET  '?  -tag:d:1 'gpmd' -tag:d:2 'gpmd' -metadata:s:v: handler='GoPro AVC' -metadata:s:a: handler='GoPro AAC' -metadata:s:d:0 handler='GoPro TCD ' -metadata:s:d:2 handler='GoPro SOS (original fdsc stream)' -metadata:s:d:1 handler='GoPro MET' -codec:v libx264 -crf 23 -pix_fmt yuvj420p "/files/GX010718-tc.mp4")
ffmpeg version 4.0.4 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 6.4.0 (Alpine 6.4.0)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libass --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-postproc --enable-small --enable-version3 --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib --extra-libs=-ldl --prefix=/opt/ffmpeg
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/files/GX010718.MP4':
  Metadata:
    major_brand     : mp41
    minor_version   : 538120216
    compatible_brands: mp41
    creation_time   : 2022-08-31T10:28:53.000000Z
    firmware        : H21.01.01.46.00
  Duration: 00:00:10.97, start: 0.000000, bitrate: 60114 kb/s
    Stream #0:0(eng): Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 59809 kb/s, 100 fps, 100 tbr, 90k tbn, 100 tbc (default)
    Metadata:
      creation_time   : 2022-08-31T10:28:53.000000Z
      handler_name    : GoPro H.265
      encoder         : GoPro H.265 encoder
      timecode        : 10:28:53:07
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      creation_time   : 2022-08-31T10:28:53.000000Z
      handler_name    : GoPro AAC
      timecode        : 10:28:53:07
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2022-08-31T10:28:53.000000Z
      handler_name    : GoPro TCD
      timecode        : 10:28:53:07
    Stream #0:3(eng): Data: none (gpmd / 0x646D7067), 65 kb/s (default)
    Metadata:
      creation_time   : 2022-08-31T10:28:53.000000Z
      handler_name    : GoPro MET
Stream map '0:m:handler_name:
                             GoPro SOS  ' matches no streams.
To ignore this, add a trailing '?' to the map.
13:08:34.069 [main] ERROR shrinkwrap - Encountered a problem. Exiting shrinkwrap for safety

It seems there is a Problem with the additional Stream - maybe the suggested ? could be added?

I tried solving the problem manually, using the great Blogpost, but i didnt succeed.

My testfile and a screenshot of the GoPro videomode settings can be found here (can't upload videos here): https://drive.google.com/drive/folders/1w2kv_mdorf_0QRUtJH3jquXsnYlHrLPx?usp=sharing

It would be great if this could be fixed. Cause as i wrote - even with the great Blogost i didn't succeed. :(

infinity0 commented 1 year ago

Looks like the bitches over at GoPro changed the \t horizontal tab into a vertical \v tab. You can see this with ffprobe -hide_banner -show_streams -show_data <input> | less displays a ^K which is a vertical tab.

infinity0 commented 1 year ago

And they also added two spaces at the end of every name. ffprobe -hide_banner -show_streams -show_data -of json shows this more clearly. They are such pricks, lmao.