Color display mp4 conversion failed

I am trying to convert an mp4 video to pqoi, and I get an error in terminal

orntar@orntar-Surface-Pro:~/Downloads/ProffieOS-master/pqoi$ ./cpqoi wormhole.mp4 "pamscale -xysize 160 128" >wormhole.pqf
Executing: ffprobe -i "$FILE" 2>&1 |  sed -n 's@.*Video:.*, \([0-9.]*\) fps,.*@\1@gp'
Executing: ffprobe -i "$FILE" 2>&1 |  sed -n 's@.*Video:.*, \([0-9.]*\) fps,.*@\1@gp'
FPS: 0:0
Executing: ffmpeg -i "$FILE" -an -pix_fmt yuv444p -f yuv4mpegpipe - | y4mtopnm -P | pamscale -xysize 160 128
sh: 1: y4mtopnm: not found
pamscale: Error reading first byte of what is expected to be a Netpbm magic number.  Most often, this means your input file is empty
ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix= --prefix=/usr --disable-debug --disable-doc --disable-static --enable-cuda --enable-cuda-sdk --enable-cuvid --enable-libdrm --enable-ffplay --enable-gnutls --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libnpp --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopus --enable-libpulse --enable-sdl2 --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-nonfree --enable-nvenc --enable-omx --enable-openal --enable-opencl --enable-runtime-cpudetect --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-xlib
  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
  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 'wormhole.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.59.106
  Duration: 00:00:13.36, start: 0.000000, bitrate: 2033 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1400x1080 [SAR 1:1 DAR 35:27], 1903 kb/s, 12 fps, 12 tbr, 12288 tbn, 24 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
Output #0, yuv4mpegpipe, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.45.100
    Stream #0:0(und): Video: wrapped_avframe, yuv444p, 1400x1080 [SAR 1:1 DAR 35:27], q=2-31, 200 kb/s, 12 fps, 12 tbn, 12 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.91.100 wrapped_avframe
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipe
frame=    1 fps=0.0 q=-0.0 Lsize=    4430kB time=00:00:00.08 bitrate=435463.3kbits/s speed=0.626x    
video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 846179.500000%
Conversion failed!
Failed to read PAM header.

Can someone help with this?

A single png to pqf worked fine. Maybe it has to do with the input file? It is pretty large resolution (but not really file size) mp4.

I tried to re-make and install netpbm, as I thing it was the old one on unbuntu.
I got this error at the end:

make[4]: Leaving directory '/home/orntar/Downloads/netpbm-10.86.43/buildtools'
cc -c -I. -I/home/orntar/Downloads/netpbm-10.86.43/converter/ppm/ppmtompeg/headers  -Iimportinc -Iimportinc/netpbm -I/home/orntar/Downloads/netpbm-10.86.43/converter/ppm/ppmtompeg  -DNDEBUG     -O3 -ffast-math  -pedantic -fno-common -Wall -Wno-uninitialized -Wmissing-declarations -Wimplicit -Wwrite-strings -Wmissing-prototypes -Wundef -Wno-unknown-pragmas   -o jpeg.o jpeg.c
jpeg.c:26:10: fatal error: jpeglib.h: No such file or directory
   26 | #include <jpeglib.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[3]: *** [/home/orntar/Downloads/netpbm-10.86.43/common.mk:269: jpeg.o] Error 1
make[3]: Leaving directory '/home/orntar/Downloads/netpbm-10.86.43/converter/ppm/ppmtompeg'
make[2]: *** [/home/orntar/Downloads/netpbm-10.86.43/common.mk:573: ppmtompeg/all] Error 2
make[2]: Leaving directory '/home/orntar/Downloads/netpbm-10.86.43/converter/ppm'
make[1]: *** [/home/orntar/Downloads/netpbm-10.86.43/common.mk:573: ppm/all] Error 2
make[1]: Leaving directory '/home/orntar/Downloads/netpbm-10.86.43/converter'
make: *** [/home/orntar/Downloads/netpbm-10.86.43/common.mk:573: converter/all] Error 2

so maybe its related to the netpbm install.

edit - I am pretty sure I now have the latest version of netpbm, and I get the same error in pqoi.

This looks like a problem.
Did you install “mjpegtools” ? (with apt)

That’s seems to be it, thanks!

Also, I did not see a reference to installing mjpegtools anywhere, unless it just a linux thing I should have known. I am a little familiar with linux, but haven’t used it a lot.

Now, in order to just have this pqf loop on a display, All I need is to do is put it in the folder WxH with the scr file WxH/idle.scr? (where WxH is the actual dimensions of the file/display)

I added it to the list.

You can put the PQF file anwhere you want, as long as idle.scr tells ProffieOS where it is. Whether it is looping or not depends on how you made it. Normally when you just give cpqoi a single image or movie, it will always make it looping.

Note that you can use dpqoi to inspect the result, just make sure you run it in a new, empty directory as it will produce a bunch of PNG files from the PQF file.

More info about SCR files can be found here: ProffieOS/display/layer_controller.h at 9ec9367a31c39ec7d67f1b358450d46402930699 · profezzorn/ProffieOS · GitHub

1 Like