Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: svt-av1 produces invalid file OR libdav1d can't decode it #18721

Closed
Randrianasulu opened this issue Dec 14, 2023 · 11 comments
Closed

[Bug]: svt-av1 produces invalid file OR libdav1d can't decode it #18721

Randrianasulu opened this issue Dec 14, 2023 · 11 comments
Labels
bug report Something is not working properly.

Comments

@Randrianasulu
Copy link

Problem description

Try to encode small video with libsvt-av1 via ffmpeg:

ffmpeg -i 20081103140154.m2t -s 160*120 -c:v libsvtav1 -preset:v 13 av1-1.mkv

resulting file can't be decoded using mpv's default libdav1d decoder:

mpv av1-1.mkv -vo tct --vid=1
 (+) Video --vid=1 (av1 160x120 25.000fps)
 (+) Audio --aid=1 (vorbis 2ch 48000Hz)                                                            Error while decoding frame!
[ffmpeg/video] libdav1d: Error parsing frame header
[ffmpeg/video] libdav1d: Error parsing OBU data
Error while decoding frame!                                                                        [ffmpeg/video] libdav1d: Error parsing OBU data
Error while decoding frame!
[ffmpeg/video] libdav1d: Error parsing frame header
[ffmpeg/video] libdav1d: Error parsing OBU data                                                    Error while decoding frame!                                                                        [ffmpeg/video] libdav1d: Error parsing OBU data

and so on.

it works with libaom decoder

mpv av1-1.mkv -vo tct --vid=1 --vd=libaom-av1
 (+) Video --vid=1 (av1 160x120 25.000fps)
 (+) Audio --aid=1 (vorbis 2ch 48000Hz)

What steps will reproduce the bug?

Encide video with libsvt-av1 via ffmpeg, try to play it with mpv.

What is the expected behavior?

file plays fine

System information

termux-info:

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=25526
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages.termux.org/apt/termux-main stable main
# x11-repo (sources.list.d/x11.list)
deb https://packages.termux.org/apt/termux-x11 x11 main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
Updatable packages:
libopenblas/stable 0.3.25-1 aarch64 [upgradable from: 0.3.25]
libsoxr/stable 0.1.3-5 aarch64 [upgradable from: 0.1.3-4]
sdl2-image/x11 2.8.1 aarch64 [upgradable from: 2.8.0]
xwayland/x11 23.2.3 aarch64 [upgradable from: 23.2.2]
termux-tools version:
1.39.5
Android version:
11
Kernel build information:
Linux localhost 4.14.193 #1 SMP PREEMPT Thu Jul 8 13:58:00 CST 2021 aarch64 Android
Device manufacturer:
DEXP
Device model:
K38
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51

@Randrianasulu Randrianasulu added bug report Something is not working properly. untriaged labels Dec 14, 2023
@Randrianasulu
Copy link
Author

av1-1.webm

test file (plays fine on x86_32 with libdav1d 0.7.1)

@licy183 licy183 removed the untriaged label Dec 14, 2023
@Randrianasulu
Copy link
Author

for some reason self-compiled ffmpeg works, so may be +lto or some other packaging flag/patch makes this issue visible?

./ffmpeg -i av1-1.ivf -f null /dev/null
ffmpeg version N-112973-gd2be265cd9 Copyright (c) 2000-2023 the FFmpeg developers                    
built with clang version 17.0.6                                                                    
configuration: --enable-jni --enable-mediacodec --enable-neon --target-os=android --disable-devices --enable-libdav1d                                                                                 
libavutil      58. 33.100 / 58. 33.100                                                             
libavcodec     60. 35.100 / 60. 35.100                                                             
libavformat    60. 18.100 / 60. 18.100                                                             
libavdevice    60.  4.100 / 60.  4.100                                                             
libavfilter     9. 14.100 /  9. 14.100                                                             
libswscale      7.  6.100 /  7.  6.100                                                             
libswresample   4. 13.100 /  4. 13.100                                                           
[libdav1d @ 0xb4000074e18600c0] libdav1d 1.3.0                                                     
Input #0, ivf, from 'av1-1.ivf':                                                                     
Duration: 00:00:00.34, start: 0.007000, bitrate: 1920 kb/s                                         
Stream #0:0: Video: av1 (Main) (AV01 / 0x31305641), yuv420p(tv, bt709), 160x120 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 1k tbn                                                                           
[libdav1d @ 0xb4000074e185c460] libdav1d 1.3.0                                                     
Stream mapping:                                                                                      
Stream #0:0 -> #0:0 (av1 (libdav1d) -> wrapped_avframe (native))                                 
Press [q] to stop, [?] for help                                                                    
Output #0, null, to '/dev/null':                                                                     
Metadata:
    encoder         : Lavf60.18.100                                                                  
Stream #0:0: Video: wrapped_avframe, yuv420p(tv, bt709, progressive), 160x120 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn                                                                       
Metadata:                                                                                            
encoder         : Lavc60.35.100 wrapped_avframe                                              
[out#0/null @ 0xb40000748185e4d0] video:158kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown                                                                    frame=  336 fps=0.0 q=-0.0 Lsize=N/A time=N/A bitrate=N/A speed=N/A

@Randrianasulu
Copy link
Author

rebuild package on device itself - decoding works!

So, I guess previous package was miscompiled somehow?

Grimler91 added a commit that referenced this issue Dec 14, 2023
To see if it solves #18721.
@Grimler91
Copy link
Member

Grimler91 commented Dec 14, 2023

rebuild package on device itself - decoding works!

So, I guess previous package was miscompiled somehow?

Rebuild ffmpeg?

If yes, could you check if deb from CI in #18724 works, so that we know if it is as simple as rebuilding? (if not, then there is some issue with cross-compilation configure step)

@Randrianasulu
Copy link
Author

yes, ffmpeg 6.1 package via
"./build-package.sh -f ffmpeg" from termux-packages repo

well, can you post link to deb? I am not sure where in webinterface it exposed ...

@sylirre
Copy link
Member

sylirre commented Dec 14, 2023

The link is available in "summary" tab of GitHub Actions build.

Here is direct link: https://github.com/termux/termux-packages/suites/19054014996/artifacts/1115334804

This is zip file. You will need to extract it first.

@Randrianasulu
Copy link
Author

ah, from main page of repo click on Packages and then select workflow ...

still, while artefacts show up as completed I can't download them, firefox tries to do something for 10 min, direct wget failed

wget https://github.com/termux/termux-packages/suites/19054014996/artifacts/1115334804         
--2023-12-14 21:47:31--  https://github.com/termux/termux-packages/suites/19054014996/artifacts/1115334804                                                                                            Resolving github.com (github.com)... 140.82.121.3                                                  Connecting to github.com (github.com)|140.82.121.3|:443... connected.                              
HTTP request sent, awaiting response... 404 Not Found                                              2023-12-14 21:47:32 ERROR 404: Not Found.

@sylirre
Copy link
Member

sylirre commented Dec 14, 2023

You can't use wget. You need to log in to GitHub and download via web browser.

@Randrianasulu
Copy link
Author

thanks, but it does not work via current mobile firefox too :(

@sylirre
Copy link
Member

sylirre commented Dec 14, 2023

Uploaded gzipped deb as attachments ffmpeg_6.1-2_aarch64.deb.gz

@Randrianasulu
Copy link
Author

it works after installing deb from attachment!

thanks!

sylirre pushed a commit that referenced this issue Dec 14, 2023
To see if it solves #18721.
termux-pacman-bot added a commit to termux-pacman/termux-packages that referenced this issue Dec 14, 2023
WTNLXTBL added a commit to WTNLXTBL/termux-packages that referenced this issue Dec 14, 2023
WTNLXTBL added a commit to WTNLXTBL/termux-packages-pacman that referenced this issue Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly.
Projects
None yet
Development

No branches or pull requests

4 participants