Projects
Multimedia
screengen
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
screengen.changes
Changed
@@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Sun Sep 1 19:25:01 UTC 2013 - lazy.kent@opensuse.org + +- Update to 1.7. + * Fix segmentation fault if open error videofile, if not exists + video stream or video codec. + * Video Codec names fixed. + * Added parameter "timeStep". + +------------------------------------------------------------------- Thu Nov 22 21:10:58 UTC 2012 - lazy.kent@opensuse.org - Update to 1.6.
View file
screengen.spec
Changed
@@ -1,7 +1,7 @@ # # spec file for package screengen # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products 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,10 +16,10 @@ # -%define dversion 20121122 +%define dversion 20130901 Name: screengen -Version: 1.6 +Version: 1.7 Release: 0 License: GPL-3.0 Summary: Screenlist Generator
View file
screengen-1.6-20121122.tar.bz2/CHANGELOG -> screengen-1.7-20130901.tar.bz2/CHANGELOG
Changed
@@ -35,3 +35,8 @@ 2012-11-22 (1.6) * Fix segmentation fault if audio not present in video file. * Added parameters "presetsList" and "presetInfo". + +2013-09-01 (1.7) +* Fix segmentation fault if open error videofile, if not exists video stream or video codec. +* Video Codec names fixed. +* Added parameter "timeStep".
View file
screengen-1.6-20121122.tar.bz2/src/main.cpp -> screengen-1.7-20130901.tar.bz2/src/main.cpp
Changed
@@ -20,7 +20,7 @@ translator.load ("screengen_"+QLocale::system().name()+".qm","/usr/share/screengen/translations/"); app.installTranslator (&translator); - qDebug()<<"Screenlist generator from video file. Version 1.6. Copyright (C) 2012 Oleg Kochkin. License - GPL."; + qDebug()<<"Screenlist generator from video file. Version 1.7. Copyright (C) 2012,2013 Oleg Kochkin. License - GPL."; // Видеофайл QString videoFile = ""; // Секция предустановок @@ -86,6 +86,7 @@ int textDescrFlag = Qt::AlignLeft | Qt::AlignTop;// Позиция текста в кадре QString stampDescrPos=cfg.value ("stampDescrPos","lt").toString(); QString stampDescr=cfg.value ("stampDescr","").toString();// Комментарий + QString timeStep=cfg.value ("timeStep","00:00:00").toString();// Время между кадрами cfg.setValue ("frames",frames); cfg.setValue ("width",widthList); @@ -136,6 +137,7 @@ cfg.setValue ("frameBox",frameBox); cfg.setValue ("stampDescrPos",stampDescrPos); cfg.setValue ("stampDescr",stampDescr); + cfg.setValue ("timeStep",timeStep); cfg.endGroup(); videoFile = argv[1]; @@ -187,6 +189,7 @@ if (QString(argv[i]) == "--fontHeaderWeight") QString fontHeaderWeightS=QString(argv[i+1]); if (QString(argv[i]) == "--presetsList") presetsList=true; if (QString(argv[i]) == "--presetInfo") presetInfo=QString(argv[i+1]); + if (QString(argv[i]) == "--timeStep") timeStep=QString(argv[i+1]); if (QString(argv[i]) == "--header") { if (QString(argv[i+1]) == "true") header=true; @@ -230,7 +233,7 @@ qDebug()<<"Parameters:"; qDebug()<<" --preset Use section in config file (default - \"Default\")"; qDebug()<<" --presetsList Show all presets in config file (all other parameters ignored)"; - qDebug()<<" --presetInfo Show all values in preset (all other parameters ignored, example: --presetInfo MyPreset"; + qDebug()<<" --presetInfo Show all values in preset (all other parameters ignored, example: --presetInfo MyPreset)"; qDebug()<<" --frames Frames count in screenlist (default - 16)"; qDebug()<<" --width Width screenlist (default - 1200)"; qDebug()<<" --horCount Frames in horisontal (default - 4)"; @@ -280,6 +283,7 @@ qDebug()<<" --frameBox Depth border frame (default - 0)"; qDebug()<<" --stampDescr Custom text, located on frame"; qDebug()<<" --stampDescrPos Position custom text (default - \"lt\" (LeftTop), (rb, rt, lb, lr))"; + qDebug()<<" --timeStep The time between frames. If not equal to \"00:00:00\", the parameter \"frames\" are ignored. (default - \"00:00:00\")"; return 4; } @@ -303,6 +307,7 @@ if (shadowInt>100) shadowInt=100; TFfmpeg *video = new TFfmpeg(videoFile); + if (video->error != 0) return 3; // Ширина листа, исключая бордюр int wList = widthList - listBorder * 2; @@ -310,6 +315,22 @@ int widthFrame = wList / horCount; // Количество кадров по вертикали в листе int vertCount = frames / horCount; + + int fullLength = video->iDuration / 1000; + QTime timeBeginT; + QTime timeEndT; + int timeBegin = timeBeginT.msecsTo(QTime::fromString(offsetBegin,"hh:mm:ss")); + int timeEnd = timeEndT.msecsTo(QTime::fromString(offsetEnd,"hh:mm:ss")); + int length = fullLength - (timeBegin+timeEnd); + + if (timeStep != "00:00:00"){ + QTime timeStepT; + int tStep = timeStepT.msecsTo(QTime::fromString(timeStep,"hh:mm:ss")); + vertCount = (length / tStep) / horCount; + vertCount++; + frames = horCount * vertCount; + } + // Ширина кадра в видеофайле int wFrame = video->vWidth; // Высота кадра в видеофайле @@ -324,7 +345,6 @@ QFont headerFont (fontHeaderName, fontHeaderSize, fontHeaderWeight, fontHeaderItalic); QFontMetrics fm (headerFont); - int fullLength = video->iDuration / 1000; int headerH=(fontHeaderSize+(double)5)*5; int headerX=listBorder+frameBorder; @@ -411,11 +431,7 @@ // Кадры int numFrame=0; - QTime timeBeginT; - QTime timeEndT; - int timeBegin = timeBeginT.msecsTo(QTime::fromString(offsetBegin,"hh:mm:ss")); - int timeEnd = timeEndT.msecsTo(QTime::fromString(offsetEnd,"hh:mm:ss")); - int length = fullLength - (timeBegin+timeEnd); + for (int vi = 0;vi < vertCount;vi++){ for (int hi = 0;hi < horCount;hi++){ int pos = length / (frames-1) * numFrame + timeBegin; @@ -451,6 +467,17 @@ pFrame.end(); } +// if (light){ +// QPainterPath lLine; +// lLine.moveTo (0, imFrame.height()); +// lLine.lineTo (0, 0); +// lLine.lineTo (imFrame.width(), 0); +// QPainter pFrame(&imFrame); +// pFrame.setPen ("white"); +// pFrame.drawPath(lLine); +// pFrame.end(); +// } + 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);
View file
screengen-1.6-20121122.tar.bz2/src/qffmpeg.cpp -> screengen-1.7-20130901.tar.bz2/src/qffmpeg.cpp
Changed
@@ -2,13 +2,22 @@ // Открывает видеофайл, инициализирует кодеки, получает информацию о потоках TFfmpeg::TFfmpeg(QString videoFile){ + error=0; av_log_set_level(AV_LOG_QUIET); avcodec_register_all(); av_register_all(); pAVFormatContext = avformat_alloc_context(); - if (avformat_open_input (&pAVFormatContext, videoFile.toLocal8Bit(), NULL, NULL)!=0) qDebug()<<"Error open file:"<<videoFile; - else if (avformat_find_stream_info (pAVFormatContext, NULL) < 0) qDebug()<<"Not found streams in"<<videoFile; + if (avformat_open_input (&pAVFormatContext, videoFile.toLocal8Bit(), NULL, NULL)!=0){ + qDebug()<<"Error open file:"<<videoFile; + error=1; + return; + } + else if (avformat_find_stream_info (pAVFormatContext, NULL) < 0){ + qDebug()<<"Not found streams in"<<videoFile; + error=1; + return; + } duration = QTime(0,0,0,0).addMSecs (pAVFormatContext->duration / 1000).toString("hh:mm:ss"); fullBitrate = QString::number (pAVFormatContext->bit_rate / 1000); streamsCount = pAVFormatContext->nb_streams; @@ -20,11 +29,19 @@ vStreamNumber=i; break; } - if (vStreamNumber == -1) qDebug()<<"Not video stream in"<<videoFile; + if (vStreamNumber == -1){ + qDebug()<<"Not video stream in"<<videoFile; + error=1; + return; + } vCodecContext = pAVFormatContext->streams[vStreamNumber]->codec; vCodec = avcodec_find_decoder (vCodecContext->codec_id); - if (avcodec_open2 (vCodecContext, vCodec, NULL)) qDebug()<<"Not open video codec in"<<videoFile; + if (avcodec_open2 (vCodecContext, vCodec, NULL)){ + qDebug()<<"Not open video codec in"<<videoFile; + error=1; + return; + } vResolution = QString::number (vCodecContext->width) + "x" + QString::number (vCodecContext->height); vFps = QString::number ((double) pAVFormatContext->streams[vStreamNumber]->r_frame_rate.num / pAVFormatContext->streams[vStreamNumber]->r_frame_rate.den); @@ -51,7 +68,6 @@ av_get_codec_tag_string (vCodecTagC, sizeof(vCodecTagC), vCodecContext->codec_tag); vCodecTag = QString (vCodecTagC); } - char aChC[32]; if (aStreamNumber != -1){ av_get_channel_layout_string (aChC, sizeof(aChC), aCodecContext->channels, aCodecContext->channel_layout); @@ -88,7 +104,11 @@ // Получение строки с информацией о видео потоке QString TFfmpeg::getVInfo(){ QString vct = ", "; - if ((vCodecContext->codec_tag > 0) && (vCodecTag != vCodecName)) vct = " ("+vCodecTag+"), "; + if ((vCodecContext->codec_tag > 0) && + (vCodecTag != vCodecName) && + (vCodecTag.mid(0,1) != "[") && + (vCodecTag.mid (vCodecTag.length()-1,1) != "]")) + vct = " ("+vCodecTag+"), "; return vCodecName + vct + vResolution + ", " + vFps + " " + QObject::tr("fps"); }
View file
screengen-1.6-20121122.tar.bz2/src/qffmpeg.h -> screengen-1.7-20130901.tar.bz2/src/qffmpeg.h
Changed
@@ -21,7 +21,7 @@ QString getAInfo(); QImage getImage(uint ms); - int vStreamNumber, aStreamNumber, streamsCount, vWidth, vHeight; + int vStreamNumber, aStreamNumber, streamsCount, vWidth, vHeight, error; int64_t iDuration; QString vCodecTag, aChannels, aSamples, vResolution, vFps, aBitrate, fullBitrate, vCodecName, aCodecName, duration, generalInfo; private:
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
.