bugGNU Octave - Bugs: bug #64452, [octave forge] (video) BIST in...

 
 

bug #64452: [octave forge] (video) BIST in VideoWriter.m fails on ppc64el

Submitter:  Rafael Laboissière <rlaboiss>
Submitted:  Thu 20 Jul 2023 02:50:16 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * other Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 23 Jul 2023 07:25:38 PM UTC, comment #7: 

I looked at the metadate on rainbow.mp4 generated on different platforms (ffmpeg -i or ffprobe -show_streams ).
They all have different bitrates. E.g.

ppc64el:

  Duration: 00:00:04.00, start: 0.000000, bitrate: 58 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 200x150, 55 kb/s, 30 fps, 30 tbr, 15360 tbn (default)

RaspberryPi4 Ubuntu 23.04:

  Duration: 00:00:04.00, start: 0.000000, bitrate: 23 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 200x150, 20 kb/s, 30 fps, 30 tbr, 15360 tbn (default)


amd64 CentOS Stream 9:

  Duration: 00:00:04.00, start: 0.000000, bitrate: 24 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 200x150, 21 kb/s, 30 fps, 30 tbr, 15360 tbn (default)


Just fyi.

Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>
Sun 23 Jul 2023 03:06:44 PM UTC, comment #6: 

Thank you for providing the generated mp4. Although the file is bigger (29.4kB vs. 12.1kB on AMD64), it shows some strange purple artifacts between blue and red.

I think it's okay. that the test fails in this case because obviously there is a problem while encoding, perhaps some POWER8 CPU architecture related bug...

I'll try to create a raw video and then to transcode it in a qemu VM on ppc64el and then perhaps file a bugreport against ffmpeg.

-- Andy

Andreas Weber <andy1978>
Group Member
Sun 23 Jul 2023 02:17:38 PM UTC, comment #5: 

comment #2:

> Have you tried to visually inspect /tmp/rainbow.mp4 and is it visually comparable to the desired result?
>
> And do you have a better idea to implement checks rather than doing a encode/decode cycle? Perhaps I can switch to use a lossless/raw format or run thwo checks:
> 1.) Some lossless raw format (with low error threshold)
> 2.) mp4 container with H264/avc1 video codec (with higher threshold)
>
> Other ideas welcome.
>
> Do I have the chance to reproduce your test result on AMD64? Perhaps some qemu/kvm magic?


I built the package on one of the ppc64el Debian developer machine and generated the rainbow.mp4 file as in the BIST in VideoWriter. The resulting file is attached to this message.

(file #54952)

Rafael Laboissière <rlaboiss>
Sun 23 Jul 2023 08:48:08 AM UTC, comment #4: 

The problem reported in this bug report stroke again in version 2.1.1 of the video package, when compiled on a ppc64el system using ffmpeg 5 and g++ 13. The BIST for VideoWriter in the previous version (2.0.2) run correctly on ppc64el, but using ffmpeg 4 and g++ 11.

(BTW, please fix a typo in line 319 of inst/VideoWriter.m : “realtive” ⇒ “relative”.)

This is the relevant part of the build log:


[inst/VideoWriter.m]
>>>>> /<<PKGBUILDDIR>>/inst/VideoWriter.m
***** demo
 fn = fullfile (tempdir (), "sombrero.mp4");
 w = VideoWriter (fn);
 w.FrameRate = 50;
 open (w);
 z = sombrero ();
 hs = surf (z);
 axis manual
 nframes = 200;
 for ii = 1:nframes
   set (hs, "zdata", z * sin (2*pi*ii/nframes + pi/5));
   drawnow
   writeVideo (w, getframe (gcf));
 endfor
 close (w)
 printf ("Now run 'open %s' to read the video with your default video player or try 'demo VideoReader'!\n", fn);
***** test
 fn = fullfile (tempdir(), "rainbow.mp4");
 width = 200;
 height = 150;
 nframes = 120;
 p = permute (rainbow (width), [3 1 2]);
 raw_video = zeros (height, width, 3, nframes);
 w = VideoWriter (fn);
 for k=1:nframes
   ps = circshift (p, k * 6);
   img = uint8 (255 * repmat (ps, height, 1));
   raw_video (:, :, :, k) = img;
   writeVideo (w, img);
 endfor
 close (w)
 ## read video and compare
 clear -x raw_video fn
 r = VideoReader (fn);
 for k=1:size (raw_video, 4)
   img = readFrame (r);
   d = double (img) - raw_video(:,:,:,k);
   # FIXME: This write/read roundtrip check doesn't work well due to compression artifacts
   #        see also bug #58451 (https://savannah.gnu.org/bugs/?58451)
   #        what would be a better way?
   rel_err = sum (abs(d(:)))/numel(d)/255;
   warn_thres = 0.025;
   if (rel_err > warn_thres)
     warning ("The realtive deviation exceeds the given threshold (%.3f > %.3f).\n\
     Please inspect '%s' manually. You should see a horizontal rainbow running from left to right.", rel_err, warn_thres, fn);
   endif
   assert (rel_err < 2 * warn_thres)
 endfor
 close (r);
[swscaler @ 0x100115a7840] ALTIVEC: Color Space BGR24
warning: The realtive deviation exceeds the given threshold (0.148 > 0.025).
     Please inspect '/tmp/rainbow.mp4' manually. You should see a horizontal rainbow running from left to right.
warning: called from
    __test__ at line 29 column 6
    test at line 682 column 11
    /tmp/tmp.U4KNDwlVn4 at line 14 column 31

!!!!! test failed
assert (rel_err < 2 * warn_thres) failed
1 test, 0 passed, 0 known failure, 0 skipped


Rafael Laboissière <rlaboiss>
Fri 21 Jul 2023 06:59:07 AM UTC, comment #3: 

See also https://savannah.gnu.org/bugs/index.php?58451 where we increased the threshold for ppc64el three years ago.

Andreas Weber <andy1978>
Group Member
Fri 21 Jul 2023 05:30:04 AM UTC, comment #2: 

Hi Rafael, thank you for your report.

Have you tried to visually inspect /tmp/rainbow.mp4 and is it visually comparable to the desired result?

And do you have a better idea to implement checks rather than doing a encode/decode cycle? Perhaps I can switch to use a lossless/raw format or run thwo checks:
1.) Some lossless raw format (with low error threshold)
2.) mp4 container with H264/avc1 video codec (with higher threshold)

Other ideas welcome.

Do I have the chance to reproduce your test result on AMD64? Perhaps some qemu/kvm magic?

-- Andy

Andreas Weber <andy1978>
Group Member
Thu 20 Jul 2023 02:52:05 PM UTC, comment #1: 

Please, change the title of this bug report to:

[octave forge] (video) BIST in VideoWriter.m fails on ppc64el

Rafael Laboissière <rlaboiss>
Thu 20 Jul 2023 02:50:16 PM UTC, original submission:  

This is probably a resurrection of bug #58451. The ppc64el autobuilder for the Debian package octave-video (version 2.1.1) choked on the BIST in VideoWriter.m that writes/reads rainbow.mp4. The full log can be seen here and this is the relevant part:


***** test
 fn = fullfile (tempdir(), "rainbow.mp4");
 width = 200;
 height = 150;
 nframes = 120;
 p = permute (rainbow (width), [3 1 2]);
 raw_video = zeros (height, width, 3, nframes);
 w = VideoWriter (fn);
 for k=1:nframes
   ps = circshift (p, k * 6);
   img = uint8 (255 * repmat (ps, height, 1));
   raw_video (:, :, :, k) = img;
   writeVideo (w, img);
 endfor
 close (w)
 ## read video and compare
 clear -x raw_video fn
 r = VideoReader (fn);
 for k=1:size (raw_video, 4)
   img = readFrame (r);
   d = double (img) - raw_video(:,:,:,k);
   # FIXME: This write/read roundtrip check doesn't work well due to compression artifacts
   #        see also bug #58451 (https://savannah.gnu.org/bugs/?58451)
   #        what would be a better way?
   rel_err = sum (abs(d(:)))/numel(d)/255;
   warn_thres = 0.025;
   if (rel_err > warn_thres)
     warning ("The realtive deviation exceeds the given threshold (%.3f > %.3f).\n\
     Please inspect '%s' manually. You should see a horizontal rainbow running from left to right.", rel_err, warn_thres, fn);
   endif
   assert (rel_err < 2 * warn_thres)
 endfor
 close (r);
[swscaler @ 0x100115a7840] ALTIVEC: Color Space BGR24
warning: The realtive deviation exceeds the given threshold (0.148 > 0.025).
     Please inspect '/tmp/rainbow.mp4' manually. You should see a horizontal rainbow running from left to right.
warning: called from
    __test__ at line 29 column 6
    test at line 682 column 11
    /tmp/tmp.U4KNDwlVn4 at line 14 column 31

!!!!! test failed
assert (rel_err < 2 * warn_thres) failed


Rafael Laboissière <rlaboiss>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #54952:  rainbow.mp4 added by rlaboiss (29KiB - video/mp4)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by andy1978 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by rlaboiss (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-07-23 rlaboiss Attached File- Added rainbow.mp4, #54952
    2023-07-20 mmuetzel Summary[octave forge] (struct) Fix cleaning of files in src/Makefile.in [octave forge] (video) BIST in VideoWriter.m fails on ppc64el

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code