Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
gstreamer-vaapi
gstreamer-vaapi
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 140
    • Issues 140
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 14
    • Merge Requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamer
  • gstreamer-vaapigstreamer-vaapi
  • Issues
  • #304

Closed
Open
Created Feb 18, 2021 by Marianna Smidth Buschle@msb.qtec

Auto-calculation of bitrate bricks Vaapi encoder when framerate=0/1

Create a test file

GST_DEBUG=*:3 gst-launch-1.0 videotestsrc num-buffers=300 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! vaapih264enc rate-control=4 bitrate=20000 ! video/x-h264,profile=high ! filesink location=demo.h264

Transcode it: it works

GST_DEBUG=*:3 gst-launch-1.0 filesrc location=demo.h264 ! queue ! h264parse ! vaapih264dec ! queue ! "video/x-raw,format=NV12" ! queue ! vaapih264enc rate-control=4 bitrate=20000 ! video/x-h264,profile=high ! fakesink -v

Try to trasncode with automatic calculation of bitrate (bitrate=0): it stalls and leaves Vaapi in an un-usable state, requires reboot to recover.

GST_DEBUG=*:3 gst-launch-1.0 filesrc location=demo.h264 ! queue ! h264parse ! vaapih264dec ! queue ! "video/x-raw,format=NV12" ! queue ! vaapih264enc rate-control=4 bitrate=0 ! video/x-h264,profile=high ! fakesink -v

From https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/blob/master/gst-libs/gst/vaapi/gstvaapiencoder_h264.c#L2707

        base_encoder->bitrate =
            gst_util_uint64_scale (factor, GST_VAAPI_ENCODER_FPS_N (encoder),
            GST_VAAPI_ENCODER_FPS_D (encoder)) / 1000;

So I guess the fps=0 gives a bitrate of zero which breaks the encoder badly.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None