bugGNU Octave - Bugs: bug #58451, [octave forge] (video) Unit test...

 
 

bug #58451: [octave forge] (video) Unit test VideoWriter fails on ppc64el

Submitter:  Rafael Laboissière <rlaboiss>
Submitted:  Wed 27 May 2020 11:03:24 AM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * other Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 27 Nov 2021 08:06:41 PM UTC, comment #4: 

Thanks for the commit, Andreas. It is indeed too bad that the result of the write/read roundtrip test depends on the specific version of the external x264 library.

At any rate, I uploaded the version 2.0.1-1 of the Debian package octave-video, which builds correctly on all architectures:
https://buildd.debian.org/status/package.php?p=octave-video

P.S.: I just spotted a spelling error in your commit : “realtive” should read “relative”

Rafael Laboissière <rlaboiss>
Fri 26 Nov 2021 08:23:04 AM UTC, comment #3: 

Hi Rafael, thank you very much for testing.

I've increased the threshold to fail to 0.05 and show a warning if it exceeds 0.025, please see here:

https://sourceforge.net/p/octave/video/ci/9108e9e49dd78ec20e3b186e00b958d281565d29/

Bu the initial problem: "how to check if a write/read roundtrip works" is still unsolved.

I wouldn't try to trigger a bugfix release yet, is this okay for you? If not just give me a note (I don't want to bother/stress the release team, which AFAIK only consists of Kai at the moment, with many minor releases)

Thank you very much,
-- Andy

Andreas Weber <andy1978>
Group Member
Fri 26 Nov 2021 07:18:06 AM UTC, comment #2: 

Thanks for your feedback, Andreas.

It seems that the results effectively depend on the version of the x264 library. I just tried again the example that I include in my first message on a ppc64el system (this time with libx264-160) and I get:


max_rel_err = 0.021516


The new resulting file is much more similar to the one obtained on an amd64 system:


2c2
< Complete name                            : rainbow-x86_64.mp4
---
> Complete name                            : rainbow-ppc64le-x264-160.mp4
6c6
< File size                                : 11.9 KiB
---
> File size                                : 11.5 KiB
8,9c8,9
< Overall bit rate                         : 24.3 kb/s
< Writing application                      : Lavf58.45.100
---
> Overall bit rate                         : 23.6 kb/s
> Writing application                      : Lavf58.76.100
22c22,23
< Bit rate                                 : 21.6 kb/s
---
> Bit rate                                 : 20.9 kb/s
> Maximum bit rate                         : 450 kb/s
32,34c33,35
< Bits/(Pixel*Frame)                       : 0.024
< Stream size                              : 10.6 KiB (89%)
< Writing library                          : x264 core 161
---
> Bits/(Pixel*Frame)                       : 0.023
> Stream size                              : 10.2 KiB (89%)
> Writing library                          : x264 core 160 r3011 cde9a93


Also, it is visually okay (I am attaching the result to this bug report). However, there is still a much higher absolute error due to compression.

(file #52344)

Rafael Laboissière <rlaboiss>
Mon 22 Nov 2021 09:15:29 AM UTC, comment #1: 

Hi Rafael,
sorry for not answering earlier (and thank you Kai pointing me to this).

The rainbow-ppc64le.mp4 really looks bad with heavy compression artifacts. When I compare those two videos I see


2c2
< Complete name                            : rainbow-x86_64.mp4
---
> Complete name                            : rainbow-ppc64le.mp4
6c6
< File size                                : 11.8 KiB
---
> File size                                : 43.7 KiB
8c8
< Overall bit rate                         : 24.3 kb/s
---
> Overall bit rate                         : 89.6 kb/s
22c22
< Bit rate                                 : 21.6 kb/s
---
> Bit rate                                 : 86.9 kb/s
32,34c32,34
< Bits/(Pixel*Frame)                       : 0.024
< Stream size                              : 10.6 KiB (89%)
< Writing library                          : x264 core 159
---
> Bits/(Pixel*Frame)                       : 0.097
> Stream size                              : 42.5 KiB (97%)
> Writing library                          : x264 core 155 r2917 0a84d98


so the ppc64le video is bigger, has a higher bit rate but lower quality. Perhaps the older x264 lib

"x264 core 159" on x86 and "x264 core 155 r2917 0a84d98" on PPC64 is the reason?

Andreas Weber <andy1978>
Group Member
Wed 27 May 2020 11:03:24 AM UTC, original submission:  

The unit test of function VideoWriter of package video fails on a ppc64el system.  This is probably due a MP4 compression problem, as written in lines 253 and 254 of VideoWriter.m:


%!   # this doesn't work well due to compression...
%!   # FIXME: a better idea to test write/read roundtrip


I tested the code below in both amd64 and ppc64el systems (it is essentially the same as in the failing unit test):


fn = fullfile (tempdir(), sprintf ("rainbow-%s.mp4", uname ().machine));
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)
r = VideoReader (fn);
max_rel_err = -Inf;
for k=1:size (raw_video, 4)
  img = readFrame (r);
  d = double (img) - raw_video(:,:,:,k);
  rel_err = sum (abs(d(:)))/numel(d)/255;
  if rel_err > max_rel_err
    max_rel_err = rel_err;
  endif
endfor
close (r);
max_rel_err


It yields the following:

On amd64:


max_rel_err =  0.0081331


On ppc64el:


max_rel_err =  0.046289


The resulting rainbow-*.mp4 are attached to this bug report.

I think that the threshold 0.015 for the assert test should be increased.

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 #49179:  rainbow-x86_64.mp4 added by rlaboiss (12KiB - video/mp4)
file #49180:  rainbow-ppc64le.mp4 added by rlaboiss (44KiB - 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 andy1978 (Posted a comment)
  • -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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-28 andy1978 StatusNone Fixed
        Open/ClosedOpen Closed
    2021-11-26 rlaboiss Attached File- Added rainbow-ppc64le-x264-160.mp4, #52344
    2020-05-27 rlaboiss Attached File- Added rainbow-x86_64.mp4, #49179
        Attached File- Added rainbow-ppc64le.mp4, #49180

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code