EXIF Tags lost after transcoding on mobile + Xamarin (Android and iOS)
Summary
EXIF information as Matrix tags are lost on output video after a downsample transcoding on mobile using Xamarin.
Minimal project and steps to reproduce
This simple project basically allows the user to record a video and then share it. Before the user can share the video then, we downsample it to minimize the size of the file to transfer. To do the downsample we transcode the video using LibVLCSharp.
Example source code https://github.com/johnn82/libvlctest
- Run the application either on a Android or iOS phone (real device)
- Tap on the "Take Video" button
- Capture a video (using front camera o back camera) and then confirm
- Tap "Ok" on the dialog saying a transcoding will be done
- Try to share the transcoded video on whatsapp (or any other app) When sharing you can usually see a preview of the video.
- The video is wrongly rotated
What is the current bug behavior?
During transcoding EXIF tags Matrix are lost so the (any) player is unable to understand how to properly rotate the video recorded using a mobile device and then transcoding it.
Apperently the video is "mirrored". It depends if you use the front camera or the back camera.
What is the expected correct behavior?
EXIF tags must be preserved, video must be played in the correct orientation and NOT mirrored.
Does it work on other plaforms? Does it work with the official VLC apps?
The video is wrongly rotated/mirrored also in the official VLC player
Relevant logs and/or screenshots
VLC Log
13-01-21 11:52:35 - libvlc Debug: VLC media player - 3.0.9 Vetinari
13-01-21 11:52:35 - libvlc Debug: configured with /Users/Martz/Projects/vlckit/libvlc/vlc/configure '--prefix=/Users/Martz/Projects/vlckit/libvlc/vlc/install-iPhoneOS/arm64' '--host=aarch64-apple-darwin14' '--with-contrib=/Users/Martz/Projects/vlckit/libvlc/vlc/contrib/iPhone-aarch64-apple-darwin14-aarch64' '--enable-static' '--enable-dvbpsi' '--enable-avcodec' '--disable-macosx' '--disable-macosx-qtkit' '--disable-macosx-avfoundation' '--disable-shared' '--enable-opus' '--disable-faad' '--disable-lua' '--disable-a52' '--enable-fribidi' '--disable-qt' '--disable-skins2' '--disable-vcd' '--disable-vlc' '--disable-vlm' '--disable-nls' '--disable-sse' '--disable-notify' '--enable-live555' '--enable-realrtsp' '--enable-swscale' '--disable-projectm' '--enable-libass' '--enable-libxml2' '--disable-goom' '--disable-dvdread' '--disable-dvdnav' '--disable-bluray' '--disable-linsys' '--disable-libva' '--disable-gme' '--disable-tremor' '--enable-vorbis' '--disable-fluidsynth' '--disable-jack' '--disable-pulse' '--disable-mtp' '--enable-ogg' '--enable-speex' '--enable-theora' '--enable-flac' '--disable-screen' '--enable-freetype' '--enable-taglib' '--enable-smb2' '--disable-mmx' '--disable-sparkle' '--disable-addonmanagermodules' '--disable-mad' 'host_alias=aarch64-apple-darwin14' 'CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk -arch arm64 -O3 -g -miphoneos-version-min=8.4 -DNDEBUG' 'LDFLAGS=-arch arm64 -Wl,-ios_version_min,8.4' 'CPPFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk -arch arm64 -O3 -g -miphoneos-version-min=8.4' 'CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++' 'CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk -arch arm64 -O3 -g -miphoneos-version-min=8.4' 'OBJC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'OBJCFLAGS=-O3 -g' 'CCAS=gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'PKG_CONFIG_PATH='
13-01-21 11:52:35 - libvlc Debug: revision 3.0.8-262-gb7d4bd2972
13-01-21 11:52:35 - libvlc Debug: Copyright © 1996-2019 the VideoLAN team
13-01-21 11:53:01 - libvlc Debug: Creating an input for preparsing 'video_20210113175248_1610560381048.mov'
13-01-21 11:53:01 - libvlc Debug: looking for meta fetcher module matching "any": 0 candidates
13-01-21 11:53:01 - libvlc Debug: no meta fetcher modules
13-01-21 11:53:01 - libvlc Debug: looking for art finder module matching "any": 1 candidates
13-01-21 11:53:01 - libvlc Debug: no art finder modules matched
13-01-21 11:54:21 - Starting transcoding...
13-01-21 11:54:21 - libvlc Error: option marq-color does not exist
13-01-21 11:54:21 - libvlc Error: option marq-opacity does not exist
13-01-21 11:54:21 - libvlc Error: option marq-position does not exist
13-01-21 11:54:21 - libvlc Error: option marq-refresh does not exist
13-01-21 11:54:21 - libvlc Error: option marq-size does not exist
13-01-21 11:54:21 - libvlc Error: option marq-timeout does not exist
13-01-21 11:54:21 - libvlc Error: option marq-x does not exist
13-01-21 11:54:21 - libvlc Error: option marq-y does not exist
13-01-21 11:54:21 - libvlc Debug: creating audio output
13-01-21 11:54:21 - libvlc Debug: looking for audio output module matching "any": 4 candidates
13-01-21 11:54:21 - libvlc Error: option audiounit_ios-gain does not exist
13-01-21 11:54:21 - libvlc Debug: using audio output module "audiounit_ios"
13-01-21 11:54:21 - libvlc Debug: keeping audio output
13-01-21 11:54:21 - libvlc Debug: Creating an input for 'video_20210113175248_1610560381048.mov'
13-01-21 11:54:21 - libvlc Debug: using sout chain=`transcode{vcodec=h264,venc={module=avcodec{codec=h264_videotoolbox}, vcodec=h264},vb=2048,scale=auto,acodec=mp4a,ab=96,channels=2,samplerate=44100,scodec=none}:std{access=file,mux=mp4,dst=/private/var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/tmp/tmp3c07cb56.mp4}'
13-01-21 11:54:21 - libvlc Debug: stream=`std'
13-01-21 11:54:21 - libvlc Debug: looking for sout stream module matching "std": 20 candidates
13-01-21 11:54:21 - libvlc Debug: set config option: sout-standard-access to file
13-01-21 11:54:21 - libvlc Debug: set config option: sout-standard-mux to mp4
13-01-21 11:54:21 - libvlc Debug: set config option: sout-standard-dst to /private/var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/tmp/tmp3c07cb56.mp4
13-01-21 11:54:21 - libvlc Debug: looking for sout access module matching "file": 7 candidates
13-01-21 11:54:21 - libvlc Debug: file access output opened (/private/var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/tmp/tmp3c07cb56.mp4)
13-01-21 11:54:21 - libvlc Debug: using sout access module "file"
13-01-21 11:54:21 - libvlc Debug: looking for sout mux module matching "mp4": 11 candidates
13-01-21 11:54:21 - libvlc Debug: Mp4 muxer opened
13-01-21 11:54:21 - libvlc Debug: using sout mux module "mp4"
13-01-21 11:54:21 - libvlc Debug: using `file/mp4:///private/var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/tmp/tmp3c07cb56.mp4'
13-01-21 11:54:21 - libvlc Debug: using sout stream module "stream_out_standard"
13-01-21 11:54:21 - libvlc Debug: stream=`transcode'
13-01-21 11:54:21 - libvlc Debug: set config option: sout-transcode-vcodec to h264
13-01-21 11:54:21 - libvlc Warning: option venc is unknown
13-01-21 11:54:21 - libvlc Debug: looking for sout stream module matching "transcode": 20 candidates
13-01-21 11:54:21 - libvlc Debug: set config option: sout-transcode-acodec to mp4a
13-01-21 11:54:21 - libvlc Debug: set config option: sout-transcode-ab to 96
13-01-21 11:54:21 - libvlc Debug: set config option: sout-transcode-channels to 2
13-01-21 11:54:21 - libvlc Debug: set config option: sout-transcode-samplerate to 44100
13-01-21 11:54:21 - libvlc Debug: set config option: sout-transcode-scodec to none
13-01-21 11:54:21 - libvlc Debug: Checking codec mapping for mp4a got mp4a
13-01-21 11:54:21 - libvlc Debug: codec audio=mp4a 44100Hz 2 channels 96Kb/s
13-01-21 11:54:21 - libvlc Debug: Checking spu codec mapping for none got none
13-01-21 11:54:21 - libvlc Debug: codec spu=none
13-01-21 11:54:21 - libvlc Debug: using sout stream module "stream_out_transcode"
13-01-21 11:54:21 - libvlc Debug: using timeshift granularity of 50 MiB
13-01-21 11:54:21 - libvlc Debug: using default timeshift path
13-01-21 11:54:21 - libvlc Debug: `file:///var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/Documents/video_20210113175248_1610560381048.mov' gives access `file' demux `any' path `/var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/Documents/video_20210113175248_1610560381048.mov'
13-01-21 11:54:21 - libvlc Debug: creating demux: access='file' demux='any' location='/var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/Documents/video_20210113175248_1610560381048.mov' file='/var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/Documents/video_20210113175248_1610560381048.mov'
13-01-21 11:54:21 - libvlc Debug: looking for access_demux module matching "file": 4 candidates
13-01-21 11:54:21 - libvlc Debug: no access_demux modules matched
13-01-21 11:54:21 - libvlc Debug: creating access: file:///var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/Documents/video_20210113175248_1610560381048.mov
13-01-21 11:54:21 - libvlc Debug: (path: /var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/Documents/video_20210113175248_1610560381048.mov)
13-01-21 11:54:21 - libvlc Debug: looking for access module matching "file": 20 candidates
13-01-21 11:54:21 - libvlc Debug: using access module "filesystem"
13-01-21 11:54:21 - libvlc Debug: looking for stream_filter module matching "prefetch,cache_read": 25 candidates
13-01-21 11:54:21 - libvlc Debug: Using stream method for AStream*
13-01-21 11:54:21 - libvlc Debug: starting pre-buffering
13-01-21 11:54:21 - libvlc Debug: received first data after 0 ms
13-01-21 11:54:21 - libvlc Debug: pre-buffering done 1024 bytes in 0s - 8474 KiB/s
13-01-21 11:54:21 - libvlc Debug: using stream_filter module "cache_read"
13-01-21 11:54:21 - libvlc Debug: looking for stream_filter module matching "any": 25 candidates
13-01-21 11:54:21 - libvlc Debug: no stream_filter modules matched
13-01-21 11:54:21 - libvlc Debug: looking for stream_directory module matching "any": 1 candidates
13-01-21 11:54:21 - libvlc Debug: no stream_directory modules matched
13-01-21 11:54:21 - libvlc Debug: attachment of directory-extractor failed for file:///var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/Documents/video_20210113175248_1610560381048.mov
13-01-21 11:54:21 - libvlc Debug: looking for stream_filter module matching "record": 25 candidates
13-01-21 11:54:21 - libvlc Debug: using stream_filter module "record"
13-01-21 11:54:21 - libvlc Debug: creating demux: access='file' demux='any' location='/var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/Documents/video_20210113175248_1610560381048.mov' file='/var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/Documents/video_20210113175248_1610560381048.mov'
13-01-21 11:54:21 - libvlc Debug: looking for demux module matching "mp4": 46 candidates
13-01-21 11:54:21 - libvlc Debug: set config option: sout-transcode-vb to 2048
13-01-21 11:54:21 - libvlc Warning: unknown box type mp4a (incompletely loaded)
13-01-21 11:54:21 - libvlc Warning: unknown box type cdsc (incompletely loaded)
13-01-21 11:54:21 - libvlc Warning: unknown box type cdep (incompletely loaded)
13-01-21 11:54:21 - libvlc Warning: unknown box type gmin (incompletely loaded)
13-01-21 11:54:21 - libvlc Warning: unknown handler type in stsd (incompletely loaded)
13-01-21 11:54:21 - libvlc Warning: unknown box type cdsc (incompletely loaded)
13-01-21 11:54:21 - libvlc Warning: unknown box type cdep (incompletely loaded)
13-01-21 11:54:21 - libvlc Warning: unknown box type gmin (incompletely loaded)
13-01-21 11:54:21 - libvlc Warning: unknown handler type in stsd (incompletely loaded)
13-01-21 11:54:21 - libvlc Warning: unknown box type cdsc (incompletely loaded)
13-01-21 11:54:21 - libvlc Warning: unknown box type cdep (incompletely loaded)
13-01-21 11:54:21 - libvlc Warning: unknown box type gmin (incompletely loaded)
13-01-21 11:54:21 - libvlc Warning: unknown handler type in stsd (incompletely loaded)
13-01-21 11:54:21 - libvlc Debug: dumping root Box "root"
13-01-21 11:54:21 - libvlc Debug: | + ftyp size 20 offset 0
13-01-21 11:54:21 - libvlc Debug: | + wide size 8 offset 20
13-01-21 11:54:21 - libvlc Debug: | + mdat size 10687097 offset 28
13-01-21 11:54:21 - libvlc Debug: | + moov size 8986 offset 10687125
13-01-21 11:54:21 - libvlc Debug: | | + mvhd size 108 offset 10687133
13-01-21 11:54:21 - libvlc Debug: | | + trak size 1751 offset 10687241
13-01-21 11:54:21 - libvlc Debug: | | | + tkhd size 92 offset 10687249
13-01-21 11:54:21 - libvlc Debug: | | | + tapt size 68 offset 10687341 (????)
13-01-21 11:54:21 - libvlc Debug: | | | + edts size 36 offset 10687409
13-01-21 11:54:21 - libvlc Debug: | | | | + elst size 28 offset 10687417
13-01-21 11:54:21 - libvlc Debug: | | | + mdia size 1547 offset 10687445
13-01-21 11:54:21 - libvlc Debug: | | | | + mdhd size 32 offset 10687453
13-01-21 11:54:21 - libvlc Debug: | | | | + hdlr size 49 offset 10687485
13-01-21 11:54:21 - libvlc Debug: | | | | + minf size 1458 offset 10687534
13-01-21 11:54:21 - libvlc Debug: | | | | | + vmhd size 20 offset 10687542
13-01-21 11:54:21 - libvlc Debug: | | | | | + hdlr size 56 offset 10687562
13-01-21 11:54:21 - libvlc Debug: | | | | | + dinf size 36 offset 10687618
13-01-21 11:54:21 - libvlc Debug: | | | | | | + dref size 28 offset 10687626
13-01-21 11:54:21 - libvlc Debug: | | | | | | | + alis size 12 offset 10687642
13-01-21 11:54:21 - libvlc Debug: | | | | | + stbl size 1338 offset 10687654
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsd size 306 offset 10687662
13-01-21 11:54:21 - libvlc Debug: | | | | | | | + avc1 size 290 offset 10687678
13-01-21 11:54:21 - libvlc Debug: | | | | | | | | + avcC size 182 offset 10687764
13-01-21 11:54:21 - libvlc Debug: | | | | | | | | + colr size 18 offset 10687946
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stts size 24 offset 10687968
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stss size 40 offset 10687992
13-01-21 11:54:21 - libvlc Debug: | | | | | | + sdtp size 172 offset 10688032
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsz size 660 offset 10688268
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsc size 64 offset 10688204
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stco size 64 offset 10688928
13-01-21 11:54:21 - libvlc Debug: | | + trak size 1714 offset 10688992
13-01-21 11:54:21 - libvlc Debug: set config option: sout-transcode-scale to auto
13-01-21 11:54:21 - libvlc Debug: | | | + tkhd size 92 offset 10689000
13-01-21 11:54:21 - libvlc Debug: | | | + edts size 36 offset 10689092
13-01-21 11:54:21 - libvlc Debug: | | | | + elst size 28 offset 10689100
13-01-21 11:54:21 - libvlc Debug: | | | + mdia size 1578 offset 10689128
13-01-21 11:54:21 - libvlc Debug: | | | | + mdhd size 32 offset 10689136
13-01-21 11:54:21 - libvlc Debug: | | | | + hdlr size 49 offset 10689168
13-01-21 11:54:21 - libvlc Debug: | | | | + minf size 1489 offset 10689217
13-01-21 11:54:21 - libvlc Debug: | | | | | + smhd size 16 offset 10689225
13-01-21 11:54:21 - libvlc Debug: | | | | | + hdlr size 56 offset 10689241
13-01-21 11:54:21 - libvlc Debug: | | | | | + dinf size 36 offset 10689297
13-01-21 11:54:21 - libvlc Debug: | | | | | | + dref size 28 offset 10689305
13-01-21 11:54:21 - libvlc Debug: | | | | | | | + alis size 12 offset 10689321
13-01-21 11:54:21 - libvlc Debug: | | | | | + stbl size 1373 offset 10689333
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsd size 159 offset 10689341
13-01-21 11:54:21 - libvlc Debug: | | | | | | | + mp4a size 143 offset 10689357
13-01-21 11:54:21 - libvlc Debug: | | | | | | | | + wave size 91 offset 10689409
13-01-21 11:54:21 - libvlc Debug: | | | | | | | | | + frma size 12 offset 10689417
13-01-21 11:54:21 - libvlc Debug: | | | | | | | | | + mp4a size 12 offset 10689429 (????)
13-01-21 11:54:21 - libvlc Debug: | | | | | | | | | + esds size 51 offset 10689441
13-01-21 11:54:21 - libvlc Debug: | | | | | | + sgpd size 26 offset 10689500
13-01-21 11:54:21 - libvlc Debug: | | | | | | + sbgp size 28 offset 10689526
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stts size 24 offset 10689554
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsc size 124 offset 10689578
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsz size 948 offset 10689702
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stco size 56 offset 10690650
13-01-21 11:54:21 - libvlc Debug: | | + trak size 625 offset 10690706
13-01-21 11:54:21 - libvlc Debug: | | | + tkhd size 92 offset 10690714
13-01-21 11:54:21 - libvlc Debug: | | | + edts size 36 offset 10690806
13-01-21 11:54:21 - libvlc Debug: | | | | + elst size 28 offset 10690814
13-01-21 11:54:21 - libvlc Debug: | | | + tref size 32 offset 10690842
13-01-21 11:54:21 - libvlc Debug: | | | | + cdep size 12 offset 10690862 (????)
13-01-21 11:54:21 - libvlc Warning: unknown box type tapt (incompletely loaded)
13-01-21 11:54:21 - libvlc Debug: | | | + mdia size 457 offset 10690874
13-01-21 11:54:21 - libvlc Debug: | | | | + mdhd size 32 offset 10690882
13-01-21 11:54:21 - libvlc Debug: | | | | + hdlr size 52 offset 10690914
13-01-21 11:54:21 - libvlc Debug: | | | | + minf size 365 offset 10690966
13-01-21 11:54:21 - libvlc Debug: | | | | | + gmhd size 32 offset 10690974
13-01-21 11:54:21 - libvlc Debug: | | | | | | + gmin size 24 offset 10690982 (????)
13-01-21 11:54:21 - libvlc Debug: | | | | | + hdlr size 56 offset 10691006
13-01-21 11:54:21 - libvlc Debug: | | | | | + dinf size 36 offset 10691062
13-01-21 11:54:21 - libvlc Debug: | | | | | | + dref size 28 offset 10691070
13-01-21 11:54:21 - libvlc Debug: | | | | | | | + alis size 12 offset 10691086
13-01-21 11:54:21 - libvlc Debug: | | | | | + stbl size 233 offset 10691098
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsd size 133 offset 10691106
13-01-21 11:54:21 - libvlc Debug: | | | | | | | + mebx size 117 offset 10691122
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stts size 24 offset 10691239
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsc size 28 offset 10691263
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsz size 20 offset 10691291
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stco size 20 offset 10691311
13-01-21 11:54:21 - libvlc Debug: | | + trak size 1070 offset 10691331
13-01-21 11:54:21 - libvlc Debug: | | | + tkhd size 92 offset 10691339
13-01-21 11:54:21 - libvlc Debug: | | | + edts size 36 offset 10691431
13-01-21 11:54:21 - libvlc Debug: | | | | + cdsc size 12 offset 10690850 (????)
13-01-21 11:54:21 - libvlc Debug: | | | | + elst size 28 offset 10691439
13-01-21 11:54:21 - libvlc Debug: | | | + tref size 32 offset 10691467
13-01-21 11:54:21 - libvlc Debug: | | | | + cdsc size 12 offset 10691475 (????)
13-01-21 11:54:21 - libvlc Debug: | | | | + cdep size 12 offset 10691487 (????)
13-01-21 11:54:21 - libvlc Debug: | | | + mdia size 902 offset 10691499
13-01-21 11:54:21 - libvlc Debug: | | | | + mdhd size 32 offset 10691507
13-01-21 11:54:21 - libvlc Debug: | | | | + hdlr size 52 offset 10691539
13-01-21 11:54:21 - libvlc Debug: | | | | + minf size 810 offset 10691591
13-01-21 11:54:21 - libvlc Debug: | | | | | + gmhd size 32 offset 10691599
13-01-21 11:54:21 - libvlc Debug: | | | | | | + gmin size 24 offset 10691607 (????)
13-01-21 11:54:21 - libvlc Debug: | | | | | + hdlr size 56 offset 10691631
13-01-21 11:54:21 - libvlc Debug: | | | | | + dinf size 36 offset 10691687
13-01-21 11:54:21 - libvlc Debug: | | | | | | + dref size 28 offset 10691695
13-01-21 11:54:21 - libvlc Debug: | | | | | | | + alis size 12 offset 10691711
13-01-21 11:54:21 - libvlc Debug: | | | | | + stbl size 678 offset 10691723
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsd size 578 offset 10691731
13-01-21 11:54:21 - libvlc Debug: | | | | | | | + mebx size 562 offset 10691747
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stts size 24 offset 10692309
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsc size 28 offset 10692333
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsz size 20 offset 10692361
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stco size 20 offset 10692381
13-01-21 11:54:21 - libvlc Debug: | | + trak size 1142 offset 10692401
13-01-21 11:54:21 - libvlc Debug: | | | + tkhd size 92 offset 10692409
13-01-21 11:54:21 - libvlc Debug: | | | + edts size 36 offset 10692501
13-01-21 11:54:21 - libvlc Debug: | | | | + elst size 28 offset 10692509
13-01-21 11:54:21 - libvlc Debug: | | | + tref size 32 offset 10692537
13-01-21 11:54:21 - libvlc Debug: | | | | + cdsc size 12 offset 10692545 (????)
13-01-21 11:54:21 - libvlc Debug: | | | | + cdep size 12 offset 10692557 (????)
13-01-21 11:54:21 - libvlc Debug: | | | + mdia size 974 offset 10692569
13-01-21 11:54:21 - libvlc Debug: | | | | + mdhd size 32 offset 10692577
13-01-21 11:54:21 - libvlc Debug: | | | | + hdlr size 52 offset 10692609
13-01-21 11:54:21 - libvlc Debug: | | | | + minf size 882 offset 10692661
13-01-21 11:54:21 - libvlc Debug: | | | | | + gmhd size 32 offset 10692669
13-01-21 11:54:21 - libvlc Debug: | | | | | | + gmin size 24 offset 10692677 (????)
13-01-21 11:54:21 - libvlc Debug: | | | | | + hdlr size 56 offset 10692701
13-01-21 11:54:21 - libvlc Debug: | | | | | + dinf size 36 offset 10692757
13-01-21 11:54:21 - libvlc Debug: | | | | | | + dref size 28 offset 10692765
13-01-21 11:54:21 - libvlc Debug: | | | | | | | + alis size 12 offset 10692781
13-01-21 11:54:21 - libvlc Debug: | | | | | + stbl size 750 offset 10692793
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsd size 598 offset 10692801
13-01-21 11:54:21 - libvlc Debug: | | | | | | | + mebx size 582 offset 10692817
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stts size 24 offset 10693399
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsc size 40 offset 10693423
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stsz size 20 offset 10693463
13-01-21 11:54:21 - libvlc Debug: | | | | | | + stco size 60 offset 10693483
13-01-21 11:54:21 - libvlc Debug: | | + udta size 8 offset 10693543
13-01-21 11:54:21 - libvlc Debug: | | + free size 1024 offset 10693551
13-01-21 11:54:21 - libvlc Debug: | | + meta size 1368 offset 10694575
13-01-21 11:54:21 - libvlc Debug: | | | + hdlr size 34 offset 10694583
13-01-21 11:54:21 - libvlc Debug: | | | + keys size 157 offset 10694617
13-01-21 11:54:21 - libvlc Debug: | | | + ilst size 145 offset 10694774
13-01-21 11:54:21 - libvlc Debug: | | | | + data size 21 offset 10694790
13-01-21 11:54:21 - libvlc Debug: | | | | + data size 24 offset 10694819
13-01-21 11:54:21 - libvlc Debug: | | | | + data size 20 offset 10694851
13-01-21 11:54:21 - libvlc Debug: | | | | + data size 40 offset 10694879
13-01-21 11:54:21 - libvlc Debug: | | | + free size 1024 offset 10694919
13-01-21 11:54:21 - libvlc Debug: | | + free size 168 offset 10695943
13-01-21 11:54:21 - libvlc Debug: Apple QuickTime media
13-01-21 11:54:21 - libvlc Debug: found 5 tracks
13-01-21 11:54:21 - libvlc Warning: elst box found
13-01-21 11:54:21 - libvlc Debug: - [0] duration=5333ms media time=0ms) rate=1.0
13-01-21 11:54:21 - libvlc Debug: track[Id 0x1] read 12 chunk
13-01-21 11:54:21 - libvlc Warning: STTS table of 1 entries
13-01-21 11:54:21 - libvlc Debug: track[Id 0x1] read 160 samples length:5s
13-01-21 11:54:21 - libvlc Debug: selecting program id=0
13-01-21 11:54:21 - libvlc Debug: adding track[Id 0x1] video (enable) language undef
13-01-21 11:54:21 - libvlc Warning: elst box found
13-01-21 11:54:21 - libvlc Debug: - [0] duration=5331ms media time=47ms) rate=1.0
13-01-21 11:54:21 - libvlc Debug: track[Id 0x2] read 10 chunk
13-01-21 11:54:21 - libvlc Warning: STTS table of 1 entries
13-01-21 11:54:21 - libvlc Debug: track[Id 0x2] read 232 samples length:5s
13-01-21 11:54:21 - libvlc Debug: adding track[Id 0x2] audio (enable) language undef
13-01-21 11:54:21 - libvlc Debug: ignoring track[Id 0x3]
13-01-21 11:54:21 - libvlc Debug: ignoring track[Id 0x4]
13-01-21 11:54:21 - libvlc Debug: using demux module "mp4"
13-01-21 11:54:21 - libvlc Debug: looking for a subtitle file in /var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/Documents/
13-01-21 11:54:21 - libvlc Debug: looking for packetizer module matching "any": 25 candidates
13-01-21 11:54:21 - libvlc Debug: found NAL_SPS (sps_id=0)
13-01-21 11:54:21 - libvlc Debug: found NAL_PPS (pps_id=0 sps_id=0)
13-01-21 11:54:21 - libvlc Debug: Packetizer fed with AVC, nal length size=4
13-01-21 11:54:21 - libvlc Debug: using packetizer module "h264"
13-01-21 11:54:21 - libvlc Debug: looking for packetizer module matching "any": 25 candidates
13-01-21 11:54:21 - libvlc Debug: running MPEG4 audio packetizer
13-01-21 11:54:21 - libvlc Debug: HE-AACv2 88200Hz 1024 samples/frame
13-01-21 11:54:21 - libvlc Debug: using packetizer module "mpeg4audio"
13-01-21 11:54:21 - libvlc Debug: starting in sync mode
13-01-21 11:54:21 - libvlc Debug: looking for meta reader module matching "any": 1 candidates
13-01-21 11:54:21 - libvlc Debug: no meta reader modules matched
13-01-21 11:54:21 - libvlc Debug: `file:///var/mobile/Containers/Data/Application/8EFB99E2-8049-474E-98E7-373ED332D072/Documents/video_20210113175248_1610560381048.mov' successfully opened
13-01-21 11:54:21 - libvlc Debug: elst (0) gives 0ms (movie)-> 0ms (track)
13-01-21 11:54:21 - libvlc Debug: track[Id 0x1] using Sync Sample Box (stss)
13-01-21 11:54:21 - libvlc Debug: stss gives 0 --> 0 (sample number)
13-01-21 11:54:21 - libvlc Debug: elst (0) gives 0ms (movie)-> 47ms (track)
13-01-21 11:54:21 - libvlc Debug: Buffering 0%
13-01-21 11:54:21 - libvlc Debug: switching to async mode
13-01-21 11:54:21 - libvlc Debug: ignoring track[Id 0x5]
13-01-21 11:54:21 - libvlc Debug: adding a new sout input for `h264` (sout_input: 0x282c96250)
13-01-21 11:54:21 - libvlc Debug: trying configuration venc={module=avcodec{codec=h264_videotoolbox}, vcodec=h264}
13-01-21 11:54:21 - libvlc Debug: set config option: sout-transcode-module to avcodec{codec=h264_videotoolbox}
13-01-21 11:54:21 - libvlc Debug: set config option: sout-transcode-vcodec to h264
13-01-21 11:54:21 - libvlc Debug: Checking video codec mapping for h264 got h264
13-01-21 11:54:21 - libvlc Debug: creating video transcoding from fcc=`h264' to fcc=`h264'
13-01-21 11:54:21 - libvlc Debug: looking for video decoder module matching "any": 12 candidates
13-01-21 11:54:21 - libvlc Debug: new PPS parsed: 0
13-01-21 11:54:21 - libvlc Warning: forcing CVPX format: 420v
13-01-21 11:54:21 - libvlc Debug: adding a new sout input for `mp4a` (sout_input: 0x282c96320)
13-01-21 11:54:21 - libvlc Debug: new SPS parsed: 0
13-01-21 11:54:21 - libvlc Debug: Buffering 25%
13-01-21 11:54:21 - libvlc Debug: Buffering 50%
13-01-21 11:54:21 - libvlc Notice: Using Video Toolbox to decode 'h264'
13-01-21 11:54:21 - libvlc Debug: using video decoder module "videotoolbox"
13-01-21 11:54:21 - libvlc Debug: looking for encoder module matching "avcodec": 15 candidates
13-01-21 11:54:21 - libvlc Debug: using ffmpeg Lavc58.6.103
13-01-21 11:54:21 - libvlc Error: option quiet does not exist
13-01-21 11:54:21 - libvlc Debug: CPU flags: 0x00000068
13-01-21 11:54:21 - libvlc Debug: Buffering 75%
13-01-21 11:54:21 - libvlc Debug: set config option: sout-avcodec-codec to h264_videotoolbox
13-01-21 11:54:21 - libvlc Debug: Time base for probing set to 1000/25000
13-01-21 11:54:21 - libvlc Debug: Time base set to 1000/25000
13-01-21 11:54:21 - libvlc Debug: rc buffer size 8192000 bits
13-01-21 11:54:21 - libvlc Debug: Buffering 100%
13-01-21 11:54:21 - libvlc Debug: Stream buffering done (1250 ms in 73 ms)
13-01-21 11:54:21 - libvlc Error: Unknown option "border_mask"
13-01-21 11:54:21 - libvlc Error: Unknown option "noise_reduction"
13-01-21 11:54:21 - libvlc Error: Unknown option "lmin"
13-01-21 11:54:21 - libvlc Error: Unknown option "lmax"
13-01-21 11:54:21 - libvlc Error: Unknown option "qsquish"
13-01-21 11:54:21 - libvlc Error: Unknown option "rc_buffer_aggressivity"
13-01-21 11:54:21 - libvlc Debug: found encoder H264 - MPEG-4 AVC (part 10)
13-01-21 11:54:21 - libvlc Debug: using encoder module "avcodec"
13-01-21 11:54:21 - libvlc Debug: removing module "avcodec"
13-01-21 11:54:21 - libvlc Notice: using venc={module=avcodec{codec=h264_videotoolbox}, vcodec=h264} configuration for transcoding
13-01-21 11:54:21 - libvlc Debug: creating audio transcoding from fcc=`mp4a' to fcc=`mp4a'
13-01-21 11:54:21 - libvlc Debug: looking for audio decoder module matching "any": 16 candidates
13-01-21 11:54:21 - libvlc Debug: using ffmpeg Lavc58.6.103
13-01-21 11:54:21 - libvlc Error: option quiet does not exist
13-01-21 11:54:21 - libvlc Debug: CPU flags: 0x00000068
13-01-21 11:54:21 - libvlc Debug: codec (aac) started
13-01-21 11:54:21 - libvlc Debug: using audio decoder module "avcodec"
13-01-21 11:54:21 - libvlc Debug: looking for encoder module matching "any": 15 candidates
13-01-21 11:54:21 - libvlc Debug: using ffmpeg Lavc58.6.103
13-01-21 11:54:21 - libvlc Error: option quiet does not exist
13-01-21 11:54:21 - libvlc Debug: CPU flags: 0x00000068
13-01-21 11:54:21 - libvlc Debug: Trying to find packet sample format instead of planar fltp
13-01-21 11:54:21 - libvlc Debug: Ended up using fltp as sample format
13-01-21 11:54:21 - libvlc Debug: Creating channel order for reordering
13-01-21 11:54:21 - libvlc Debug: 0 1 mapped to 2
13-01-21 11:54:21 - libvlc Debug: using encoder module "avcodec"
13-01-21 11:54:21 - libvlc Debug: input 'f32l' 44100 Hz Mono frame=1 samples/4 bytes
13-01-21 11:54:21 - libvlc Debug: conversion: 'f32l'->'f32l' 44100 Hz->44100 Hz Mono->Stereo
13-01-21 11:54:21 - libvlc Debug: looking for audio converter module matching "any": 7 candidates
13-01-21 11:54:21 - libvlc Debug: using audio converter module "trivial"
13-01-21 11:54:21 - libvlc Debug: conversion pipeline complete
13-01-21 11:54:21 - libvlc Debug: looking for audio resampler module matching "any": 2 candidates
13-01-21 11:54:21 - libvlc Debug: using audio resampler module "ugly"
13-01-21 11:54:21 - libvlc Debug: removing module "avcodec"
13-01-21 11:54:21 - libvlc Debug: removing module "ugly"
13-01-21 11:54:21 - libvlc Debug: removing module "trivial"
13-01-21 11:54:21 - libvlc Debug: 1 2 mapped to 4
13-01-21 11:54:21 - libvlc Debug: found encoder MPEG AAC Audio
13-01-21 11:54:21 - libvlc Debug: Decoder wait done in 100 ms
13-01-21 11:54:21 - libvlc Debug: looking for encoder module matching "any": 15 candidates
13-01-21 11:54:21 - libvlc Debug: using ffmpeg Lavc58.6.103
13-01-21 11:54:21 - libvlc Error: option quiet does not exist
13-01-21 11:54:21 - libvlc Debug: CPU flags: 0x00000068
13-01-21 11:54:21 - libvlc Debug: Trying to find packet sample format instead of planar fltp
13-01-21 11:54:21 - libvlc Debug: Ended up using fltp as sample format
13-01-21 11:54:21 - libvlc Debug: Creating channel order for reordering
13-01-21 11:54:21 - libvlc Debug: 0 1 mapped to 2
13-01-21 11:54:21 - libvlc Debug: 1 2 mapped to 4
13-01-21 11:54:21 - libvlc Debug: found encoder MPEG AAC Audio
13-01-21 11:54:21 - libvlc Debug: using encoder module "avcodec"
13-01-21 11:54:21 - libvlc Debug: input 'f32l' 44100 Hz Mono frame=1 samples/4 bytes
13-01-21 11:54:21 - libvlc Debug: conversion: 'f32l'->'f32l' 44100 Hz->44100 Hz Mono->Stereo
13-01-21 11:54:21 - libvlc Debug: looking for audio converter module matching "any": 7 candidates
13-01-21 11:54:21 - libvlc Debug: using audio converter module "trivial"
13-01-21 11:54:21 - libvlc Debug: conversion pipeline complete
13-01-21 11:54:21 - libvlc Debug: looking for audio resampler module matching "any": 2 candidates
13-01-21 11:54:21 - libvlc Debug: using audio resampler module "ugly"
13-01-21 11:54:21 - libvlc Debug: adding a new input
13-01-21 11:54:21 - libvlc Debug: adding input
13-01-21 11:54:21 - libvlc Notice: vt cvpx chroma: 420v
13-01-21 11:54:21 - libvlc Debug: Checking if filter chain CVPN -> NV12 is possible
13-01-21 11:54:21 - libvlc Debug: looking for video converter module matching "any": 15 candidates
13-01-21 11:54:21 - libvlc Debug: using video converter module "cvpx"
13-01-21 11:54:21 - libvlc Debug: Filter 'cvpx' (0x1111107f0) appended to chain
13-01-21 11:54:21 - libvlc Debug: removing module "cvpx"
13-01-21 11:54:21 - libvlc Debug: Filter 0x1111107f0 removed from chain
13-01-21 11:54:21 - libvlc Debug: Filter chain testing done, input chroma CVPN seems to be possible for transcode
13-01-21 11:54:21 - libvlc Debug: source fps 30/1, destination 30/1
13-01-21 11:54:21 - libvlc Debug: decoder aspect is 1.764706:1
13-01-21 11:54:21 - libvlc Debug: source pixel aspect is 0.992647:1
13-01-21 11:54:21 - libvlc Debug: scaled pixel aspect is 0.992647:1
13-01-21 11:54:21 - libvlc Debug: source 1920x1080, destination 1920x1080
13-01-21 11:54:21 - libvlc Debug: source chroma: CVPN, destination NV12
13-01-21 11:54:21 - libvlc Debug: looking for video converter module matching "any": 15 candidates
13-01-21 11:54:21 - libvlc Debug: encoder aspect is 1920:1088
13-01-21 11:54:21 - libvlc Debug: using video converter module "cvpx"
13-01-21 11:54:21 - libvlc Debug: Filter 'cvpx' (0x110d17450) appended to chain
13-01-21 11:54:21 - libvlc Debug: destination (after video filters) 1920x1088
13-01-21 11:54:21 - libvlc Debug: looking for encoder module matching "avcodec": 15 candidates
13-01-21 11:54:21 - libvlc Debug: using ffmpeg Lavc58.6.103
13-01-21 11:54:21 - libvlc Error: option quiet does not exist
13-01-21 11:54:21 - libvlc Debug: CPU flags: 0x00000068
13-01-21 11:54:21 - libvlc Debug: set config option: sout-avcodec-codec to h264_videotoolbox
13-01-21 11:54:21 - libvlc Debug: Time base for probing set to 1/30
13-01-21 11:54:21 - libvlc Debug: Time base set to 1/30
13-01-21 11:54:21 - libvlc Debug: rc buffer size 8192000 bits
13-01-21 11:54:21 - libvlc Error: Unknown option "border_mask"
13-01-21 11:54:21 - libvlc Error: Unknown option "noise_reduction"
13-01-21 11:54:21 - libvlc Error: Unknown option "lmin"
13-01-21 11:54:21 - libvlc Error: Unknown option "lmax"
13-01-21 11:54:21 - libvlc Error: Unknown option "qsquish"
13-01-21 11:54:21 - libvlc Error: Unknown option "rc_buffer_aggressivity"
13-01-21 11:54:21 - libvlc Debug: found encoder H264 - MPEG-4 AVC (part 10)
13-01-21 11:54:21 - libvlc Debug: using encoder module "avcodec"
13-01-21 11:54:21 - libvlc Debug: adding a new input
13-01-21 11:54:21 - libvlc Debug: adding input
13-01-21 11:54:22 - libvlc Debug: EOF reached
13-01-21 11:54:22 - libvlc Debug: waiting decoder fifos to empty
13-01-21 11:54:22 - libvlc Debug: killing decoder fourcc `h264'
13-01-21 11:54:22 - libvlc Debug: removing module "h264"
13-01-21 11:54:22 - libvlc Debug: removing a sout input (sout_input: 0x282c96250)
13-01-21 11:54:22 - libvlc Warning: pic_holder_wait timed out
13-01-21 11:54:23 - libvlc Warning: cannot encode one frame
13-01-21 11:54:23 - libvlc Debug: removing module "videotoolbox"
13-01-21 11:54:23 - libvlc Debug: removing module "avcodec"
13-01-21 11:54:23 - libvlc Debug: removing module "cvpx"
13-01-21 11:54:23 - libvlc Debug: Filter 0x110d17450 removed from chain
13-01-21 11:54:23 - libvlc Debug: tk 2 elst media time 0 duration 5200000 offset 14490
13-01-21 11:54:23 - libvlc Debug: removing input
13-01-21 11:54:23 - libvlc Debug: killing decoder fourcc `mp4a'
13-01-21 11:54:23 - libvlc Debug: removing module "mpeg4audio"
13-01-21 11:54:23 - libvlc Debug: removing a sout input (sout_input: 0x282c96320)
13-01-21 11:54:23 - libvlc Debug: Flushing..
13-01-21 11:54:23 - libvlc Warning: cannot encode one frame
13-01-21 11:54:23 - libvlc Debug: Flushing..
13-01-21 11:54:23 - libvlc Warning: cannot encode one frame
13-01-21 11:54:23 - libvlc Debug: removing module "avcodec"
13-01-21 11:54:23 - libvlc Debug: removing module "avcodec"
13-01-21 11:54:23 - libvlc Debug: removing module "ugly"
13-01-21 11:54:23 - libvlc Debug: removing module "trivial"
13-01-21 11:54:23 - libvlc Debug: tk 1 elst media time 0 duration 5340590 offset 0
13-01-21 11:54:23 - libvlc Debug: removing input
13-01-21 11:54:23 - libvlc Warning: no more input streams for this mux
13-01-21 11:54:23 - libvlc Debug: freeing all memory
13-01-21 11:54:23 - libvlc Debug: removing module "mp4"
13-01-21 11:54:23 - libvlc Debug: Program doesn't contain anymore ES
13-01-21 11:54:23 - libvlc Debug: removing module "record"
13-01-21 11:54:23 - libvlc Debug: removing module "cache_read"
13-01-21 11:54:23 - libvlc Debug: removing module "filesystem"
13-01-21 11:54:23 - libvlc Debug: destroying useless sout
13-01-21 11:54:23 - libvlc Debug: destroying chain... (name=transcode)
13-01-21 11:54:23 - libvlc Debug: removing module "stream_out_transcode"
13-01-21 11:54:23 - libvlc Debug: destroying chain done
13-01-21 11:54:23 - libvlc Debug: destroying chain... (name=std)
13-01-21 11:54:23 - libvlc Debug: removing module "stream_out_standard"
13-01-21 11:54:23 - libvlc Debug: removing module "mp4"
13-01-21 11:54:23 - libvlc Debug: Close
13-01-21 11:54:23 - libvlc Debug: movie duration 5s
13-01-21 11:54:23 - libvlc Debug: created 157 chunks (stco)
13-01-21 11:54:23 - libvlc Debug: created 156 chunks (stco)
13-01-21 11:54:23 - Transcoding completed!
Environment
- OS: Android or iOS
- Version
- Device: any iPhone or Android phone
- LibVLCSharp 3.4.9
- LibVLCSharp.Forms 3.4.9
- VideoLAN.LibVLC.Android 3.20
- VideoLAN.LibVLC.iOS 3.3.10
Possible fixes
This is the code used to do the transcoding, it may be wrong.
libvlctest/App5/App5/MainPage.xaml.cs
if (Device.RuntimePlatform == Device.Android)
{
media.AddOption($":sout=#transcode{{vcodec=h264,venc=x264{{cfr=40}},vb=2048,scale=auto,acodec=mp4a,ab=96,channels=2,samplerate=44100}}:std{{access=file,mux=ts,dst={convertedVideoPath}}}");
}
else if (Device.RuntimePlatform == Device.iOS)
{
media.AddOption($":sout=#transcode{{vcodec=h264,venc={{module=avcodec{{codec=h264_videotoolbox}}, vcodec=h264}},vb=2048,scale=auto,acodec=mp4a,ab=96,channels=2,samplerate=44100,scodec=none}}:std{{access=file,mux=mp4,dst={convertedVideoPath}}}");
}