ish icon indicating copy to clipboard operation
ish copied to clipboard

FFMpeg illegal instruction

Open ifuchs opened this issue 4 years ago • 8 comments

I know this question has been asked but the issue appears to be closed so I wondered what its status was.

I tried the following to extract the audio track and got an illegal instruction:

ffmpeg -i sample.avi -ss 00:03:05 -q:a 0 -map a sample.mp3

ifuchs avatar Mar 27 '21 19:03 ifuchs

I used both the oldest and newest versions of iSH available in TestFlight as a non-root user in the oldest a-OK shell (0.40) which I had on an i6s, & dmesg :0bugs with ffmpeg besides[ 0.000000] 241 missing syscall 124which didn't seem to stop process nor repeated itself with multiple runs of ffmpeg; & therefore must have been left only as an artifact of apk add ffmpeg.

``` ffmpeg -i IMG_0023.MOV -ss 00:03:05 -q:a 0 -map a? mail-217.m4a ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.3.0 (Alpine 9.3.0) configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-libssh --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --disable-asm --enable-libaom --disable-debug libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'IMG_0023.MOV': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt creation_time : 2017-12-16T04:46:00.000000Z com.apple.quicktime.make: Apple com.apple.quicktime.model: iPhone 5s com.apple.quicktime.software: 11.2 com.apple.quicktime.creationdate: 2017-12-15T23:45:58-0500 Duration: 00:00:00.10, start: 0.000000, bitrate: 29326 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 1920x1080, 29219 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default) Metadata: rotate : 90 creation_time : 2017-12-16T04:46:00.000000Z handler_name : Core Media Video encoder : H.264 Side data: displaymatrix: rotation of -90.00 degrees Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [libx264 @ 0xf4a035f0] using cpu capabilities: none! [libx264 @ 0xf4a035f0] profile High, level 4.0, 4:2:0, 8-bit [libx264 @ 0xf4a035f0] 264 - core 157 - 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=1 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, ipod, to 'mail-217.m4a': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt com.apple.quicktime.creationdate: 2017-12-15T23:45:58-0500 com.apple.quicktime.make: Apple com.apple.quicktime.model: iPhone 5s com.apple.quicktime.software: 11.2 encoder : Lavf58.45.100 Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuvj420p(pc), 1080x1920, q=-1--1, 30 fps, 15360 tbn, 30 tbc (default) Metadata: encoder : Lavc58.91.100 libx264 creation_time : 2017-12-16T04:46:00.000000Z handler_name : Core Media Video Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A displaymatrix: rotation of -0.00 degrees frame= 0 fps=0.0 q=0.0 size= 0kB time=00:frame= 0 fps=0.0 q=0.0 size= 0kB time=00:frame= 0 fps=0.0 q=0.0 size= 0kB time=00:frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=00:00:00.00 bitrate=N/A speed= 0x video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

62f avatar Mar 28 '21 09:03 62f

Are you saying this works for you and to remove and reinstall ffmpeg?

ifuchs avatar Mar 28 '21 11:03 ifuchs

Not exactly. I couldn't attempt such an in-depth analysis for solution because you had not provided enough information to reproduce your environment nor even the dmesg output, though despite being ever so lightly endowed by thee in that realm, shall not do less than detail the existence of a working configuration, rather than give the valuable bug-discovery a superficial 'couldn't reproduce'.

Personally, the need for ffmpeg functionality would have seen me already reinstalling- being such a terribly simple first step- and further documenting any other failed attempts- simply to bar any unnecessary traffic aimed at the issue.

Seeing how GitHub has borne such a vacuous bug report, may I reckon on existence of a prior (unrequited) call for the same assistance placed at Discord et.al.?

62f avatar Mar 29 '21 10:03 62f

The above call to ffmpeg (on ipad) results in dmesg output of 83 lines of: 312 stub syscall 383 and ends with 312 illegal instruction at 0xf54ff6f8: 0f d9 e0 0f d9 e9 0f fd.

ifuchs avatar Mar 29 '21 12:03 ifuchs

Machine type should be irrelevant, all iSH builds should produce identical Linux environments. Wipe & reload would help but simply because you're now using Alpine edge release, and after reload you'd be reverted back to 3.12.x, which isn't ideal if you didn't understand why and in ignorance went through the steps to again become edge. Alpine's "Latest-stable" http://dl-cdn.alpinelinux.org/alpine/v3.13/, AKA 3.13.x http://dl-cdn.alpinelinux.org/alpine/v3.13/releases/x86/, are the filesystems which ffmpeg would work without illegal instruction, although a 375 and 383 stubs will still pop up. Workaround: to check your dependency versions against these and downgrade each manually by downloading and adding its .apk, one at a time, starting from the list's bottom-up, until ffmpeg works again. Otherwise load the 3.13 fs and transfer your a/v media files using iOS.

(1/55) Installing sdl2 (2.0.14-r0) (2/55) Installing libxau (1.0.9-r0) (3/55) Installing libbsd (0.10.0-r0) (4/55) Installing libxdmcp (1.1.3-r0) (5/55) Installing libxcb (1.14-r1) (6/55) Installing libx11 (1.7.0-r0) (7/55) Installing aom-libs (1.0.0-r1) (8/55) Installing alsa-lib (1.2.4-r2) (9/55) Installing brotli-libs (1.0.9-r3) (10/55) Installing libpng (1.6.37-r1) (11/55) Installing freetype (2.10.4-r1) (12/55) Installing libuuid (2.36.1-r1) (13/55) Installing fontconfig (2.13.1-r3) (14/55) Installing fribidi (1.0.10-r0) (15/55) Installing libintl (0.20.2-r2) (16/55) Installing libblkid (2.36.1-r1) (17/55) Installing libmount (2.36.1-r1) (18/55) Installing pcre (8.44-r0) (19/55) Installing glib (2.66.7-r1) (20/55) Installing graphite2 (1.3.14-r0) (21/55) Installing harfbuzz (2.7.4-r1) (22/55) Installing libass (0.15.0-r0) (23/55) Installing libdav1d (0.8.1-r0) (24/55) Installing gmp (6.2.1-r0) (25/55) Installing nettle (3.7-r0) (26/55) Installing p11-kit (0.23.22-r0) (27/55) Installing libtasn1 (4.16.0-r1) (28/55) Installing libunistring (0.9.10-r0) (29/55) Installing gnutls (3.7.1-r0) (30/55) Installing lame (3.100-r0) (31/55) Installing opus (1.3.1-r1) (32/55) Installing libgomp (10.2.1_pre1-r3) (33/55) Installing soxr (0.1.3-r2) (34/55) Installing libsrt (1.4.2-r0) (35/55) Installing libssh (0.9.5-r0) (36/55) Installing libogg (1.3.4-r0) (37/55) Installing libtheora (1.1.1-r16) (38/55) Installing libjpeg-turbo (2.0.6-r0) (39/55) Installing v4l-utils-libs (1.20.0-r0) (40/55) Installing libxext (1.3.4-r0) (41/55) Installing libxfixes (5.0.3-r2) (42/55) Installing libpciaccess (0.16-r0) (43/55) Installing libdrm (2.4.104-r0) (44/55) Installing wayland-libs-client (1.18.0-r5) (45/55) Installing libva (2.10.0-r0) (46/55) Installing libvdpau (1.4-r0) (47/55) Installing vidstab (1.1.0-r1) (48/55) Installing libvorbis (1.3.7-r0) (49/55) Installing libvpx (1.9.0-r0) (50/55) Installing vulkan-loader (1.2.137-r0) (51/55) Installing x264-libs (20191119-r1) (52/55) Installing x265-libs (3.4-r0) (53/55) Installing xvidcore (1.3.7-r1) (54/55) Installing ffmpeg-libs (4.3.1-r3) (55/55) Installing ffmpeg (4.3.1-r3) Executing busybox-1.32.1-r3.trigger

m

62f avatar Mar 29 '21 23:03 62f

Since iSH is now boldly mirroring Alpine's 3.13 repository; I shall attempt this feat anew.

62f avatar Jun 27 '21 10:06 62f

Illegal instruction at 0xf55f7726: 0f d9 c8 0f fd c1 0f 6f; psubusw and paddw.

Mnpn avatar Jan 17 '22 17:01 Mnpn

Hi! Sorry for late answer. My solution of similar problem is replacement of mp3 en/decoding to other codec (aac).

tsidilin avatar Jan 02 '25 20:01 tsidilin