RPi-Distro / vlc

GNU General Public License v2.0
41 stars 4 forks source link

MJPEG in AVI not playing video on Pi 4 #18

Closed najoshi closed 4 years ago

najoshi commented 4 years ago

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:

pi@raspberrypi4:~ $ vlc --verbose 1 testvids/0150.MVI_2463.AVI 
VLC media player 3.0.11 Vetinari (revision 3.0.11-0-gdc0c5ced72)
[017c7b58] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
qt5ct: using qt5ct plugin
qt5ct: D-Bus global menu: no
qt5ct: D-Bus system tray: no
[a100eb00] mmal_codec decoder: VCSM init succeeded: CMA
[0184ee50] [time_intf] lua interface: [time_intf] file:///home/pi/testvids/0150.MVI_2463.AVI
[a100eb00] main decoder error: buffer deadlock prevented
[018432a8] pulse audio output warning: starting late (-15281 us)
[018432a8] main audio output warning: playback too late (75230): up-sampling
[018432a8] main audio output warning: timing screwed (drift: 175171 us): stopping resampling
[018432a8] main audio output warning: playback way too late (200117): flushing buffers
[018432a8] pulse audio output warning: starting late (-380 us)
[018432a8] main audio output warning: playback way too early (-524853): playing silence
[018432a8] main audio output warning: playback too late (75116): up-sampling
[018432a8] main audio output warning: timing screwed (drift: 175424 us): stopping resampling
[018432a8] main audio output warning: playback way too late (199913): flushing buffers
[018432a8] pulse audio output warning: starting late (-81 us)
[018432a8] main audio output warning: playback way too early (-524807): playing silence
[a100b3c8] avi demux warning: cannot get packet header, track disabled
[0184ee50] [time_intf] lua interface: [time_intf] stopped
[0184ee50] [time_intf] lua interface error: Error loading script /home/pi/.local/share/vlc/lua/intf/time_intf.lua: /home/pi/.local/share/vlc/lua/intf/time_intf.lua:85: Interrupted.
QObject::~QObject: Timers cannot be stopped from another thread
pi@raspberrypi4:~ $ 

And here is the output from ffprobe for the file (in case that is useful):

pi@raspberrypi4:~ $ ffprobe /home/pi/testvids/0150.MVI_2463.AVI 
ffprobe version 4.1.4-1+rpt7~deb10u1 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)
  configuration: --prefix=/usr --extra-version='1+rpt7~deb10u1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --libdir=/usr/lib/arm-linux-gnueabihf --cpu=arm1176jzf-s --arch=arm
  WARNING: library configuration mismatch
  avutil      configuration: --prefix=/usr --extra-version='1+rpt7~deb10u1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
  avcodec     configuration: --prefix=/usr --extra-version='1+rpt7~deb10u1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
  avformat    configuration: --prefix=/usr --extra-version='1+rpt7~deb10u1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
  avdevice    configuration: --prefix=/usr --extra-version='1+rpt7~deb10u1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
  avfilter    configuration: --prefix=/usr --extra-version='1+rpt7~deb10u1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
  avresample  configuration: --prefix=/usr --extra-version='1+rpt7~deb10u1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
  swscale     configuration: --prefix=/usr --extra-version='1+rpt7~deb10u1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
  swresample  configuration: --prefix=/usr --extra-version='1+rpt7~deb10u1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
  postproc    configuration: --prefix=/usr --extra-version='1+rpt7~deb10u1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, avi, from '/home/pi/testvids/0150.MVI_2463.AVI':
  Metadata:
    creation_time   : 2015-05-19 21:14:15
    encoder         : CanonMVI06
  Duration: 00:00:26.70, start: 0.000000, bitrate: 15239 kb/s
    Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 640x480, 14547 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
    Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 1 channels, s16, 705 kb/s
jc-kynesim commented 4 years ago

Bother - thought I'd fixed that. Can you put a test file somewhere I can get at please.

najoshi commented 4 years ago

Here is that video:

https://u.pcloud.link/publink/show?code=XZKTmikZzHbf0dnL02VhIjqHe0u8E5HexHPX

jc-kynesim commented 4 years ago

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.

najoshi commented 4 years ago

Well, that worked. I thought I had upgraded more recently, but apparently not. Thanks for your help and your quick responses. :)

najoshi commented 4 years ago

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

jc-kynesim commented 4 years ago

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).

najoshi commented 4 years ago

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.

najoshi commented 4 years ago

Also, I realized that all the AVI files that won't play are from before 2010.

jc-kynesim commented 4 years ago

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.

najoshi commented 4 years ago

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.

jc-kynesim commented 4 years ago

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)

najoshi commented 4 years ago

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$
jc-kynesim commented 4 years ago

I can see the issue from here - you've generated 422 h264 - none of our codecs (except mjpeg) cope with anything except 420

najoshi commented 4 years ago

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.

najoshi commented 4 years ago

But you're saying that yuvj422p should work with mjpeg, right?

jc-kynesim commented 4 years ago

Yup - I think so anyway - 422 is (I believe) the default for that.

najoshi commented 4 years ago

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.

jc-kynesim commented 4 years ago

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.

najoshi commented 4 years ago

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. :)

jc-kynesim commented 4 years ago

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?

najoshi commented 4 years ago

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.

najoshi commented 4 years ago

Also, when I take out the '--codec FFmpeg' from the python-vlc Instance options, the recursion warning goes away.

jc-kynesim commented 4 years ago

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.

najoshi commented 4 years ago

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?

jc-kynesim commented 4 years ago

It should just appear as part of a normal package update.

najoshi commented 4 years ago

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?

popcornmix commented 4 years ago

@XECDesign is there a VLC bump planned soon?

XECDesign commented 4 years ago

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.

XECDesign commented 4 years ago

The latest version should be in apt as of last night.

najoshi commented 4 years ago

I got it and it works. Thank you!

popcornmix commented 4 years ago

@najoshi close the issue if you are happy.