当前位置: 首页 > news >正文

视频格式网络地址转换视频到本地,获取封面、时长,其他格式转换成mp4

使用ffmpeg软件转换网络视频,先从官网下载对应操作系统环境的包

注意:网络地址需要是视频格式结尾,例如.mp4,.flv 等

官网地址:Download FFmpeg     

window包:

415b5111089d42a4a02116b3fb877065.png

linux包:

39729fa04ffc4bf895ce22971e583292.png

如果下载缓慢,下载迅雷安装使用下载。

解压缩后对应截图:

window:

4cc5ed2dd51f4e6f9c96cb846d54e438.png

linux:

16eb35142ad44511b8c0089bd9437a56.png

在maven项目的pom.xml引入依赖包:

 <dependency><groupId>net.bramp.ffmpeg</groupId><artifactId>ffmpeg</artifactId><version>0.7.0</version></dependency><dependency><groupId>org.bytedeco</groupId><artifactId>javacpp</artifactId><version>1.4.1</version></dependency><dependency><groupId>org.bytedeco</groupId><artifactId>javacv</artifactId><version>1.4.1</version></dependency><dependency><groupId>org.bytedeco.javacpp-presets</groupId><artifactId>ffmpeg-platform</artifactId><version>3.4.2-1.4.1</version></dependency>

引入类:

import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import net.bramp.ffmpeg.FFmpeg;
import net.bramp.ffmpeg.FFmpegExecutor;
import net.bramp.ffmpeg.FFprobe;
import net.bramp.ffmpeg.builder.FFmpegBuilder;
import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.bytedeco.javacv.FrameGrabber;
import org.bytedeco.javacv.Java2DFrameConverter;import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.net.HttpURLConnection;
import java.net.URL;

网络地址转换成本地视频方法:

 /*** 视频链接转换成本地视频* @param videoUrl* @param downloadPath* @return*/public static boolean downVideo(String videoUrl,String downloadPath){HttpURLConnection connection = null;InputStream inputStream = null;RandomAccessFile randomAccessFile = null;boolean re;try{URL url = new URL(videoUrl);connection = (HttpURLConnection) url.openConnection();connection.setRequestProperty("Range","bytes=0-");connection.connect();if (connection.getResponseCode() / 100 != 2){System.out.println("链接失败");return  false;}inputStream = connection.getInputStream();int downloaded = 0;int fileSize = connection.getContentLength();randomAccessFile = new RandomAccessFile(downloadPath,"rw");while (downloaded < fileSize){byte[] buffer = null;if (fileSize - downloaded >= 1000000){buffer = new byte[1000000];}else{buffer = new byte[fileSize - downloaded];}int read = -1;int currentDownload = 0;while (currentDownload < buffer.length){read = inputStream.read();buffer[currentDownload++] = (byte) read;}randomAccessFile.write(buffer);downloaded += currentDownload;}re = true;return re;} catch (Exception e) {e.printStackTrace();re = false;return re;}finally {try{connection.disconnect();inputStream.close();randomAccessFile.close();}catch (Exception e){e.printStackTrace();}}}

网站地址转换成本地视频后,再转换成mp4视频方法:

/*** 其他视频格式地址转换成mp4* @param orginalVideoPath 原视频地址* @param newMp4FilePath 新mp4地址* @return*/public static boolean otherVideoToMp4(String orginalVideoPath,String newMp4FilePath)  {try{String ffmpegPath = "";String ffprobePath = "";if (SystemUtils.isWindows()){//目录里放的文件没有提交保存,在本地测试的时候自行添加ffmpegPath = VideoCovertUtil.class.getResource("/ffmpegdir/win/bin/ffmpeg.exe").getPath();ffprobePath = VideoCovertUtil.class.getResource("/ffmpegdir/win/bin/ffprobe.exe").getPath();}else if (SystemUtils.isLinux()){/*ffmpegPath = VideoCovertUtil.class.getResource("/ffmpegdir/linux/ffmpeg").getPath();ffprobePath = VideoCovertUtil.class.getResource("/ffmpegdir/linux/ffprobe").getPath();*///在linux安装ffmpeg后配置路径//安装步骤:https://blog.csdn.net/ysushiwei/article/details/130162831ffmpegPath = "/usr/local/bin/ffmpeg";ffprobePath = "/usr/local/bin/ffprobe";}log.info("ffmpegPath:"+ffmpegPath);log.info("ffmpegPath:"+ffprobePath);FFmpeg fFmpeg = new FFmpeg(ffmpegPath);FFprobe fFprobe = new FFprobe(ffprobePath);FFmpegBuilder builder = new FFmpegBuilder().setInput(orginalVideoPath).addOutput(newMp4FilePath).done();FFmpegExecutor executor = new FFmpegExecutor(fFmpeg,fFprobe);executor.createJob(builder).run();log.info("执行完毕");return  true;}catch (IOException e){e.printStackTrace();return false;}}

window可以直接放在项目中,但是linux还需要配置。步骤如下。

1、将上方的linux包上传到服务器,解压缩:

tar -xvf ffmpeg-release-amd64-static.tar.xz

2、解压缩后进入根目录分别复制根目录下的ffmpeg和ffprobe到 /usr/local/bin/目录下:

sudo cp 解压缩目录/ffmpeg /usr/local/bin/
sudo cp 解压缩目录/ffprobe /usr/local/bin/

3.还要给文件设置权限,否则运行代码的时候报没有权限:

sudo chmod +x /usr/local/bin/ffmpeg

sudo chmod +x /usr/local/bin/ffprobe

4、最后检查是否配置成功,如果有内容输出来则成功:

ffmpeg -version

ffprobe -version

linux环境配置好后,即可正常解析.

从视频中提取封面和获取时长:

 /*** 获取视频的第一帧封面* @param filePath 视频地址* @param targetPath 视频封面地址*/public static void getCover(String filePath,String targetPath){try{// 视频地址FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(new File(filePath));grabber.start();Java2DFrameConverter converter = new Java2DFrameConverter();BufferedImage image = converter.convert(grabber.grabImage());// 本地图片保存地址ImageIO.write(image, "png", new File(targetPath));grabber.stop();image.flush();}catch (Exception e){e.printStackTrace();}}/*** 使用FFmpeg获取视频时长** @param path 视频文件地址* @return 时长,单位为秒* @throws IOException*/public static String getDuration(String path) {// 读取视频文件FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(path);try {grabber.start();} catch (FrameGrabber.Exception e) {e.printStackTrace();}// 获取视频长度(单位:秒)int duration = grabber.getLengthInFrames() / (int) grabber.getFrameRate();try {grabber.stop();} catch (FrameGrabber.Exception e) {e.printStackTrace();}return DateUtil.secondToTime(duration);}

由于视频转换下载等速度比较慢,推荐使用异步执行。我用的是若依的框架,代码如下。如用其他框架,可自行参考写异步操作

//异步执行方法。不会等待执行完才执行下一位
AsyncManager.me().execute(AsyncFactory.convertVideoNetUrl(video.getVideoPath(),video.getId(),Constants.CONVERT_VIDEO_NET_VIDEO_URL));#在AsyncManager类里自定义一个异步方法如下/*** * @param videNetUrl 视频网络地址* @param id 类id* @param entityClazz 类 0:视频 1:文章* @return 任务task*/public static TimerTask convertVideoNetUrl(final String videNetUrl,Long id,Integer entityClazz){return new TimerTask(){@Overridepublic void run(){if (entityClazz == null || id == null || StrUtil.isBlank(videNetUrl)){return;}if (entityClazz == 0){IVideoService videoService =  SpringUtils.getBean(IVideoService.class);Video video = videoService.selectVideoById(id);if (video == null){return;}//现在是上传视频地址//先转换视频地址到服务器//后缀String ext = video.getVideoPath().substring(video.getVideoPath().lastIndexOf("."));String videosubpath = StringUtils.format("{}/{}_{}{}", DateUtils.datePath(),IdUtils.fastSimpleUUID(), Seq.getId(Seq.uploadSeqType), ext);String downloadPath = null;try {downloadPath = FileUploadUtils.getAbsoluteFile(HqaConfig.getUploadPath() + "/", videosubpath).getAbsolutePath();}catch (Exception e){e.printStackTrace();}boolean downVideo = VideoCovertUtil.downVideo(video.getVideoPath(),downloadPath);if (downVideo && StrUtil.isNotBlank(downloadPath) && downloadPath != null){if (!ext.contains("mp4")){//下载成功后如果不是mp4格式,转换成mp4格式String newVideosubpath = StringUtils.format("{}/{}_{}{}", DateUtils.datePath(),IdUtils.fastSimpleUUID(), Seq.getId(Seq.uploadSeqType), ".mp4");String newMp4FilePath = null;try {newMp4FilePath = FileUploadUtils.getAbsoluteFile(HqaConfig.getUploadPath() + "/", newVideosubpath).getAbsolutePath();}catch (Exception e){e.printStackTrace();}boolean toMp4 = VideoCovertUtil.otherVideoToMp4(downloadPath,newMp4FilePath);if (toMp4 && StrUtil.isNotBlank(newMp4FilePath) && newMp4FilePath != null){//转换成功后删除之前下载过的视频地址,并且保存新的mp4地址if (new File(downloadPath).exists()){FileUtils.deleteFile(downloadPath);}if (newMp4FilePath.contains("\\")){newMp4FilePath = newMp4FilePath.replace("\\","/");}String newPath = newMp4FilePath.replace(HqaConfig.getProfile(),"/profile");video.setVideoPath(newPath);}}else{if (downloadPath.contains("\\")){downloadPath = downloadPath.replace("\\","/");}//保存地址String newPath = downloadPath.replace(HqaConfig.getProfile(),"/profile");video.setVideoPath(newPath);}//视频截图和时长//获取视频第一帧封面String parentPath = HqaConfig.getUploadPath()+"/"+ DateUtils.datePath();String fileName = IdUtils.fastSimpleUUID()+".png";String targetPath = parentPath+"/"+ fileName;try {FileUploadUtils.getAbsoluteFile(parentPath,fileName);} catch (IOException e) {e.printStackTrace();}String filePath = video.getVideoPath().replace("/profile","");filePath=HqaConfig.getProfile()+filePath;VideoCovertUtil.getCover(filePath,targetPath);video.setCover(targetPath.replace(HqaConfig.getProfile(),"/profile"));String  duration = VideoCovertUtil.getDuration(filePath);video.setDuration(duration);videoService.updateVideo(video);}}else if (entityClazz == 1){IArticleService articleService = SpringUtils.getBean(IArticleService.class);Article article = articleService.selectArticleById(id);if (article == null){return;}//现在是上传视频地址//先转换视频地址到服务器//后缀String ext = article.getVideoPath().substring(article.getVideoPath().lastIndexOf("."));String videosubpath = StringUtils.format("{}/{}_{}{}", DateUtils.datePath(),IdUtils.fastSimpleUUID(), Seq.getId(Seq.uploadSeqType), ext);String downloadPath = null;try {downloadPath = FileUploadUtils.getAbsoluteFile(HqaConfig.getUploadPath() + "/", videosubpath).getAbsolutePath();}catch (Exception e){e.printStackTrace();}boolean downVideo = VideoCovertUtil.downVideo(article.getVideoPath(),downloadPath);if (downVideo && StrUtil.isNotBlank(downloadPath) && downloadPath != null){if (!ext.contains("mp4")){//下载成功后如果不是mp4格式,转换成mp4格式String newVideosubpath = StringUtils.format("{}/{}_{}{}", DateUtils.datePath(),IdUtils.fastSimpleUUID(), Seq.getId(Seq.uploadSeqType), ".mp4");String newMp4FilePath = null;try {newMp4FilePath = FileUploadUtils.getAbsoluteFile(HqaConfig.getUploadPath() + "/", newVideosubpath).getAbsolutePath();}catch (Exception e){e.printStackTrace();}boolean toMp4 = VideoCovertUtil.otherVideoToMp4(downloadPath,newMp4FilePath);if (toMp4 && StrUtil.isNotBlank(newMp4FilePath) && newMp4FilePath != null){//转换成功后删除之前下载过的视频地址,并且保存新的mp4地址if (new File(downloadPath).exists()){FileUtils.deleteFile(downloadPath);}if (newMp4FilePath.contains("\\")){newMp4FilePath = newMp4FilePath.replace("\\","/");}String newPath = newMp4FilePath.replace(HqaConfig.getProfile(),"/profile");article.setVideoPath(newPath);}}else{if (downloadPath.contains("\\")){downloadPath = downloadPath.replace("\\","/");}//保存地址String newPath = downloadPath.replace(HqaConfig.getProfile(),"/profile");article.setVideoPath(newPath);}articleService.updateArticle(article);}}}};}

相关文章:

视频格式网络地址转换视频到本地,获取封面、时长,其他格式转换成mp4

使用ffmpeg软件转换网络视频&#xff0c;先从官网下载对应操作系统环境的包 注意:网络地址需要是视频格式结尾&#xff0c;例如.mp4,.flv 等 官网地址&#xff1a;Download FFmpeg window包&#xff1a; linux包&#xff1a; 如果下载缓慢&#xff0c;下载迅雷安装使用…...

企业私有云容器化架构运维实战

什么是虚拟化: 虚拟化&#xff08;Virtualization&#xff09;技术最早出现在 20 世纪 60 年代的 IBM 大型机系统&#xff0c;在70年代的 System 370 系列中逐渐流行起来&#xff0c;这些机器通过一种叫虚拟机监控器&#xff08;Virtual Machine Monitor&#xff0c;VMM&#x…...

Baumer工业相机堡盟工业相机如何通过NEOAPI SDK使用UserSet功能保存和载入相机的各类参数(C++)

Baumer工业相机堡盟工业相机如何通过NEOAPI SDK使用UserSet功能保存和载入相机的各类参数&#xff08;C&#xff09; Baumer工业相机Baumer工业相机NEOAPISDK中UserSet的技术背景代码案例分享第一步&#xff1a;保存相机当前参数设置UserSet_Save第二步&#xff1a;载入已经保存…...

STM32的以太网外设+PHY(LAN8720)使用详解(3):PHY寄存器详解

0 工具准备 1.野火 stm32f407霸天虎开发板 2.LAN8720数据手册 3.STM32F4xx中文参考手册1 PHY寄存器 前面介绍到&#xff0c;站管理接口&#xff08;SMI&#xff09;允许应用程序通过2线时钟和数据线访问任意PHY寄存器&#xff0c;同时该接口支持访问最多32个PHY&#xff0c;也…...

缓存和缓冲的区别

近期被这两个词汇困扰了&#xff0c;感觉有本质的区别&#xff0c;搜了一些资料&#xff0c;整理如下 计算机内部的几个部分图如下 缓存&#xff08;cache&#xff09; https://baike.baidu.com/item/%E7%BC%93%E5%AD%98 提到缓存&#xff08;cache&#xff09;&#xff0c;就…...

C++高级-STL库概述

目录 一、概念 二、STL的历史背景 三、STL的版本 四、STL的主要优势...

uniapp 统一获取授权提示和48小时间隔授权

应用商店审核要求 获取权限前需要给提示&#xff0c;拒绝之后48小时不能给弹窗授权 项目用的是uniapp getImagePermission(v?: string, tag?: any, source?: any, proj?: any) {// proj proj || vueSelf.$proj(tag, source);let data {state: false,//是否原生授权denied…...

Halcon点云重建

dev_close_window () *点云文件数据的读取 read_object_model_3d (‘E:/1.om3’, ‘mm’, [], [], ObjectModel3D, Status) *获得点云的数据&#xff0c;例如高度 get_object_model_3d_params (ObjectModel3D, ‘point_coord_z’, GenParamValue) dev_open_window (0, 0, 512, …...

docker学习(二十一、network使用示例container、自定义)

文章目录 一、container应用示例1.需要共用同一个端口的服务&#xff0c;不适用container方式2.可用示例3.停掉共享源的容器&#xff0c;其他容器只有本地回环lo地址 总结 二、自定义网络应用示例默认bridge&#xff0c;容器间ip通信默认bridge&#xff0c;容器间服务名不通 自…...

【Python机器学习系列】一文带你了解机器学习中的Pipeline管道机制(理论+源码)

这是Python机器学习原创文章&#xff0c;我的第183篇原创文章。 一、引言 对于表格数据&#xff0c;一套完整的机器学习建模流程如下&#xff1a; 背景知识1&#xff1a;机器学习中的学习器 【Python机器学习系列】一文搞懂机器学习中的转换器和估计器&#xff08;附案例&…...

算法基础之整数划分

整数划分 核心思想&#xff1a; 计数类dp 背包做法 f[i][j] 表示 取 1 – i 的物品 总容量为j的选法数量 f[i][j] f[i-1][j] f[i-1][j-v[i]] f[i-1][j-2v[i]] f[i-1][j-3v[i]] ……f[i-1][j-kv[i]] f[i][j-v[i]] f[i-1][j-v[i]] f[i-1][j-2v[i]] f[i-1][j-3v[i]] ……f[i…...

关于“Python”的核心知识点整理大全47

目录 16.1.10 错误检查 highs_lows.py highs_lows.py 16.2 制作世界人口地图&#xff1a;JSON 格式 16.2.1 下载世界人口数据 16.2.2 提取相关的数据 population_data.json world_population.py 16.2.3 将字符串转换为数字值 world_population.py 2world_population…...

Android 8.1 设置USB传输文件模式(MTP)

项目需求&#xff0c;需要在电脑端adb发送通知手机端接收指令&#xff0c;将USB的仅充电模式更改成传输文件&#xff08;MTP&#xff09;模式&#xff0c;便捷用户在我的电脑里操作内存文件&#xff0c;下面是我们的常见的修改方式 1、android12以下、android21以上是这种方式…...

模型量化 | Pytorch的模型量化基础

官方网站&#xff1a;Quantization — PyTorch 2.1 documentation Practical Quantization in PyTorch | PyTorch 量化简介 量化是指执行计算和存储的技术 位宽低于浮点精度的张量。量化模型 在张量上执行部分或全部操作&#xff0c;精度降低&#xff0c;而不是 全精度&#xf…...

adb和logcat常用命令

adb的作用 adb构成 client端&#xff0c;在电脑上&#xff0c;负责发送adb命令daemon守护进程adbd&#xff0c;在手机上&#xff0c;负责接收和执行adb命令server端&#xff0c;在电脑上&#xff0c;负责管理client和daemon之间的通信 adb工作原理 client端将命令发送给ser…...

千巡翼X4轻型无人机 赋能智慧矿山

千巡翼X4轻型无人机 赋能智慧矿山 传统的矿山测绘需要大量测绘员通过采用手持RTK、全站仪对被测区域进行外业工作&#xff0c;再通过方格网法、三角网法、断面法等进行计算&#xff0c;需要耗费大量人力和时间。随着无人机航测技术的不断发展&#xff0c;利用无人机作业可以大…...

【Android 13】使用Android Studio调试系统应用之Settings移植(一):编译服务器的配置、AOSP源码的下载、编译、运行

文章目录 1. 篇头语2. 系列文章3. ubuntu 最佳版本3.1 下载并安装3.2 配置AOSP工具链3.3 配置Python多版本支持4. AOSP源码下载4.1 配置repo工具4.2 源码下载5. AOSP编译5.1 添加emulator模拟器配置5.1.1 哪些是支持模拟器的Products?5.1.2 添加方法5.2 编译...

【1】Docker详解与部署微服务实战

Docker 详解 Docker 简介 Docker 是一个开源的容器化平台&#xff0c;可以帮助开发者将应用程序和其依赖的环境打包成一个可移植、可部署的容器。Docker 的主要目标是通过容器化技术实现应用程序的快速部署、可移植性和可扩展性&#xff0c;从而简化应用程序的开发、测试和部…...

C# JsonString转Object以及Object转JsonString

主要讲述了两种方法的转换&#xff0c;最后提供了格式化输出JsonString字符串。 需要引用程序集 System.Web.Extensions.dll、Newtonsoft.Json.dll System.Web.Extensions.dll可直接在程序集中引用&#xff0c;Newtonsoft.Json.dll需要在NuGet中下载引用。 详细代码&#xf…...

华为OD机试真题-中文分词模拟器-2023年OD统一考试(C卷)

题目描述: 给定一个连续不包含空格字符串,该字符串仅包含英文小写字母及英文文标点符号(逗号、分号、句号),同时给定词库,对该字符串进行精确分词。 说明: 1.精确分词: 字符串分词后,不会出现重叠。即“ilovechina” ,不同词库可分割为 “i,love,china” “ilove,c…...

【Java学习笔记】Arrays类

Arrays 类 1. 导入包&#xff1a;import java.util.Arrays 2. 常用方法一览表 方法描述Arrays.toString()返回数组的字符串形式Arrays.sort()排序&#xff08;自然排序和定制排序&#xff09;Arrays.binarySearch()通过二分搜索法进行查找&#xff08;前提&#xff1a;数组是…...

解决Ubuntu22.04 VMware失败的问题 ubuntu入门之二十八

现象1 打开VMware失败 Ubuntu升级之后打开VMware上报需要安装vmmon和vmnet&#xff0c;点击确认后如下提示 最终上报fail 解决方法 内核升级导致&#xff0c;需要在新内核下重新下载编译安装 查看版本 $ vmware -v VMware Workstation 17.5.1 build-23298084$ lsb_release…...

现代密码学 | 椭圆曲线密码学—附py代码

Elliptic Curve Cryptography 椭圆曲线密码学&#xff08;ECC&#xff09;是一种基于有限域上椭圆曲线数学特性的公钥加密技术。其核心原理涉及椭圆曲线的代数性质、离散对数问题以及有限域上的运算。 椭圆曲线密码学是多种数字签名算法的基础&#xff0c;例如椭圆曲线数字签…...

GitHub 趋势日报 (2025年06月08日)

&#x1f4ca; 由 TrendForge 系统生成 | &#x1f310; https://trendforge.devlive.org/ &#x1f310; 本日报中的项目描述已自动翻译为中文 &#x1f4c8; 今日获星趋势图 今日获星趋势图 884 cognee 566 dify 414 HumanSystemOptimization 414 omni-tools 321 note-gen …...

HarmonyOS运动开发:如何用mpchart绘制运动配速图表

##鸿蒙核心技术##运动开发##Sensor Service Kit&#xff08;传感器服务&#xff09;# 前言 在运动类应用中&#xff0c;运动数据的可视化是提升用户体验的重要环节。通过直观的图表展示运动过程中的关键数据&#xff0c;如配速、距离、卡路里消耗等&#xff0c;用户可以更清晰…...

uniapp 小程序 学习(一)

利用Hbuilder 创建项目 运行到内置浏览器看效果 下载微信小程序 安装到Hbuilder 下载地址 &#xff1a;开发者工具默认安装 设置服务端口号 在Hbuilder中设置微信小程序 配置 找到运行设置&#xff0c;将微信开发者工具放入到Hbuilder中&#xff0c; 打开后出现 如下 bug 解…...

深度学习之模型压缩三驾马车:模型剪枝、模型量化、知识蒸馏

一、引言 在深度学习中&#xff0c;我们训练出的神经网络往往非常庞大&#xff08;比如像 ResNet、YOLOv8、Vision Transformer&#xff09;&#xff0c;虽然精度很高&#xff0c;但“太重”了&#xff0c;运行起来很慢&#xff0c;占用内存大&#xff0c;不适合部署到手机、摄…...

算法—栈系列

一&#xff1a;删除字符串中的所有相邻重复项 class Solution { public:string removeDuplicates(string s) {stack<char> st;for(int i 0; i < s.size(); i){char target s[i];if(!st.empty() && target st.top())st.pop();elsest.push(s[i]);}string ret…...

医疗AI模型可解释性编程研究:基于SHAP、LIME与Anchor

1 医疗树模型与可解释人工智能基础 医疗领域的人工智能应用正迅速从理论研究转向临床实践,在这一过程中,模型可解释性已成为确保AI系统被医疗专业人员接受和信任的关键因素。基于树模型的集成算法(如RandomForest、XGBoost、LightGBM)因其卓越的预测性能和相对良好的解释性…...

【大模型】RankRAG:基于大模型的上下文排序与检索增强生成的统一框架

文章目录 A 论文出处B 背景B.1 背景介绍B.2 问题提出B.3 创新点 C 模型结构C.1 指令微调阶段C.2 排名与生成的总和指令微调阶段C.3 RankRAG推理&#xff1a;检索-重排-生成 D 实验设计E 个人总结 A 论文出处 论文题目&#xff1a;RankRAG&#xff1a;Unifying Context Ranking…...