Projects
Multimedia
screengen
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 6
View file
screengen.changes
Changed
@@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Aug 11 18:25:52 UTC 2016 - lazy.kent@opensuse.org + +- Update to 1.9. + * Fixed deprecated call of FFMpeg (2.4.3). +- Correct URL and source URL. + +------------------------------------------------------------------- Sat Sep 13 22:37:51 UTC 2014 - lazy.kent@opensuse.org - Update to 1.8.
View file
screengen.spec
Changed
@@ -1,7 +1,7 @@ # # spec file for package screengen # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,16 +16,16 @@ # -%define bversion 20140909 - +%define bversion 20150803 Name: screengen -Version: 1.8 +Version: 1.9 Release: 0 -License: GPL-3.0 Summary: Screenlist Generator -Url: http://qt-apps.org/content/show.php/ScreenGen+-+Screenlist+generator?content=153485 +License: GPL-3.0 Group: Productivity/Multimedia/Video/Players -Source0: http://www.kochkin.org/lib/exe/fetch.php/%{name}/%{name}-%{version}-%{bversion}.tar.bz2 +Url: http://www.kochkin.tk/doku.php/screengen/start +Source0: http://www.kochkin.tk/screengen/devel/%{name}-%{version}-%{bversion}.tar.bz2 +BuildRequires: pkgconfig BuildRequires: pkgconfig(QtCore) >= 4.8 BuildRequires: pkgconfig(QtGui) >= 4.8 BuildRequires: pkgconfig(libavcodec) = 56.60.100 @@ -43,7 +43,7 @@ file. %prep -%setup -qn %{name} +%setup -q -n %{name} # Avoid /usr/bin/perl dependency. chmod -x example-scripts/screengen-*
View file
screengen-1.8-20140909.tar.bz2/CHANGELOG -> screengen-1.9-20150803.tar.bz2/CHANGELOG
Changed
@@ -48,3 +48,7 @@ * Added parameter "version". * Added parameter "stampStart". * Added example scripts. + +(1.9) +* Fixed deprecated call of FFMpeg (2.4.3). +
View file
screengen-1.8-20140909.tar.bz2/src/build_number.h -> screengen-1.9-20150803.tar.bz2/src/build_number.h
Changed
@@ -1,2 +1,2 @@ -#define VERSION_NUMBER "1.8" -#define BUILD_NUMBER "2014.09.09" +#define VERSION_NUMBER "1.9" +#define BUILD_NUMBER "2015.08.03"
View file
screengen-1.8-20140909.tar.bz2/src/main.cpp -> screengen-1.9-20150803.tar.bz2/src/main.cpp
Changed
@@ -1,6 +1,6 @@ #include "build_number.h" #define VERSION VERSION_NUMBER"-"BUILD_NUMBER -#define COPYRIGHT "ScreenGen. Version "VERSION_NUMBER" (build "BUILD_NUMBER"). Copyright (C) 2012-2014 Oleg Kochkin (www.kochkin.tk). License - GPL." +#define COPYRIGHT "ScreenGen. Version "VERSION_NUMBER" (build "BUILD_NUMBER"). Copyright (C) 2012-2015 Oleg Kochkin (www.kochkin.tk). License - GPL." #include <QApplication> #include <QPainter> @@ -25,9 +25,9 @@ app.installTranslator (&translator); QTextStream(stdout)<<COPYRIGHT<<"\n"<<endl; -// Видеофайл +// Videofile QString videoFile = ""; -// Секция предустановок +// Preset section QString preset="Default"; for (int i=1;i<argc;i++) if (QString(argv[i]) == "--preset") preset=argv[i+1]; @@ -333,11 +333,11 @@ TFfmpeg *video = new TFfmpeg(videoFile); if (video->error != 0) return 3; -// Ширина листа, исключая бордюр +// Width of the list, excluding a border int wList = widthList - listBorder * 2; -// Ширина кадра в листе +// Width of the frame list int widthFrame = wList / horCount; -// Количество кадров по вертикали в листе +// Number of frames in vertical on list int vertCount = frames / horCount; int fullLength = video->iDuration / 1000; @@ -356,17 +356,17 @@ frames = horCount * vertCount; } -// Ширина кадра в видеофайле +// Width of the frame in a video file int wFrame = video->vWidth; -// Высота кадра в видеофайле +// Height of the frame in a video file int hFrame = video->vHeight; -// Коэффициент уменьшения (соотношение ширины/высоты кадра в видеофайле к ширине/высоте кадра в листе) +// Reduction ratio (ratio of width/height of the frame in a video file to the width/height of the frame in the list) double koeff = (double) wFrame / widthFrame; -// Высота кадра в листе +// Height of the frame in the list int heightFrame = hFrame / koeff; if (aspect < -0.001 || aspect > 0.001) heightFrame = (double) widthFrame / aspect; else heightFrame = (double) widthFrame / video->dar; -// Высота листа +// Height of the list int hList = heightFrame * vertCount + listBorder * 2; if (version) hList = hList + 20; @@ -377,18 +377,22 @@ if (! descr.isEmpty()) headerH=(fontHeaderSize+(double)5)*7; - if (! header) headerH=0; + int kFrameBorder=3; + if (! header){ + headerH=0; + kFrameBorder=1; + } QImage imList (wList+listBorder*2, hList+headerH+frameBorder*2, QImage::Format_ARGB32_Premultiplied); imList.fill (getColorFromString(backgroundColor)); -// Формирование тени для кадра +// Creating shade for the frame QImage imFrameShadowSource (widthFrame-frameBorder*2, heightFrame-frameBorder*2, QImage::Format_ARGB32); imFrameShadowSource.fill ("black"); QImage imFrameShadow = getShadow (imFrameShadowSource, shadowInt, getColorFromString (shadowColor)); QPainter pList (&imList); if (! background.isEmpty()) pList.drawImage(QRectF (0,0,imList.width(),imList.height()),QImage (background)); -// Заголовок +// Header if (header){ int headerW=widthFrame*horCount-frameBorder*2; int headerY=listBorder+frameBorder; @@ -443,7 +447,7 @@ pList.drawImage ((listBorder+frameBorder+infoShadowOffset)-infoShadowInt, (listBorder+infoShadowOffset+frameBorder)-infoShadowInt, imTextS); pList.drawImage (listBorder+frameBorder, listBorder+frameBorder, imText); -// Логотип +// Logo if (! logoFile.isEmpty()){ QImage imLogo(logoFile); double imLogoAspect = (double) imLogo.width() / imLogo.height(); @@ -456,7 +460,7 @@ } } -// Кадры +// Frames int numFrame=0; for (int vi = 0;vi < vertCount;vi++){ @@ -498,8 +502,8 @@ } int cX=hi*widthFrame+headerX; - int cY=vi*heightFrame+listBorder+frameBorder*3+headerH; - pList.drawImage (cX+shadowOffset-shadowInt, (vi*heightFrame+headerH+listBorder+shadowOffset+frameBorder*3)-shadowInt, imFrameShadow); + int cY=vi*heightFrame+listBorder+frameBorder*kFrameBorder+headerH; + pList.drawImage (cX+shadowOffset-shadowInt, (vi*heightFrame+headerH+listBorder+shadowOffset+frameBorder*kFrameBorder)-shadowInt, imFrameShadow); pList.drawImage (cX, cY, imFrame); if (frameBox > 0){ pList.setPen (QPen (getColorFromString (frameBoxColor), frameBox)); @@ -520,7 +524,7 @@ return 0; } -// Получение цвета из строки "R,G,B[,A]" -> QColor +// Get color from string "R,G,B[,A]" -> QColor QColor getColorFromString (QString tc) { QColor retColor ("red"); if (tc.split(",").length() == 3) retColor = QColor (tc.split(",")[0].toInt(),tc.split(",")[1].toInt(),tc.split(",")[2].toInt());
View file
screengen-1.8-20140909.tar.bz2/src/qffmpeg.cpp -> screengen-1.9-20150803.tar.bz2/src/qffmpeg.cpp
Changed
@@ -1,6 +1,6 @@ #include "qffmpeg.h" -// Открывает видеофайл, инициализирует кодеки, получает информацию о потоках +// Open videofile, codecs init, get streams info TFfmpeg::TFfmpeg(QString videoFile){ error=0; av_log_set_level(AV_LOG_QUIET); @@ -9,26 +9,26 @@ pAVFormatContext = avformat_alloc_context(); if (avformat_open_input (&pAVFormatContext, videoFile.toLocal8Bit(), NULL, NULL)!=0){ - QTextStream(stdout)<<"Error open file:"<<videoFile<<"\n"; + QTextStream(stdout)<<"Error open file: "<<videoFile<<"\n"; error=1; return; } else if (avformat_find_stream_info (pAVFormatContext, NULL) < 0){ - QTextStream(stdout)<<"Not found streams in"<<videoFile<<"\n"; + QTextStream(stdout)<<"Not found streams in "<<videoFile<<"\n"; error=1; return; } -// Продолжительность +// Duration duration = QTime(0,0,0,0).addMSecs (pAVFormatContext->duration / 1000).toString("hh:mm:ss"); -// Общий битрейт всех потоков +// Full bitrate for all streams fullBitrate = QString::number (pAVFormatContext->bit_rate / 1000); -// Количество потоков +// Streams count streamsCount = pAVFormatContext->nb_streams; -// Строка основных параметров +// Main parameters string generalInfo = duration+", "+QObject::tr("Streams:")+" "+QString::number (streamsCount)+", "+QObject::tr("Full bitrate:")+" "+fullBitrate+" "+QObject::tr("kb/s"); -// Проверка наличия видеопотока и получение его номера +// Check video stream exists and get his number vStreamNumber=-1; for (uint i=0; i < pAVFormatContext->nb_streams;i++) if (pAVFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO){ @@ -36,34 +36,36 @@ break; } if (vStreamNumber == -1){ - QTextStream(stdout)<<"Not video stream in"<<videoFile<<"\n"; + QTextStream(stdout)<<"Not video stream in "<<videoFile<<"\n"; error=1; return; } -// Проверка наличия в ffmpeg кодека для видеопотока +// Check codec exists for video stream AVStream *vStream = pAVFormatContext->streams[vStreamNumber]; vCodecContext = vStream->codec; vCodec = avcodec_find_decoder (vCodecContext->codec_id); if (avcodec_open2 (vCodecContext, vCodec, NULL)){ - QTextStream(stdout)<<"Not open video codec in"<<videoFile<<"\n"; + QTextStream(stdout)<<"Not open video codec in "<<videoFile<<"\n"; error=1; return; } -// Частота кадров - vFps = QString::number ((double) vStream->r_frame_rate.num / vStream->r_frame_rate.den); -// Кодек +// FPS + vFps = ""; + if (vStream->avg_frame_rate.den && vStream->avg_frame_rate.num) vFps = QString::number ((double) av_q2d (vStream->avg_frame_rate)); + else if (vStream->r_frame_rate.den && vStream->r_frame_rate.num) vFps = QString::number ((double) av_q2d (vStream->r_frame_rate)); +// Video codec vCodecName = QString(vCodec->name).toUpper(); -// Размер исходного кадра +// Size source frame vWidth = vCodecContext->width; vHeight = vCodecContext->height; -// Размер исходного кадра в текстовом виде +// Size source frame in text vResolution = QString::number (vWidth) + "x" + QString::number (vHeight); -// Продолжительность +// Duration iDuration = pAVFormatContext->duration; -// Вычисление Display Aspect Ratio (DAR). Соотношение сторон выводимого на экран кадра +// Calculate DAR (Display Aspect Ratio), frame aspect dar = double (vWidth) / double (vHeight); if (vStream->sample_aspect_ratio.num && av_cmp_q(vStream->sample_aspect_ratio, vStream->codec->sample_aspect_ratio)){ AVRational display_aspect_ratio; @@ -77,7 +79,7 @@ } } -// Проверка наличия аудиопотока и получение его номера +// Check audio stream exists and get his number aStreamNumber=-1; for (uint i=0; i < pAVFormatContext->nb_streams;i++) if (pAVFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO){ @@ -99,18 +101,18 @@ char aChC[32]; if (aStreamNumber != -1){ av_get_channel_layout_string (aChC, sizeof(aChC), aCodecContext->channels, aCodecContext->channel_layout); -// Количество каналов +// Channels count aChannels = QString (aChC); -// Частота дискретизации +// Freq aSamples = QString::number ((double)aCodecContext->sample_rate / 1000); -// Битрейт +// Bitrate aBitrate = QString::number (get_bit_rate (aCodecContext)/1000); -// Кодек +// Codec aCodecName = QString(aCodec->name).toUpper(); } } -// Вычисляет битрейт потока (пока только для звука, и то, не всегда) +// Calculate stream bitrate (only audio worked) int TFfmpeg::get_bit_rate(AVCodecContext *ctx){ int bit_rate = 0; int bits_per_sample; @@ -133,7 +135,7 @@ return bit_rate; } -// Получение строки с информацией о видео потоке +// Get string about video stream QString TFfmpeg::getVInfo(){ QString vct = ", "; if ((vCodecContext->codec_tag > 0) && @@ -141,10 +143,12 @@ (vCodecTag.mid(0,1) != "[") && (vCodecTag.mid (vCodecTag.length()-1,1) != "]")) vct = " ("+vCodecTag+"), "; - return vCodecName + vct + vResolution + ", " + vFps + " " + QObject::tr("fps"); + QString sFps = ", " + vFps + " " + QObject::tr("fps"); + if (vFps == "") sFps = ""; + return vCodecName + vct + vResolution + sFps; } -// Получение строки с информацией об аудио потоке +// Get string about audio stream QString TFfmpeg::getAInfo(){ QString ret=""; if (aStreamNumber != -1){ @@ -156,12 +160,12 @@ return ret; } -// Закрытие видеофайла +// Close videofile TFfmpeg::~TFfmpeg(){ avformat_close_input (&pAVFormatContext); } -// Получение картинки в QImage кадра из видеофайла в позиции ms миллисекунд +// Get picture QImage from video frame in position "ms" in miliseconds QImage TFfmpeg::getImage(uint ms){ QImage img = QImage(vCodecContext->width, vCodecContext->height, QImage::Format_RGB888); AVFrame *pFrame, *pFrameRGB; @@ -170,8 +174,14 @@ uint8_t *buffer; int frameFinished; - pFrame = avcodec_alloc_frame(); - pFrameRGB = avcodec_alloc_frame(); +// Deprecated function "avcodec_alloc_frame" change to "av_frame_alloc" from libavcodec version 55.45.101 + #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 45, 101) + pFrame = av_frame_alloc(); + pFrameRGB = av_frame_alloc(); + #else + pFrame = avcodec_alloc_frame(); + pFrameRGB = avcodec_alloc_frame(); + #endif numBytes = avpicture_get_size (PIX_FMT_RGB24, vCodecContext->width, vCodecContext->height); buffer = (uint8_t *) av_malloc (numBytes * sizeof(uint8_t));
View file
screengen-1.8-20140909.tar.bz2/src/qffmpeg.h -> screengen-1.9-20150803.tar.bz2/src/qffmpeg.h
Changed
@@ -10,6 +10,7 @@ #include <libavformat/avformat.h> #include <libswscale/swscale.h> #include <libavutil/mathematics.h> // Added for Kubuntu (patch from srog (qt-apps.org)) + #include <libavcodec/version.h> } class TFfmpeg{
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.