Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rav1e encoding working funky and weird #884

Open
thepragmaticmero opened this issue Oct 9, 2024 · 4 comments
Open

rav1e encoding working funky and weird #884

thepragmaticmero opened this issue Oct 9, 2024 · 4 comments

Comments

@thepragmaticmero
Copy link

I've battled with the rav1e encoder for a while now. I need help on identifying if I'm encountering a bug or not.
OS: Fedora Silverblue
rav1e --version 0.7.1
av1an --version 0.4.3-unstable
Running on: toolbox enter arch-toolbox-latest podman --version 5.2.2
Running too on: Baremetal Fedora Workstation install, building via cargo


  1. av1an exits my bash script after finishing only one encoding
    This is my bash script (It's minimalist)
#!/bin/bash
# You'll need "av1an" "rav1e" "ffmpeg" "vapoursynth"
# Parameters
psv_enc="rav1e" # Encoder
psv_bitrate="4000" # Target bitrate
# psv_passes="2" # Number of encoding passes
psv_threads="16" # Number of cpu threads used, 0 for all
# psv_quality="80" # Target quality 0-100
psv_audio="-c:a libopus -b:a 120k" # Target audio and bitrate
psv_execdir="."
psv_newdir="av1ado"
mkdir -p "$psv_newdir"
# Convert mp4 / mkv to av1
find "$psv_execdir" \( -iname "*.mkv" -o -iname "*.mp4" -o -iname "*.webm" \) | while read -r file; do
  output="${file%.*}.mkv"
  echo "Converting $file to $output"

  # THIS IS THE IMPORTANT PART vvvv
  if ! av1an -e "$psv_enc" -v "--bitrate=$psv_bitrate --quantizer=80 --no-scene-detection --tiles=4 --threads=$psv_threads --speed=4" -y -a="$psv_audio" -i "$file" -o "./$psv_newdir/$output" ; then 
    echo "Error catastrófico"
  fi

  touch -m -t "$(stat -c %y "$file" | sed 's/[-: ]//g' | sed 's/\..*//' | sed 's/..$//')" "./$psv_newdir/$output"
done

I tried it with the same structure while encoding .jxl using cjxl and I had no problems with my little script.
What my script did is transcoding all the .jpeg and .png files to .jxl with it's custom parameters. And copying the "Modified date" from the non-transcoded images. I'm trying to do the same with my videos. But the program keeps exiting after only one encoding.

  1. av1an doesn't change the --workers parameter while using rav1e
    Using the --workers parameter doesn't change when I'm running the command.
    Screenshot from 2024-10-09 11-43-57
    Workers are supposed to use my RAM efficiently right? I'm not too familiar with the concept, my PC has 32 GB of RAM and I want to use all that I can.
  2. My files are bigger after encoding it with rav1e, even when using --bitrate=4000
    The original bitrate is
$ ffprobe ~/projects/convert/tests/20230701_210323.mp4 2>&1 | grep bitrate # This is the original file
  Duration: 00:00:35.29, start: 0.000000, bitrate: 20205 kb/s
$ ffprobe ~/projects/convert/tests/av1ado/20230701_210323.mkv 2>&1 | grep bitrate # This is the new av1 file
  Duration: 00:00:35.29, start: 0.000000, bitrate: 37786 kb/s

The units that rav1e uses are in kbps. Why is it counting it like it was 40 thousand and not 4 thousand?
.mp4 size = 89.1MB | .mkv av1 size = 166.7MB
4. My shell soft locking up after executing one encoding.
You need video to understand this.
I keep pressing the key "e" multiple times
That also happened on Fedora Workstation without the use of podman.
Kooha-2024-10-09-12-38-44.webm
It's weird, it messes my terminal, if I wasn't using tmux I would be pretty annoyed by that. Why does that happen?


I keep running into these problems, I just wanna use rusty rustacean rust on my whole av1 stack, but I don't know what I'm doing wrong, I replicated the same setup without podman on my other fedora workstation computer, still the same problems.

@thepragmaticmero
Copy link
Author

thepragmaticmero commented Oct 12, 2024

nya

@master-of-zen
Copy link
Owner

Workers can't be more than there is chunks to work with.

@master-of-zen
Copy link
Owner

Total queue on that screenshot is 4, so no more than 4 workers can be used.
If there is hundreds of chunks (on long videos) - you would create 48 workers you're specified

@thepragmaticmero
Copy link
Author

oh ok, yeah the videos are pretty small mostly. Tnks for the explanation, I'm kinda new to encoders.
what about the other problems? I think i solved the "high bitrate" problem that I had. But still, I can't use av1an on a bash script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants