Orange-OpenSource / AIVC

AIVC is a fully-learned video codec. It is able to code video sequences at different rates and it features tunable coding configurations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

With the latest update bitstream.bin files are now huge in size

AlverGant opened this issue · comments

Trying to compress an 8.4GB HD 1080 uncompressed yuv file resulted in an 2.9GB bitstream.bin file with model number 1 which is the highest rate, before the update, rates were much lower.

Could you please give a few more details:

  • What is the duration of the video?
  • Which configurations do you use ? (Random Access / Low-delay P / All Intra, Intra Period and GOP Size)
  • Does the decoder is able to output a proper video from this huge bitstream?
  • Could you send the log of the encoding-decoding?

Thanks

Sure,

I used the following configuration:
export CUBLAS_WORKSPACE_CONFIG=:4096:8

python aivc.py
-i ../raw_videos/NOVELA_1920x1080_60_420.yuv
-o ../compressed1.yuv
--bitstream_out ../bitstream1.bin
--start_frame 0
--end_frame -1
--coding_config RA
--gop_size 16
--intra_period 32
--model ms_ssim-2021cc-1

Here is the output of the program:
********************************************************************************
Starting encoding
Using /root/.cache/torch_extensions as PyTorch extensions root...
Creating extension directory /root/.cache/torch_extensions/torchac_backend...
Emitting ninja build file /root/.cache/torch_extensions/torchac_backend/build.ninja...
Building extension module torchac_backend...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/2] c++ -MMD -MF torchac_backend.o.d -DTORCH_EXTENSION_NAME=torchac_backend -DTORCH_API_INCLUDE_EXTENSION_H -isystem /opt/conda/lib/python3.8/site-packages/torch/include -isystem /opt/conda/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /opt/conda/lib/python3.8/site-packages/torch/include/TH -isystem /opt/conda/lib/python3.8/site-packages/torch/include/THC -isystem /opt/conda/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -c /opt/conda/lib/python3.8/site-packages/torchac/backend/torchac_backend.cpp -o torchac_backend.o
[2/2] c++ torchac_backend.o -shared -L/opt/conda/lib/python3.8/site-packages/torch/lib -lc10 -ltorch_cpu -ltorch -ltorch_python -o torchac_backend.so
Loading extension module torchac_backend...
[STATE] Start processing: yuv -> png
Input file: ../raw_videos/NOVELA_1920x1080_60_420.yuv
Output directory: ../raw_videos/NOVELA_1920x1080_60_420/
Number of frames in the video: 2878
Frame: 2878/ 2878
[STATE] End processing: yuv -> png
[STATE] End processing
[INFO] | Seed | | 666
[W Context.cpp:69] Warning: torch.set_deterministic is in beta, and its design and functionality may change in the future. (function operator())
/opt/conda/lib/python3.8/site-packages/torch/nn/modules/container.py:434: UserWarning: Setting attributes on ParameterList is not supported.
warnings.warn("Setting attributes on ParameterList is not supported.")
rm: cannot remove '../tmp/3697412327659087746_4/tmp_bitstream_working_dir/': No such file or directory
rm: cannot remove '../tmp/3697412327659087746_4/tmp_bitstream_working_dir': No such file or directory
[INFO] | Start encoding | |
[INFO] | infer_one_sequence | sequence name | NOVELA_1920x1080_60_420
[INFO] | infer_one_sequence | GOP_struct_name | 2_GOP_16
[INFO] | infer_one_sequence | idx_rate | 0
[DEBUG] | infer_one_sequence | nb_GOP | 88
[INFO] | Encoding done | |
[INFO] | Bitstream path | | ../bitstream1.bin
[INFO] | Frame resolution | [H x W] | 1080 x 1920
[INFO] | First coded frame | [frame] | 0
[INFO] | Last coded frame | [frame] | 2877
[INFO] | Number of frames to code | [frame] | 2878
[INFO] | Number of frames coded | [frame] | 2904
[INFO] | Intra-period | [frame] | 33
[RESULT] | Number of frames | [frame] | 2878
[RESULT] | Encoding/decoding time | [s] | 11866.7
[RESULT] | Encoding/decoding FPS | [frame/s] | 0.2
[RESULT] | Estimated PSNR | [dB] | 7.0151
[RESULT] | Estimated MS-SSIM | [dB] | nan
[RESULT] | Estimated rate | [byte] | 3109047063.1
[RESULT] | Real rate | [byte] | 3110991810
[RESULT] | Estimated rate overhead | [%] | 0.06
rmdir: failed to remove '../tmp/3697412327659087746_4': Directory not empty
********************************************************************************
Starting decoding
Using /root/.cache/torch_extensions as PyTorch extensions root...
Emitting ninja build file /root/.cache/torch_extensions/torchac_backend/build.ninja...
Building extension module torchac_backend...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
ninja: no work to do.
Loading extension module torchac_backend...
/opt/conda/lib/python3.8/site-packages/torch/nn/modules/container.py:434: UserWarning: Setting attributes on ParameterList is not supported.
warnings.warn("Setting attributes on ParameterList is not supported.")
[INFO] | | | Found CUDA device
[INFO] | Seed | | 666
[W Context.cpp:69] Warning: torch.set_deterministic is in beta, and its design and functionality may change in the future. (function operator())
[INFO] | Bitstream path | | ../bitstream1.bin
[INFO] | Bitstream processing dir. | | ../tmp/3697412327659087746_4/tmp_out_bitstream/
[INFO] | Decoded frames directory | | ../compressed1/
[INFO] | Number of GOPs in bitstream | | 88
[INFO] | Index first frame | | 0
[INFO] | Index last frame | | 2877
[INFO] | Start decoding | |
[INFO] | Decoding done | |
[RESULT] | Number of frames | [frame] | 2878
[RESULT] | Decoding time | [s] | 9851.2
[RESULT] | Decoding FPS | [frame/s] | 0.3
[STATE] Starting png -> yuv conversion
rm: cannot remove '../compressed1.yuv': No such file or directory
[INFO] | Final decoded video | | ../compressed1.yuv
********************************************************************************
Starting evaluation
/home/ubuntu/AIVC/src/clic21/msssim.py:177: RuntimeWarning: invalid value encountered in power
return (np.prod(mcs[0:levels-1] ** weights[0:levels-1]) *
/home/ubuntu/AIVC/src/clic21/msssim.py:178: RuntimeWarning: invalid value encountered in double_scalars
(mssim[levels-1] ** weights[levels-1]))
PSNR [dB]: 7.01510
MS-SSIM : 0.16626
MS-SSIM [dB]: 0.78971
Size [bytes]: 3110991810
********************************************************************************

Duration of the video file aproximately 96 seconds or 2878 frames at 29.97 fps.

Here is the compressed bitstream https://www.dropbox.com/s/0y3ekeyasy2y5dz/bitstream1.bin?dl=0
Here is the decoded video (its garbled) https://www.dropbox.com/s/rk2o30lwl4kv9hv/compressed1.yuv?dl=0
Here is the original video https://www.dropbox.com/s/2vscfvftqievyhw/NOVELA_1920x1080_60_420.yuv?dl=0

I think I found the problem, the original YUV file is 4:2:0 10bits ...

I will retest converted to 4:2:0 8 bits

Hi,

Indeed, this coder only operates on YUV 4:2:0 8 bits. This is very likely the cause of your trouble. Could you confirm that it works fine once you use a 4:2:0 8-bit YUV file ?

I'll edit the readme to specify that the coder operates solely on YUV 4:2:0 8-bit video sequences.

Yes, confirmed that was the problem. Everything works fine with YUV 4:2:0 8 bit files

Cool, I close this issue then :).