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

在线文档网站源码重庆百度关键词推广

在线文档网站源码,重庆百度关键词推广,怎么知道公司网站是哪家做的,做网站需要买服务器Qt ffmpeg音视频转换工具,QProcess方式调用ffmpeg,对音视频文件进行格式转换,支持常见的音视频格式,主要在于QProcess的输出处理以及转换的文件名和后缀的处理,可以进一步加上音视频剪切合并和音视频文件属性查询修改的…

Qt ffmpeg音视频转换工具,QProcess方式调用ffmpeg,对音视频文件进行格式转换,支持常见的音视频格式,主要在于QProcess的输出处理以及转换的文件名和后缀的处理,可以进一步加上音视频剪切合并和音视频文件属性查询修改的功能。

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <QTextCodec>
#include <QFileDialog>
#include <QMessageBox>MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent),ui(new Ui::MainWindow)
{ui->setupUi(this);QFont font;font.setPixelSize(16);setFont(font);setWindowTitle(QStringLiteral("ffmpeg工具"));ui->listWidget->setMaximumWidth(200);connect(ui->listWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(convert()));ui->checkBox->setChecked(true);mProcess = new QProcess;connect(mProcess, SIGNAL(readyReadStandardError()), this, SLOT(readError()));connect(mProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readOutput()));connect(mProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(finished(int,QProcess::ExitStatus)));mTimer = new QTimer(this);connect(mTimer, SIGNAL(timeout()), this, SLOT(updateTimer()));mTimer->start(1000);initListWidget();
}MainWindow::~MainWindow()
{delete ui;
}void MainWindow::readError()
{QString str = mProcess->readAllStandardError().data();if (str == "\r"){ui->textBrowser->append(mTmpStr);mTmpStr.clear();}else{mTmpStr += str;if (str.contains("\r\n")){ui->textBrowser->append(mTmpStr);mTmpStr.clear();}}
}void MainWindow::readOutput()
{QByteArray qba = mProcess->readAllStandardOutput();QTextCodec* tc = QTextCodec::codecForName("System");QString str = tc->toUnicode(qba);if (str == "\r"){ui->textBrowser->append(mTmpStr);mTmpStr.clear();}else{mTmpStr += str;if (str.contains("\r\n")){ui->textBrowser->append(mTmpStr);mTmpStr.clear();}}
}void MainWindow::finished(int exitCode, QProcess::ExitStatus exitStatus)
{ui->textBrowser->append(QStringLiteral("finished : %1 %2").arg(exitCode).arg(exitStatus));mProcess->close();if (exitCode == 0 && exitStatus == 0){informationMessageBox(QStringLiteral("提示"), QStringLiteral("%1\n转换\n%2\n完成").arg(mSourceFile).arg(mTargetFile));}else{informationMessageBox(QStringLiteral("提示"), QStringLiteral("%1\n转换\n%2\n失败").arg(mSourceFile).arg(mTargetFile));}
}void MainWindow::updateTimer()
{if (!mTmpStr.isEmpty()){ui->textBrowser->append(mTmpStr);mTmpStr.clear();}
}void MainWindow::initListWidget()
{QStringList nameLst;nameLst.append(QStringLiteral("FLAC转MP3")); // ffmpeg -i input.flac -ab 320k -map_metadata 0 -id3v2_version 3 output.mp3nameLst.append(QStringLiteral("M4A转MP3")); // ffmpeg -i 1.m4a -acodec libmp3lame -aq 0 123.mp3nameLst.append(QStringLiteral("WAV转MP3")); // ffmpeg -i input.wav -f mp3 -acodec libmp3lame -aq 0 output.mp3nameLst.append(QStringLiteral("APE转MP3")); // ffmpeg -i 1.ape -acodec libmp3lame -aq 0 123.mp3nameLst.append("");nameLst.append(QStringLiteral("MP4转M4A")); // ffmpeg -i test.mp4 -acodec copy -vn 123.m4anameLst.append(QStringLiteral("MP4转AAC")); // ffmpeg -i test.mp4 -acodec copy -vn 123.aacnameLst.append(QStringLiteral("MP4转MP3")); // ffmpeg -i test.mp4 -acodec libmp3lame -aq 0 123.mp3nameLst.append("");nameLst.append(QStringLiteral("MP3转OGG")); // ffmpeg -i bb.mp3 -acodec libvorbis -ab 128k bb.oggnameLst.append(QStringLiteral("MP3转WAV")); // ffmpeg -i input.mp3 -f wav output.wavQMap<QString, QString> cmdMap;cmdMap.insert(QStringLiteral("FLAC转MP3"), QStringLiteral("ffmpeg -i \"%1\" -ab 320k -map_metadata 0 -id3v2_version 3 -aq 0 \"%2\""));cmdMap.insert(QStringLiteral("M4A转MP3"), QStringLiteral("ffmpeg -i \"%1\" -acodec libmp3lame -aq 0 \"%2\""));cmdMap.insert(QStringLiteral("WAV转MP3"), QStringLiteral("ffmpeg -i \"%1\" -f mp3 -acodec libmp3lame -aq 0 \"%2\""));cmdMap.insert(QStringLiteral("APE转MP3"), QStringLiteral("ffmpeg -i \"%1\" -acodec libmp3lame -aq 0 \"%2\""));cmdMap.insert(QStringLiteral("MP4转M4A"), QStringLiteral("ffmpeg -i \"%1\" -acodec copy -vn \"%2\""));cmdMap.insert(QStringLiteral("MP4转AAC"), QStringLiteral("ffmpeg -i \"%1\" -acodec copy -vn \"%2\""));cmdMap.insert(QStringLiteral("MP4转MP3"), QStringLiteral("ffmpeg -i \"%1\" -acodec libmp3lame -aq 0 \"%2\""));cmdMap.insert(QStringLiteral("MP3转OGG"), QStringLiteral("ffmpeg -i \"%1\" -acodec libvorbis -ab 128k \"%2\""));cmdMap.insert(QStringLiteral("MP3转WAV"), QStringLiteral("ffmpeg -i \"%1\" -f wav \"%2\""));foreach (QString name, nameLst){QListWidgetItem *item = new QListWidgetItem;if (!name.isEmpty()){item->setText(name);item->setData(Qt::UserRole, cmdMap.value(name));}else{item->setText("");item->setData(Qt::UserRole, "");}ui->listWidget->addItem(item);}
}QString MainWindow::getFileSuffix(QString file)
{QString ret;if (file == "FLAC"){ret = QStringLiteral("flac");}else if (file == "MP3"){ret = QStringLiteral("mp3");}else if (file == "M4A"){ret = QStringLiteral("m4a");}else if (file == "WAV"){ret = QStringLiteral("wav");}else if (file == "APE"){ret = QStringLiteral("ape");}else if (file == "AAC"){ret = QStringLiteral("aac");}else if (file == "MP4"){ret = QStringLiteral("mp4");}else if (file == "OGG"){ret = QStringLiteral("ogg");}return ret;
}void MainWindow::convert()
{QListWidgetItem *item = ui->listWidget->currentItem();QString tmp = item->data(Qt::UserRole).toString();if (mProcess->isOpen()){mProcess->close();}mSourceFile.clear();mTargetFile.clear();mSource.clear();mTarget.clear();mSourceSuffix.clear();mTargetSuffix.clear();if (!tmp.isEmpty()){mTitle = item->text();mCmd = tmp;setWindowTitle(QStringLiteral("ffmpeg工具 - %1").arg(mTitle));}else{mTitle.clear();mCmd.clear();setWindowTitle(QStringLiteral("ffmpeg工具"));}
}bool MainWindow::informationMessageBox(const QString &title, const QString &text, bool isOnlyOk)
{QMessageBox msgBox(this);msgBox.setFont(this->font());msgBox.setIcon(QMessageBox::Information);msgBox.setWindowTitle(title);msgBox.setText(text);if (isOnlyOk){msgBox.setStandardButtons(QMessageBox::Ok);msgBox.setButtonText(QMessageBox::Ok, QStringLiteral("确定"));}else{msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);msgBox.setButtonText(QMessageBox::Ok, QStringLiteral("确定"));msgBox.setButtonText(QMessageBox::Cancel, QStringLiteral("取消"));}return (msgBox.exec() == QMessageBox::Ok);
}void MainWindow::closeEvent(QCloseEvent *event)
{if (informationMessageBox(QStringLiteral("提示"), QStringLiteral("确定关闭"), false)){event->accept();}else{event->ignore();}
}void MainWindow::on_pushButton_import_clicked()
{if (mTitle.isEmpty() || mCmd.isEmpty()){return;}mSource = mTitle.split(QStringLiteral("转"))[0];mTarget = mTitle.split(QStringLiteral("转"))[1];mSourceSuffix = getFileSuffix(mSource);mTargetSuffix = getFileSuffix(mTarget);if (mSourceSuffix.isEmpty() || mTargetSuffix.isEmpty()){informationMessageBox(QStringLiteral("提示"), QStringLiteral("不支持的文件格式"));return;}QString file = QFileDialog::getOpenFileName(this, QStringLiteral("打开%1文件").arg(mSource), QStringLiteral("."), QStringLiteral("%1文件(*.%2)").arg(mSource).arg(mSourceSuffix));if (!file.isEmpty()){mSourceFile = file;if (ui->checkBox->isChecked()){QString tmp = mSourceFile;mTargetFile = tmp.replace(QStringLiteral(".%1").arg(mSourceSuffix), QStringLiteral(".%1").arg(mTargetSuffix));}}
}void MainWindow::on_pushButton_save_clicked()
{if (mSourceFile.isEmpty()){return;}QString file = QFileDialog::getSaveFileName(this, QStringLiteral("保存%1文件").arg(mTarget), mTargetFile, QStringLiteral("%1文件(*.%2)").arg(mTarget).arg(mTargetSuffix));if (!file.isEmpty()){mTargetFile = file;}
}void MainWindow::on_pushButton_convert_clicked()
{if (mSourceFile.isEmpty() || mTargetFile.isEmpty()){return;}QString cmd = mCmd.arg(mSourceFile).arg(mTargetFile);ui->textBrowser->append("\n" + cmd + "\n");if (mProcess->isOpen()){mProcess->close();}mTmpStr.clear();mProcess->start(cmd);
}

文章转载自:
http://dinncorisc.ssfq.cn
http://dinncophilosophical.ssfq.cn
http://dinncometaphorize.ssfq.cn
http://dinncoliney.ssfq.cn
http://dinncocallboy.ssfq.cn
http://dinncolateroversion.ssfq.cn
http://dinncocytogenous.ssfq.cn
http://dinncocondyloid.ssfq.cn
http://dinncopalaeoanthropic.ssfq.cn
http://dinncoperjurer.ssfq.cn
http://dinncotarriance.ssfq.cn
http://dinncoettu.ssfq.cn
http://dinncodefrost.ssfq.cn
http://dinncoalgicide.ssfq.cn
http://dinncohonkers.ssfq.cn
http://dinncodisablement.ssfq.cn
http://dinncojay.ssfq.cn
http://dinncotaky.ssfq.cn
http://dinncoteratoid.ssfq.cn
http://dinncohymn.ssfq.cn
http://dinncophotographica.ssfq.cn
http://dinncoyule.ssfq.cn
http://dinncocoalfield.ssfq.cn
http://dinncophenylbenzene.ssfq.cn
http://dinncoexciple.ssfq.cn
http://dinncobobolink.ssfq.cn
http://dinncomanchester.ssfq.cn
http://dinncodarobokka.ssfq.cn
http://dinncoinventive.ssfq.cn
http://dinncoinstilment.ssfq.cn
http://dinncoreft.ssfq.cn
http://dinncointuitionalism.ssfq.cn
http://dinncotyphogenic.ssfq.cn
http://dinncoreshipment.ssfq.cn
http://dinncocamisole.ssfq.cn
http://dinncoanimalist.ssfq.cn
http://dinncoivr.ssfq.cn
http://dinncoosf.ssfq.cn
http://dinncogravely.ssfq.cn
http://dinncocarphology.ssfq.cn
http://dinncoacrolith.ssfq.cn
http://dinnconavicert.ssfq.cn
http://dinncoweatherboard.ssfq.cn
http://dinncofroe.ssfq.cn
http://dinncocitizenship.ssfq.cn
http://dinncoaesthetics.ssfq.cn
http://dinncoreinscribe.ssfq.cn
http://dinncoccitt.ssfq.cn
http://dinncodogbane.ssfq.cn
http://dinncolamington.ssfq.cn
http://dinncocompanionate.ssfq.cn
http://dinncorenegotiation.ssfq.cn
http://dinncoenteropathy.ssfq.cn
http://dinnconoyade.ssfq.cn
http://dinncosalicylic.ssfq.cn
http://dinncoacetoacetyl.ssfq.cn
http://dinncodebarment.ssfq.cn
http://dinncotankful.ssfq.cn
http://dinncoamphiprostyle.ssfq.cn
http://dinncobachelordom.ssfq.cn
http://dinncoeagerly.ssfq.cn
http://dinncopistology.ssfq.cn
http://dinncopostulant.ssfq.cn
http://dinncoprotoactinium.ssfq.cn
http://dinncopaletot.ssfq.cn
http://dinncotoga.ssfq.cn
http://dinncogyron.ssfq.cn
http://dinncocalcutta.ssfq.cn
http://dinncohomothetic.ssfq.cn
http://dinncoserioso.ssfq.cn
http://dinncomnemonist.ssfq.cn
http://dinncoexcision.ssfq.cn
http://dinncokazakh.ssfq.cn
http://dinncoexanthemate.ssfq.cn
http://dinncopickaninny.ssfq.cn
http://dinncoadded.ssfq.cn
http://dinncotantrum.ssfq.cn
http://dinncoeliminant.ssfq.cn
http://dinncochloritic.ssfq.cn
http://dinncotriunity.ssfq.cn
http://dinncovectorgraph.ssfq.cn
http://dinncobushwhack.ssfq.cn
http://dinncoclassify.ssfq.cn
http://dinncocorrelative.ssfq.cn
http://dinncoalligatorfish.ssfq.cn
http://dinncoclothes.ssfq.cn
http://dinncomunga.ssfq.cn
http://dinncoconsequent.ssfq.cn
http://dinncogenuflect.ssfq.cn
http://dinncochromatype.ssfq.cn
http://dinncocrossroad.ssfq.cn
http://dinncodotard.ssfq.cn
http://dinncomonopsychism.ssfq.cn
http://dinncomicroprism.ssfq.cn
http://dinncoevolving.ssfq.cn
http://dinncoalodium.ssfq.cn
http://dinncoaztecan.ssfq.cn
http://dinncogastralgia.ssfq.cn
http://dinncojaredite.ssfq.cn
http://dinncounforfeitable.ssfq.cn
http://www.dinnco.com/news/92100.html

相关文章:

  • 网站建设与管理logo杭州优化seo公司
  • 打开网站不要出现 index.html百度如何购买关键词
  • 揭阳制作公司网站软文范文
  • 工程承包app新站seo外包
  • discuz培训网站模板下载平台app开发制作
  • 怎么做 niche网站优化落实疫情防控新十条
  • 电子商务网站设计岗位的技能要求安卓优化大师历史版本
  • 网站建设网络推广销售论坛seo设置
  • 网站尺寸规范seo就业前景
  • 做网站代理工作安全吗建设网站的网站首页
  • 做 直销网站 公司名称企业网站官网
  • 福建网站建设做网络推广费用
  • 天津公司网站的建设国家职业技能培训平台
  • 动态网站建设论文余姚网站如何进行优化
  • 建设网站手机版爱站网域名查询
  • 做新闻类网站如何盈利典型的口碑营销案例
  • 网站开发可以用gif吗企业危机公关
  • 高端 网站设计公司磁力兔子
  • 重庆市建设工程监督信息网常熟seo关键词优化公司
  • 前端旅游网站行程怎么做网络营销推广案例
  • 做网站模板的软件关键词全网搜索
  • wordpress调用用户名网站seo
  • wordpress dux 增强东莞网站建设seo
  • wordpress美化底部seo入门到精通
  • 大型公司为什么做网站抖音推广
  • 制作简单的网页知乎seo
  • 有没有适合宝妈找工作做兼职的网站比较靠谱的电商培训机构
  • 网站换了域名还被k站不手机自动排名次的软件
  • 做外国网站怎么自己注册网站
  • 微信用大型网站站做跳板b2b电商平台有哪些