{"id":13907975,"url":"https://github.com/RealChuan/Qt-Media","last_synced_at":"2025-07-18T06:32:08.600Z","repository":{"id":62361650,"uuid":"329624934","full_name":"RealChuan/Qt-Media","owner":"RealChuan","description":"qt多媒体套件，结合ffmpeg和mpv，用于增强视频播放和转码。","archived":false,"fork":false,"pushed_at":"2024-11-12T01:25:22.000Z","size":1969,"stargazers_count":30,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-12T02:24:39.418Z","etag":null,"topics":["aac","argb","bgra","breakpad","crashpad","ffmpeg","gpu-decoding","gpu-encoding","libass","mpv","nv12","nv21","opengl","qt","rgba","subtitle","transcoding","yuv420p","yuv422p","yuyv422"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RealChuan.png","metadata":{"files":{"readme":"README.en.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-14T13:33:57.000Z","updated_at":"2024-11-12T01:25:25.000Z","dependencies_parsed_at":"2024-03-15T11:49:17.594Z","dependency_job_id":"0ebbcf61-46c5-444c-95e3-c3cf523bac35","html_url":"https://github.com/RealChuan/Qt-Media","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealChuan%2FQt-Media","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealChuan%2FQt-Media/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealChuan%2FQt-Media/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RealChuan%2FQt-Media/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RealChuan","download_url":"https://codeload.github.com/RealChuan/Qt-Media/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226361627,"owners_count":17612931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aac","argb","bgra","breakpad","crashpad","ffmpeg","gpu-decoding","gpu-encoding","libass","mpv","nv12","nv21","opengl","qt","rgba","subtitle","transcoding","yuv420p","yuv422p","yuyv422"],"created_at":"2024-08-06T23:02:22.039Z","updated_at":"2025-07-18T06:32:08.590Z","avatar_url":"https://github.com/RealChuan.png","language":"C++","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# Qt-Ffmpeg\n\n-   [Simplified Chinese](README.md)\n-   [English](README.en.md)\n\n## Player\n\n\u003cdiv align=center\u003e\n\u003cimg src=\"doc/player.jpeg\" width=\"90%\" height=\"90%\"\u003e\n\u003c/div\u003e\n\n### Requires a powerful opengl and vulkan yuv rendering module\n\n1.  Opengl's fragment shader currently supports limited image formats;\n2.  In WidgetRender, use the QImage::Format_RGB32 and QImage::Format_ARGB32_Premultiplied image formats whenever possible. The following reasons:\n    1.  Avoid most rendering directly to most of these formats using QPainter. Rendering is best optimized to the Format_RGB32  and Format_ARGB32_Premultiplied formats, and secondarily for rendering to the Format_RGB16, Format_RGBX8888,  Format_RGBA8888_Premultiplied, Format_RGBX64 and Format_RGBA64_Premultiplied formats.\n\n### AVFrame image adjustment\n\n1.  according to`AVColorSpace`Perform color space conversion;\n2.  according to`AVColorTransferCharacteristic`Make adjustments to gamma, PQ, HLG, etc.;\n3.  according to`AVColorPrimaries`Perform color gamut conversion;\n4.  according to`AVColorRange`Make color range adjustments;\n\n#### 1. How to modify the shader when rendering with opengl?\n\n1.  reference[MPV video_shaders](https://github.com/mpv-player/mpv/blob/master/video/out/gpu/video_shaders.c)；\n\n#### 2. In the case of non-opengl rendering, how to add a filter to achieve image compensation?\n\n```bash\nzscale=p=709;\n```\n\n### How to achieve image quality enhancement when rendering images with OpenGL?\n\n### Ffmpeg (5.0) decodes subtitles differently than 4.4.3\n\n#### Decode subtitles (ffmpeg-n5.0)\n\n```bash\n0,,en,,0000,0000,0000,,Peek-a-boo!\n```\n\nyou have to use`ass_process_chunk`and set pts and duration, and in[vf_subtitles.c](https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/vf_subtitles.c#L490)Same as in.\n\n#### The ASS standard format should be (ffmpeg-n4.4.3)\n\n```bash\nDialogue: 0,0:01:06.77,0:01:08.00,en,,0000,0000,0000,,Peek-a-boo!\\r\\n\n```\n\nuse`ass_process_data`;\n\n### Issue with subtitle display timing when using subtitle filter\n\n```bash\nsubtitles=filename='%1':original_size=%2x%3\n```\n\n## Transcoder\n\nHow to set encoding parameters to get smaller files and better video quality?\n\n1.  reference[HandBrake encavcodec](https://github.com/HandBrake/HandBrake/blob/master/libhb/encavcodec.c#L359)\n\n### How to calculate pts from frames obtained by AVAudioFifo?\n\n```C++\n// fix me?\nframe-\u003epts = transcodeCtx-\u003eaudioPts / av_q2d(transcodeCtx-\u003edecContextInfoPtr-\u003etimebase())\n                     / transcodeCtx-\u003edecContextInfoPtr-\u003ecodecCtx()-\u003esampleRate();\ntranscodeCtx-\u003eaudioPts += frame-\u003enb_samples;\n```\n\n### [New BING’s video transcoding recommendations](./doc/bing_transcode.md)\n\n## SwsContext is great! Compared to QImage convert to and scale\n\n## QT-BUG\n\n### Dynamically switching Video Render, switching from opengl to widget, still consumes GPU 0-3D, and the usage is twice that of opengl! ! ! QT-BUG?\n\n### QOpenGLWidget memory leaks, moves to zoom in and out the window, the code is as follows\n\n```C++\nint main(int argc, char *argv[])\n{\n    QApplication a(argc, argv);\n    MainWindow w;\n    w.show();\n    return a.exec();\n}\n\nMainWindow::MainWindow(QWidget *parent)\n    : QMainWindow(parent)\n{\n    setCentralWidget(new QOpenGLWidget(this));\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRealChuan%2FQt-Media","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRealChuan%2FQt-Media","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRealChuan%2FQt-Media/lists"}