From f0986c13ae9ffb74a260796240d878d5eb1da42b Mon Sep 17 00:00:00 2001 From: CSReviser Date: Sun, 15 May 2022 19:48:56 +0900 Subject: [PATCH] =?UTF-8?q?ffmpeg=20=E9=8C=B2=E9=9F=B3=E3=81=8C=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E7=B5=82=E4=BA=86=E3=81=97=E3=81=AA=E3=81=84=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- downloadthread.cpp | 37 +++++++++++++++++++------------------ mainwindow.cpp | 2 +- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/downloadthread.cpp b/downloadthread.cpp index 4d74fb3..b3e5679 100644 --- a/downloadthread.cpp +++ b/downloadthread.cpp @@ -71,6 +71,7 @@ QString DownloadThread::suffix = "listdataflv.xml"; QString DownloadThread::prefix1 = "https://nhk-vh.akamaihd.net/i/gogaku-stream/mp4/"; QString DownloadThread::prefix2 = "https://nhks-vh.akamaihd.net/i/gogaku-stream/mp4/"; +//QString DownloadThread::prefix1 = "https://vod-stream.nhk.jp/radioondemand/r/"; QString DownloadThread::flv_host = "flv.nhk.or.jp"; QString DownloadThread::flv_app = "ondemand/"; @@ -90,22 +91,22 @@ QHash DownloadThread::processError; DownloadThread::DownloadThread( Ui::MainWindowClass* ui ) : isCanceled(false), failed1935(false) { this->ui = ui; if ( ffmpegHash.empty() ) { - ffmpegHash["3g2"] = "\"%1\" -y -i %2 -vn -bsf aac_adtstoasc -acodec copy \"%3\""; - ffmpegHash["3gp"] = "\"%1\" -y -i %2 -vn -bsf aac_adtstoasc -acodec copy \"%3\""; - ffmpegHash["aac"] = "\"%1\" -y -i %2 -vn -acodec copy \"%3\""; - ffmpegHash["avi"] = "\"%1\" -y -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec copy \"%3\""; - ffmpegHash["m4a"] = "\"%1\" -y -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -bsf aac_adtstoasc -acodec copy \"%3\""; - ffmpegHash["mka"] = "\"%1\" -y -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec copy \"%3\""; - ffmpegHash["mkv"] = "\"%1\" -y -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec copy \"%3\""; - ffmpegHash["mov"] = "\"%1\" -y -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -bsf aac_adtstoasc -acodec copy \"%3\""; - ffmpegHash["mp3"] = "\"%1\" -y -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec libmp3lame \"%3\""; - ffmpegHash["ts"] = "\"%1\" -y -i %2 -vn -acodec copy \"%3\""; - ffmpegHash["op0"] = "\"%1\" -y -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec:a libmp3lame -ab 64k -ac 1 \"%3\""; - ffmpegHash["op1"] = "\"%1\" -y -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec:a libmp3lame -ab 48k -ar 24000 -ac 1 \"%3\""; - ffmpegHash["op2"] = "\"%1\" -y -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec:a libmp3lame -ab 40k -ac 1 \"%3\""; - ffmpegHash["op3"] = "\"%1\" -y -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec:a libmp3lame -ab 32k -ac 1 \"%3\""; - ffmpegHash["op4"] = "\"%1\" -y -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec:a libmp3lame -ab 24k -ar 22050 -ac 1 \"%3\""; - ffmpegHash["op5"] = "\"%1\" -y -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec:a libmp3lame -ab 16k -ar 22050 -ac 1 \"%3\""; +// ffmpegHash["3g2"] = "\"%1\" -y -http_seekable 0 -i %2 -vn -bsf aac_adtstoasc -acodec copy \"%3\""; +// ffmpegHash["3gp"] = "\"%1\" -y -http_seekable 0 -i %2 -vn -bsf aac_adtstoasc -acodec copy \"%3\""; + ffmpegHash["aac"] = "\"%1\" -y -http_seekable 0 -i %2 -vn -acodec copy \"%3\""; +// ffmpegHash["avi"] = "\"%1\" -y -http_seekable 0 -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec copy \"%3\""; + ffmpegHash["m4a"] = "\"%1\" -y -http_seekable 0 -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -bsf aac_adtstoasc -acodec copy \"%3\""; +// ffmpegHash["mka"] = "\"%1\" -y -http_seekable 0 -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec copy \"%3\""; +// ffmpegHash["mkv"] = "\"%1\" -y -http_seekable 0 -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec copy \"%3\""; +// ffmpegHash["mov"] = "\"%1\" -y -http_seekable 0 -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -bsf aac_adtstoasc -acodec copy \"%3\""; + ffmpegHash["mp3"] = "\"%1\" -y -http_seekable 0 -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec libmp3lame \"%3\""; +// ffmpegHash["ts"] = "\"%1\" -y -http_seekable 0 -i %2 -vn -acodec copy \"%3\""; + ffmpegHash["op0"] = "\"%1\" -y -http_seekable 0 -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec:a libmp3lame -ab 64k -ac 1 \"%3\""; + ffmpegHash["op1"] = "\"%1\" -y -http_seekable 0 -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec:a libmp3lame -ab 48k -ar 24000 -ac 1 \"%3\""; + ffmpegHash["op2"] = "\"%1\" -y -http_seekable 0 -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec:a libmp3lame -ab 40k -ac 1 \"%3\""; + ffmpegHash["op3"] = "\"%1\" -y -http_seekable 0 -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec:a libmp3lame -ab 32k -ac 1 \"%3\""; + ffmpegHash["op4"] = "\"%1\" -y -http_seekable 0 -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec:a libmp3lame -ab 24k -ar 22050 -ac 1 \"%3\""; + ffmpegHash["op5"] = "\"%1\" -y -http_seekable 0 -i %2 -id3v2_version 3 -metadata title=\"%4\" -metadata artist=\"NHK\" -metadata album=\"%5\" -metadata date=\"%6\" -metadata genre=\"Speech\" -vn -acodec:a libmp3lame -ab 16k -ar 22050 -ac 1 \"%3\""; } if ( processError.empty() ) { processError[QProcess::FailedToStart] = "FailedToStart"; @@ -555,7 +556,7 @@ bool DownloadThread::captureStream( QString kouza, QString hdate, QString file, int month = hdate.left( 2 ).toInt(); int year = nendo.right( 4 ).toInt(); int day = hdate.mid( 3, 2 ).toInt(); - if ( 2020 > year ) return false; + if ( 2022 > year ) return false; if ( QString::compare( kouza , QString::fromUtf8( "ボキャブライダー" ) ) ==0 ){ if ( month == 3 && ( day == 30 || day == 31) && year == 2021 ) @@ -570,7 +571,7 @@ bool DownloadThread::captureStream( QString kouza, QString hdate, QString file, int year1 = QDate::currentDate().year(); if ( month < 4 ) year1 += 1; - QString kon_nendo = "2021"; //QString::number(year1); + QString kon_nendo = "2022"; //QString::number(year1); // if ( QString::compare( kouza , QString::fromUtf8( "ボキャブライダー" ) ) ==0 ){ // QDate today; diff --git a/mainwindow.cpp b/mainwindow.cpp index f0f5835..d1da0fe 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -77,7 +77,7 @@ namespace { // int day = regexp.cap( 2 ).toInt(); // result = QString( " (%1/%2/%3)" ).arg( regexp.cap( 3 ) ) // .arg( month, 2, 10, QLatin1Char( '0' ) ).arg( day, 2, 10, QLatin1Char( '0' ) ); - result = QString( " (2022/04/16)" ); + result = QString( " (2022/05/15)" ); } return result; }