Closed najoshi closed 4 years ago
Bother - thought I'd fixed that. Can you put a test file somewhere I can get at please.
Here is that video:
https://u.pcloud.link/publink/show?code=XZKTmikZzHbf0dnL02VhIjqHe0u8E5HexHPX
That video works for me here with (what I fondly believe to be) a stock VLC. When did you last do an apt update/upgrade? VLC was updated about a week ago.
Well, that worked. I thought I had upgraded more recently, but apparently not. Thanks for your help and your quick responses. :)
I may have spoken too soon... so it works for some MJPEG in AVI files now, but not for others. Here is one that it does not work for: https://u.pcloud.link/publink/show?code=XZriqikZPCn5JdGh2DSYKyJtYDEdJ5fFQwOV
OK - that would appear to be a fair cop - I'll look into it. Omxplayer seems to like it so maybe not firmware (though offhand I can't see why one mjpeg stream should need different handling to another from the PoV of mmal).
So another thing which is frustrating is that I tried converting the video to other formats using ffmpeg, but regardless of what I do, vlc still won't play the video part. vlc on my ubuntu box plays them just fine.
Also, I realized that all the AVI files that won't play are from before 2010.
Yeah - this turns out to be a stupid one and I will fix it. Indeed I'm surprised it hasn't come up before. VLC isn't going to play any video sized 320x240. For what its worth the reason is that it always expects to get a "resolution changed" event at the start of a stream, but 320x240 is the default size on the decoder output port (I didn't know it had a default) so it never turns up. This is slightly less trivial to fix and ensure I don't break anything else than I would like so it is waiting for me to have a day or so free to get it right which should happen in the next week or so.
I thought it might be a resolution thing, so I tried upscaling the resolution to 1920x1080 for that video, but that didn't work either.
OK - now really truly confused - could you give me a url where I can find the upscaled video please (a few secs is all I need)
Here are the first few seconds of the converted video (which will not play in omxplayer either, but does play on ubuntu 18.04 no problem):
https://u.pcloud.link/publink/show?code=XZEI2okZv1YsT2tMXDppMHV1DscDULFgil0k
Here's what I ran to do the conversion:
joshi@morpheus:~/digital_media_frame_touch$ ffmpeg -i 1920.MVI_6714.AVI -vf scale=1920x1080 output_1080p.mp4
ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from '1920.MVI_6714.AVI':
Metadata:
creation_time : 2009-01-01 13:11:51
encoder : CanonMVI01
Duration: 00:01:08.47, start: 0.000000, bitrate: 2194 kb/s
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 320x240, 2104 kb/s, 15 fps, 15 tbr, 15 tbn, 15 tbc
Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 11024 Hz, mono, u8, 88 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (pcm_u8 (native) -> aac (native))
Press [q] to stop, [?] for help
[aac @ 0x557e2e690be0] Too many bits 6408.707483 > 6144 per frame requested, clamping to max
[swscaler @ 0x557e2e74f480] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x557e2e68f740] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x557e2e68f740] profile High 4:2:2, level 4.0, 4:2:2 8-bit
[libx264 @ 0x557e2e68f740] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - 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=12 lookahead_threads=2 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=15 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 'output_1080p.mp4':
Metadata:
encoder : Lavf57.83.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuvj422p(pc), 1920x1080, q=-1--1, 15 fps, 500k tbn, 15 tbc
Metadata:
encoder : Lavc57.107.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 11025 Hz, mono, fltp, 66 kb/s
Metadata:
encoder : Lavc57.107.100 aac
frame= 1027 fps= 19 q=-1.0 Lsize= 54496kB time=00:01:08.54 bitrate=6513.0kbits/s speed=1.25x
video:54007kB audio:461kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.052176%
[libx264 @ 0x557e2e68f740] frame I:13 Avg QP:20.76 size: 73142
[libx264 @ 0x557e2e68f740] frame P:307 Avg QP:23.09 size: 57930
[libx264 @ 0x557e2e68f740] frame B:707 Avg QP:23.66 size: 51722
[libx264 @ 0x557e2e68f740] consecutive B-frames: 5.8% 5.3% 5.6% 83.3%
[libx264 @ 0x557e2e68f740] mb I I16..4: 16.5% 78.7% 4.9%
[libx264 @ 0x557e2e68f740] mb P I16..4: 16.2% 61.1% 2.2% P16..4: 14.0% 4.7% 0.7% 0.0% 0.0% skip: 1.0%
[libx264 @ 0x557e2e68f740] mb B I16..4: 8.4% 17.7% 0.6% B16..8: 32.4% 15.4% 2.4% direct:16.3% skip: 6.8% L0:48.5% L1:40.9% BI:10.5%
[libx264 @ 0x557e2e68f740] 8x8 transform intra:72.3% inter:89.7%
[libx264 @ 0x557e2e68f740] coded y,uvDC,uvAC intra: 52.9% 57.2% 2.7% inter: 50.8% 78.6% 0.3%
[libx264 @ 0x557e2e68f740] i16 v,h,dc,p: 10% 64% 6% 19%
[libx264 @ 0x557e2e68f740] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 36% 15% 3% 6% 4% 9% 4% 7%
[libx264 @ 0x557e2e68f740] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 37% 7% 4% 9% 6% 11% 4% 5%
[libx264 @ 0x557e2e68f740] i8c dc,h,v,p: 45% 35% 12% 8%
[libx264 @ 0x557e2e68f740] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x557e2e68f740] ref P L0: 44.4% 11.7% 25.7% 18.2%
[libx264 @ 0x557e2e68f740] ref B L0: 73.3% 20.6% 6.1%
[libx264 @ 0x557e2e68f740] ref B L1: 88.9% 11.1%
[libx264 @ 0x557e2e68f740] kb/s:6461.88
[aac @ 0x557e2e690be0] Qavg: 61234.312
joshi@morpheus:~/digital_media_frame_touch$
I can see the issue from here - you've generated 422 h264 - none of our codecs (except mjpeg) cope with anything except 420
So how would I force ffmpeg to convert to 420?
Figured it out, used the "-pix_fmt yuv420p" option and that worked. vlc on the Pi can play the upscaled version now.
But you're saying that yuvj422p should work with mjpeg, right?
Yup - I think so anyway - 422 is (I believe) the default for that.
I can see the issue from here - you've generated 422 h264 - none of our codecs (except mjpeg) cope with anything except 420
When you say "our codecs", are you referring to codecs for vlc on the Pi4? Because the 422 h264 does work for vlc on my ubuntu 18.04.
I'm referring to codecs backed by h/w on the Pi4 i.e. those that use mmal_decoder. To be honest its utility on a Pi4 is debatable as a Pi4 can decode HD H264 in s/w in real time (a Pi3 couldn't) so all it does is keep your CPU usage down and your Pi cooler. For your usage you would probably be better off (or at least no worse off) without it. You used to be able to set codec priorities in VLC but that seems to have gone away. Try "--codec FFmpeg" on the command line or set FFmpeg in Tools/Preferences/Video/All/Video Codecs/Preferred decoders list and that should get you s/w decode.
The "--codec FFmpeg" seems to work for the older AVI files, but it causes problems with other files. I am trying to run vlc using python-vlc (as a part of pipresents) and it needs to be able to decode my AVIs, MP4s, MOVs, and MKVs, from 2004 to now. So, ideally, just one call to MediaPlayer that will work for all of them. I am fine with doing the decoding in software, but is there a set of options that will work for all of the videos? It might just be easier to wait for your fix. :)
Short answer - I think your best bet is to wait for my fix, VLC (via mmal_decode) should be able to decode and display anything that omxplayer can do. The general case codec/filter/display selection is a hard problem when you actually have choices and there is a strong tendency to break .stuff when you fix other stuff Out of curiosity there any common feature to the files that --codec FFmpeg doesn't like?
Well, it's weird.... I was getting a segmentation fault when I was using python-vlc to play an mp4 with subtitles (using --codec FFmpeg as one of the options). But then I tried it a few minutes later and it worked. I still get the repeating warning of:
[a492d8d8] chain filter error: Too high level of recursion (3) [a492d3c0] main filter error: Failed to create video converter
And then the warnings end with:
[a4903f90] main vout display error: Failed to create video converter [a4903f90] main vout display error: Failed to adapt decoder format to display [025ad760] main video output error: video output creation failed [a1eeb758] main decoder error: failed to create video output [b4e069d8] mmal_xsplitter vout display error: Failed to open Xsplitter:opengles2 module [025dc740] xcb_window window error: X server failure
but then it still plays the file somehow. I will play around with it more and let you know what I discover.
Also, when I take out the '--codec FFmpeg' from the python-vlc Instance options, the recursion warning goes away.
I've got a fix. It turns out there was a simple patch to work around the problem (it will still occur if you pick a 256x256 video with a 2x4 cropped rect somewhere in the middle of it but I'm betting those are few and far between), which is good 'cos I was not looking forward to reworking stream startup. It'll take a few days to filter through the system but the process has been started.
Awesome. Thank you so much for your help and responsiveness. So will the patch be part of a software update? Do I just need to upgrade my packages in a week or so?
It should just appear as part of a normal package update.
So I've updated (and upgraded) a few times now and I still don't seem to have an updated vlc.... am I doing something wrong? It should be available now right?
@XECDesign is there a VLC bump planned soon?
There is, yes. I wanted to get a NOOBS update out first, but VLC shouldn't take long, so I'll bump it up the priority list.
The latest version should be in apt as of last night.
I got it and it works. Thank you!
@najoshi close the issue if you are happy.
So I am having a similar problem to this issue, and I tried updating the firmware, but the problem persists. So basically, I have an MJPEG within an AVI container which I am trying to play using vlc. The sound comes out just fine, but I get no video, just the orange cone. I can play other formats just fine in vlc. Also, omxplayer plays the AVI video no problem. Here is the output from vlc:
And here is the output from ffprobe for the file (in case that is useful):