[Cin] Openjpeg update ....

Andrew Randrianasulu randrianasulu at gmail.com
Sat Jan 30 18:12:23 CET 2021

It seems to work, at least I observed up to 300+% cpu load on encoding

I made simple openjpeg.mov to put in /usr/share/cin/ffmpeg/video

I can encode into rgba64 lossless, but it takes like 5 minutes for 47 seconds long 
700x400 file (but with background render set to EXR/DWAA, and project set to
RGBA-float, and vf_pseudocolor and some fader ...)

playing this file with mplayer in realtime apparently impossible on my machine :}

 mplayer -vo x11 /dev/shm/OPENJPEG.mov
MPlayer SVN-r38247-10.0.1 (C) 2000-2021 MPlayer Team
parse error at line 423
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /dev/shm/OPENJPEG.mov.
libavformat version 58.65.101 (internal)
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x574c054c]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
[lavf] stream 0: video (jpeg2000), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang rus
VIDEO:  [mjp2]  704x400  24bpp  25.000 fps  143587.3 kbps (17527.7 kbyte/s)
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 58.119.100 (internal)
[libopenjpeg @ 0x57601cf4]Requested frame threading with a custom get_buffer2() implementation which is not marked as thread safe. This is not supported anymore, make your callback thread-safe.
Selected video codec: [fflibopenjpeg] vfm: ffmpeg (OpenJPEG MJPEG2000)
Clip info:
 major_brand: qt
 minor_version: 512
 compatible_brands: qt
 encoder: Lavf58.65.101
Load subtitles in /dev/shm/
Forced audio codec: mad
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
[aac @ 0x57601cf4]Multiple frames in a packet.
AUDIO: 48000 Hz, 2 ch, floatle, 118.0 kbit/3.84% (ratio: 14754->384000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample)
Starting playback...
[aac @ 0x57601cf4]channel element 0.0 is not allocated
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.76:1 - prescaling to correct movie aspect.
[swscaler @ 0x5773aa54]bicubic scaler, from rgba64le to bgra using MMXEXT
VO: [x11] 704x400 => 704x400 BGRA
[VD_FFMPEG] DRI failure.
Movie-Aspect is 1.76:1 - prescaling to correct movie aspect.
VO: [x11] 704x400 => 704x400 BGRA
A:   0.0 V:   0.0 A-V:  0.000 ct:  0.000   0/  0 ??% ??% ??,?% 0 0
[VD_FFMPEG] DRI failure.
A:   8.7 V:   6.6 A-V:  2.013 ct: -0.019   0/  0 46% 38%  4.9% 50 0

           **** Your system is too SLOW to play this!  ****

Possible reasons, problems, workarounds:
- Most common: broken/buggy _audio_ driver
  - Try -ao sdl or use the OSS emulation of ALSA.
  - Experiment with different values for -autosync, 30 is a good start.
- Slow video output
  - Try a different -vo driver (-vo help for a list) or try -framedrop!
- Slow CPU
  - Don't try to play a big DVD/DivX on a slow CPU! Try some of the lavdopts,
    e.g. -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all.
- Broken file
  - Try various combinations of -nobps -ni -forceidx -mc 0.
- Slow media (NFS/SMB mounts, DVD, VCD etc)
  - Try -cache 8192.
- Are you using -cache to play a non-interleaved AVI file?
  - Try -nocache.
Read DOCS/HTML/en/video.html for tuning/speedup tips.
If none of this helps you, read DOCS/HTML/en/bugreports.html.

A:   9.1 V:   6.8 A-V:  2.269 ct: -0.019   0/  0 51% 38%  5.1% 55 0

file is like 810 mb big :}

Additional patches attached ....
I can't say OpenEXR-2.5-opt.diff
help much (this was optimization they talked about in OpenEXR 2.5.x)

but apparently it still applicaple to 2.4.1, just rename it and put in thirdparty/src
if you want to test

is basically not very useful (apart from testing?) addition of OpenEXR as 
background render choice

Basically you should put Openjpeg-2.4.0 tarball into thirdparty/src
instead of 2.3.1 and apply  this patch for testing ...
internal ffmpeg should be build with this version of openjpeg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: openjpeg.qt
Type: application/octet-stream
Size: 16 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20210130/993af854/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenEXR-2.5-opt.diff
Type: text/x-diff
Size: 3670 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20210130/993af854/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FORMAT_brender_exr_added.diff
Type: text/x-diff
Size: 452 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20210130/993af854/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openjpeg-24.patch
Type: text/x-diff
Size: 349 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20210130/993af854/attachment-0002.bin>

More information about the Cin mailing list