summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Pielmeier <billie@gentoo.org>2011-05-10 17:49:15 +0000
committerDaniel Pielmeier <billie@gentoo.org>2011-05-10 17:49:15 +0000
commit442dc5659995aa7cb98a5b125d5ffa230f7bff96 (patch)
tree966225c95666a36d3b1dc999930fbe7cd6a9d387 /media-video/ttcut
parentVersion bump. (diff)
downloadgentoo-2-442dc5659995aa7cb98a5b125d5ffa230f7bff96.tar.gz
gentoo-2-442dc5659995aa7cb98a5b125d5ffa230f7bff96.tar.bz2
gentoo-2-442dc5659995aa7cb98a5b125d5ffa230f7bff96.zip
Revision bump. Switch to EAPI 4. Add desktop file. Update desktop database. Add patch written by me with some polishing from Robert William Fuller to use ffmpeg instead of transcode for frame accurate cutting. Add patch to support NTSC framrate 29.97 thanks to Robert William Fuller.
(Portage version: 2.1.9.42/cvs/Linux i686)
Diffstat (limited to 'media-video/ttcut')
-rw-r--r--media-video/ttcut/ChangeLog14
-rw-r--r--media-video/ttcut/files/ttcut-0.19.6-ffmpeg-vf-setdar.patch184
-rw-r--r--media-video/ttcut/files/ttcut-0.19.6-ntsc-fps.patch99
-rw-r--r--media-video/ttcut/files/ttcut.desktop13
-rw-r--r--media-video/ttcut/ttcut-0.19.6-r3.ebuild48
5 files changed, 356 insertions, 2 deletions
diff --git a/media-video/ttcut/ChangeLog b/media-video/ttcut/ChangeLog
index fd5076bd01fa..47129e660a04 100644
--- a/media-video/ttcut/ChangeLog
+++ b/media-video/ttcut/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for media-video/ttcut
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/ttcut/ChangeLog,v 1.26 2010/03/20 20:16:49 billie Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/ttcut/ChangeLog,v 1.27 2011/05/10 17:49:14 billie Exp $
+
+*ttcut-0.19.6-r3 (10 May 2011)
+
+ 10 May 2011; Daniel Pielmeier <billie@gentoo.org> +ttcut-0.19.6-r3.ebuild,
+ +files/ttcut-0.19.6-ffmpeg-vf-setdar.patch,
+ +files/ttcut-0.19.6-ntsc-fps.patch, +files/ttcut.desktop:
+ Revision bump. Switch to EAPI 4. Add desktop file. Update desktop database.
+ Add patch written by me with some polishing from Robert William Fuller to use
+ ffmpeg instead of transcode for frame accurate cutting. Add patch to support
+ NTSC framrate 29.97 thanks to Robert William Fuller.
20 Mar 2010; Daniel Pielmeier <billie@gentoo.org> ttcut-0.19.6-r2.ebuild:
Switch to qt4-r2 eclass.
diff --git a/media-video/ttcut/files/ttcut-0.19.6-ffmpeg-vf-setdar.patch b/media-video/ttcut/files/ttcut-0.19.6-ffmpeg-vf-setdar.patch
new file mode 100644
index 000000000000..6f5b05b228a0
--- /dev/null
+++ b/media-video/ttcut/files/ttcut-0.19.6-ffmpeg-vf-setdar.patch
@@ -0,0 +1,184 @@
+diff -Naur ttcut-old/avstream/ttcommon.cpp ttcut/avstream/ttcommon.cpp
+--- ttcut-old/avstream/ttcommon.cpp 2011-05-05 00:00:33.936254667 +0200
++++ ttcut/avstream/ttcommon.cpp 2011-05-05 00:03:27.396254667 +0200
+@@ -51,6 +51,18 @@
+ return sNewFileName;
+ }
+
++// return the aspect ratio as string value
++QString ttAspectRatioText(int aspect_ratio_information)
++{
++ QString szTemp;
++
++ if ( aspect_ratio_information == 1 ) szTemp = "1:1";
++ if ( aspect_ratio_information == 2 ) szTemp = "4:3";
++ if ( aspect_ratio_information == 3 ) szTemp = "16:9";
++ if ( aspect_ratio_information == 4 ) szTemp = "2.21:1";
++
++ return szTemp;
++}
+
+ // check if file fName exists
+ bool ttFileExists( QString fName )
+diff -Naur ttcut-old/avstream/ttcommon.h ttcut/avstream/ttcommon.h
+--- ttcut-old/avstream/ttcommon.h 2011-05-05 00:00:33.936254667 +0200
++++ ttcut/avstream/ttcommon.h 2011-05-05 00:03:58.412921334 +0200
+@@ -11,6 +11,7 @@
+ extern "C" bool ttDeleteFile( QString fName );
+ extern "C" QString ttAddFileExt( QString fName, const char* cExt );
+ extern "C" QString ttChangeFileExt( QString fName, const char* cExt );
++extern "C" QString ttAspectRatioText(int aspect_ratio_information);
+ extern "C" QTime ttMsecToTime( int msec );
+ extern "C" QTime ttMsecToTimeD( double msec );
+ extern "C" QTime ttFramesToTime(long lFrames, float fps);
+diff -Naur ttcut-old/avstream/ttmpeg2videoheader.cpp ttcut/avstream/ttmpeg2videoheader.cpp
+--- ttcut-old/avstream/ttmpeg2videoheader.cpp 2011-05-05 00:00:33.936254667 +0200
++++ ttcut/avstream/ttmpeg2videoheader.cpp 2011-05-05 00:05:42.999588000 +0200
+@@ -170,18 +170,11 @@
+ }
+
+ /* /////////////////////////////////////////////////////////////////////////////
+- * Returns the aspect ration as string value
++ * Returns the aspect ratio as string value
+ */
+ QString TTSequenceHeader::aspectRatioText()
+ {
+- QString szTemp;
+-
+- if ( aspect_ratio_information == 1 ) szTemp = "1:1";
+- if ( aspect_ratio_information == 2 ) szTemp = "4:3";
+- if ( aspect_ratio_information == 3 ) szTemp = "16:9";
+- if ( aspect_ratio_information == 4 ) szTemp = "2.21:1";
+-
+- return szTemp;
++ return ttAspectRatioText(aspect_ratio_information);
+ }
+
+ /* /////////////////////////////////////////////////////////////////////////////
+diff -Naur ttcut-old/avstream/ttmpeg2videostream.cpp ttcut/avstream/ttmpeg2videostream.cpp
+--- ttcut-old/avstream/ttmpeg2videostream.cpp 2011-05-05 00:00:33.936254667 +0200
++++ ttcut/avstream/ttmpeg2videostream.cpp 2011-05-05 00:00:43.579588002 +0200
+@@ -1505,7 +1505,7 @@
+
+ QDir temp_dir( TTCut::tempDirPath );
+ QString avi_out_file = "encode.avi";
+- QString mpeg2_out_file = "encode"; // extension is added by transcode (!)
++ QString mpeg2_out_file = "encode.m2v";
+ new_file_info.setFile( temp_dir, avi_out_file );
+
+ TTPicturesHeader* start_pic = header_list->pictureHeaderAt( start );
+@@ -1538,7 +1538,7 @@
+ TTTranscodeProvider* transcode_prov = new TTTranscodeProvider( );
+ transcode_prov->setParameter( enc_par );
+
+- // encode the part with transcode
++ // encode the part with ffmpeg
+ if ( transcode_prov->encodePart() )
+ {
+ new_file_info.setFile( temp_dir, "encode.m2v" );
+@@ -1565,7 +1565,7 @@
+ }
+ else
+ {
+- log->errorMsg(c_name, "Error in transcode part (!)");
++ log->errorMsg(c_name, "Error in ffmpeg part (!)");
+ }
+
+ // remove temporary files
+diff -Naur ttcut-old/extern/tttranscode.cpp ttcut/extern/tttranscode.cpp
+--- ttcut-old/extern/tttranscode.cpp 2011-05-05 00:00:33.939588000 +0200
++++ ttcut/extern/tttranscode.cpp 2011-05-05 00:02:27.062921334 +0200
+@@ -49,9 +49,9 @@
+ // message logger instance
+ log = TTMessageLogger::getInstance();
+
+- QString str_head = "starting encoder >>>transcode -y ffmpeg<<<";
++ QString str_head = "starting encoder >>>ffmpeg<<<";
+
+- str_command = "transcode";
++ str_command = "ffmpeg";
+ transcode_success = false;
+
+ setModal( true );
+@@ -76,7 +76,7 @@
+ {
+ #if defined (TTTRANSCODE_DEBUG)
+ log->debugMsg( c_name, "----------------------------------------------------" );
+- log->debugMsg( c_name, "transcode parameter:" );
++ log->debugMsg( c_name, "ffmpeg parameter:" );
+ log->debugMsg( c_name, "----------------------------------------------------" );
+ log->debugMsg( c_name, "avi-file : %s", qPrintable(enc_par.avi_input_finfo.absoluteFilePath()) );
+ log->debugMsg( c_name, "mpeg-file : %s", qPrintable(enc_par.mpeg2_output_finfo.absoluteFilePath()) );
+@@ -86,32 +86,32 @@
+ log->debugMsg( c_name, "----------------------------------------------------" );
+ #endif
+
+- //transcode -i encode.avi --pre_clip 0 -y ffmpeg --export_prof dvd-pal --export_asr 2 -o encode
+ QString str_aspect;
+- str_aspect.sprintf("%d",enc_par.video_aspect_code );
++ str_aspect = ttAspectRatioText(enc_par.video_aspect_code);
+
+ QString str_format;
+ str_format.sprintf("%dx%d", enc_par.video_width, enc_par.video_height);
+
+ QString str_bitrate;
+- str_bitrate.sprintf("%f", enc_par.video_bitrate);
++ str_bitrate.sprintf("%.0f", enc_par.video_bitrate);
++
++ QString str_aspect_opt;
++ str_aspect_opt = "setdar=";
++
++ str_aspect_opt += str_aspect;
+
+ strl_command_line.clear();
+
+ strl_command_line << "-i"
+- << enc_par.avi_input_finfo.absoluteFilePath()
+- << "--pre_clip"
+- << "0"
+- //<< "-y" // isn't neccessary unless --export_prof is specified!
+- //<< "mpeg2enc,mp2enc" // mpeg2enc->video, mp2enc->audio!
+- //<< "-F"
+- //<< "8,\"-v 1 -q 3\""
+- << "--export_prof"
+- << "dvd" // dvd-pal
+- << "--export_asr"
+- << str_aspect
+- << "-o"
+- << enc_par.mpeg2_output_finfo.absoluteFilePath();
++ << enc_par.avi_input_finfo.absoluteFilePath()
++ << "-y"
++ << "-target"
++ << "dvd" //autodetects pal/ntsc
++ << "-f"
++ << "mpeg2video" //else ffmpeg creates an mpegps stream that mplex can not handle
++ << "-vf"
++ << str_aspect_opt //workaround for mpeg2video not preserving aspect ratio in combination with --enable-avfilter
++ << enc_par.mpeg2_output_finfo.absoluteFilePath();
+
+ log->infoMsg(c_name, strl_command_line.join(" "));
+ }
+@@ -124,7 +124,7 @@
+ int update = EVENT_LOOP_INTERVALL; //update intervall for local event loop
+ transcode_success = false;
+
+- // create the process object for transcode
++ // create the process object for ffmpeg
+ proc = new QProcess();
+
+ // read both channels: stderr and stdout
+@@ -197,12 +197,12 @@
+ switch (e_status) {
+ case QProcess::NormalExit:
+ //log->debugMsg(c_name, "The process ecxited normally: %d", e_code);
+- procMsg = tr("Transcode exit normally ... done(0)");
++ procMsg = tr("ffmpeg exit normally ... done(0)");
+ transcode_success = true;
+ break;
+ case QProcess::CrashExit:
+ //log->debugMsg(c_name, "The process crashed: %d", e_code);
+- procMsg = tr("Transcode crashed");
++ procMsg = tr("ffmpeg crashed");
+ transcode_success = false;
+ break;
+ default:
diff --git a/media-video/ttcut/files/ttcut-0.19.6-ntsc-fps.patch b/media-video/ttcut/files/ttcut-0.19.6-ntsc-fps.patch
new file mode 100644
index 000000000000..0af76de1d095
--- /dev/null
+++ b/media-video/ttcut/files/ttcut-0.19.6-ntsc-fps.patch
@@ -0,0 +1,99 @@
+diff -upr ttcut-old/avstream/ttac3audiostream.cpp ttcut/avstream/ttac3audiostream.cpp
+--- ttcut-old/avstream/ttac3audiostream.cpp 2011-05-01 21:51:10.865817426 -0400
++++ ttcut/avstream/ttac3audiostream.cpp 2011-05-01 21:45:34.213440925 -0400
+@@ -256,6 +256,7 @@ void TTAC3AudioStream::cut( TTFileBuffer
+ float audio_start_time;
+ float audio_end_time;
+ float local_audio_offset = 0.0;
++ float fps = cut_list->videoStream()->frameRate();
+
+ #if defined(AC3STREAM_DEBUG)
+ log->debugMsg(c_name, "-----------------------------------------------");
+@@ -286,7 +287,7 @@ void TTAC3AudioStream::cut( TTFileBuffer
+
+ //qDebug( "%sstart / end : %d / %d",c_name,start_pos,end_pos );
+ //search
+- video_frame_length = 1000.0 / 25.0; //TODO: replace with fps
++ video_frame_length = 1000.0 / fps;
+
+ //qDebug( "%slocal audio offset: %f",c_name,local_audio_offset );
+
+diff -upr ttcut-old/avstream/ttmpeg2videoheader.cpp ttcut/avstream/ttmpeg2videoheader.cpp
+--- ttcut-old/avstream/ttmpeg2videoheader.cpp 2011-05-01 21:20:42.675440912 -0400
++++ ttcut/avstream/ttmpeg2videoheader.cpp 2011-04-29 23:06:29.684768509 -0400
+@@ -193,6 +193,7 @@ QString TTSequenceHeader::frameRateText(
+
+ if ( frame_rate_code == 2 ) szTemp = "24 fps";
+ if ( frame_rate_code == 3 ) szTemp = "25 fps";
++ if ( frame_rate_code == 4 ) szTemp = "29.970 fps";
+ if ( frame_rate_code == 5 ) szTemp = "30 fps";
+
+ return szTemp;
+@@ -207,6 +208,7 @@ float TTSequenceHeader::frameRateValue()
+
+ if ( frame_rate_code == 2 ) value = 24.0;
+ if ( frame_rate_code == 3 ) value = 25.0;
++ if ( frame_rate_code == 4 ) value = 29.970;
+ if ( frame_rate_code == 5 ) value = 30.0;
+
+ if ( frame_rate_code < 2 || frame_rate_code > 5 )
+diff -upr ttcut-old/avstream/ttmpegaudiostream.cpp ttcut/avstream/ttmpegaudiostream.cpp
+--- ttcut-old/avstream/ttmpegaudiostream.cpp 2011-05-01 21:20:42.679440927 -0400
++++ ttcut/avstream/ttmpegaudiostream.cpp 2011-05-01 21:45:55.036441412 -0400
+@@ -308,6 +308,7 @@ void TTMPEGAudioStream::cut( TTFileBuffe
+ float audio_start_time;
+ float audio_end_time;
+ float local_audio_offset = 0.0;
++ float fps = cut_list->videoStream()->frameRate();
+
+ #if defined MPEGAUDIO_DEBUG
+ log->infoMsg(c_name, "-----------------------------------------------");
+@@ -338,7 +339,7 @@ void TTMPEGAudioStream::cut( TTFileBuffe
+
+ //qDebug( "%sstart / end : %d / %d",c_name,start_pos,end_pos );
+ //search
+- video_frame_length = 1000.0 / 25.0; //TODO: replace with fps
++ video_frame_length = 1000.0 / fps;
+
+ //qDebug( "%slocal audio offset: %f",c_name,local_audio_offset );
+
+diff -upr ttcut-old/avstream/ttaviwriter.cpp ttcut/avstream/ttaviwriter.cpp
+--- ttcut-old/avstream/ttaviwriter.cpp 2011-05-01 22:05:47.307819446 -0400
++++ ttcut/avstream/ttaviwriter.cpp 2011-05-01 22:08:27.427839373 -0400
+@@ -49,6 +49,7 @@ TTAVIWriter::TTAVIWriter( TTProgressBar*
+
+ file_size = 0;
+ file_offset = 0;
++ fps = 0.0;
+ }
+
+
+@@ -78,6 +79,7 @@ bool TTAVIWriter::initAVIWriter( TTVideo
+ index_list = v_stream->indexList();
+ header_list = v_stream->headerList();
+ file_size = v_stream->streamLengthByte();
++ fps = v_stream->frameRate();
+
+ //create the decoder object
+ decoder = new TTMpeg2Decoder( qPrintable(video_file_name), index_list, header_list );
+@@ -125,8 +127,7 @@ int TTAVIWriter::writeAVI( int start_fra
+
+ //qDebug( "%sAVI frame info: width: %d x height: %d",c_name,frameInfo->width,frameInfo->height );
+
+- //TODO: avoid setting hard coded frame rate!
+- AVI_set_video(avi_file, frameInfo->width, frameInfo->height, 25.0, (char*)"YV12");
++ AVI_set_video(avi_file, frameInfo->width, frameInfo->height, fps, (char*)"YV12");
+
+ ref_data = new uint8_t [frameInfo->size+2*frameInfo->chroma_size];
+
+diff -upr ttcut-old/avstream/ttaviwriter.h ttcut/avstream/ttaviwriter.h
+--- ttcut-old/avstream/ttaviwriter.h 2011-05-01 22:05:47.308819943 -0400
++++ ttcut/avstream/ttaviwriter.h 2011-05-01 22:06:17.162739403 -0400
+@@ -72,6 +72,7 @@ class TTAVIWriter
+ off64_t file_offset;
+ uint8_t* ref_data;
+ avi_t* avi_file;
++ float fps;
+ };
+
+ #endif //TTAVIWRITER_H
diff --git a/media-video/ttcut/files/ttcut.desktop b/media-video/ttcut/files/ttcut.desktop
new file mode 100644
index 000000000000..b2f1325a2f73
--- /dev/null
+++ b/media-video/ttcut/files/ttcut.desktop
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=TTCut
+Comment=Removes commercials from DVB recordings
+Comment[de]=Entfernt Werbeeinblendungen aus DVB-Mitschnitten
+TryExec=ttcut
+Exec=ttcut
+Icon=ttcut
+Terminal=false
+StartupNotify=false
+MimeType=video/mpeg;
+Categories=AudioVideo;Video;AudioVideoEditing;
diff --git a/media-video/ttcut/ttcut-0.19.6-r3.ebuild b/media-video/ttcut/ttcut-0.19.6-r3.ebuild
new file mode 100644
index 000000000000..28f2ae4442c1
--- /dev/null
+++ b/media-video/ttcut/ttcut-0.19.6-r3.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/ttcut/ttcut-0.19.6-r3.ebuild,v 1.1 2011/05/10 17:49:14 billie Exp $
+
+EAPI=4
+
+inherit fdo-mime qt4-r2
+
+DESCRIPTION="Tool for cutting MPEG files especially for removing commercials"
+HOMEPAGE="http://www.tritime.de/ttcut/"
+SRC_URI="mirror://berlios/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="x11-libs/qt-gui:4
+ x11-libs/qt-opengl:4
+ >=media-libs/libmpeg2-0.4.0
+ virtual/opengl"
+
+RDEPEND="${DEPEND}
+ media-video/mplayer
+ >=virtual/ffmpeg-0.6.90[encode]"
+
+S=${WORKDIR}/${PN}
+
+PATCHES=( "${FILESDIR}"/${P}-deprecated.patch
+ "${FILESDIR}"/${P}-ntsc-fps.patch
+ "${FILESDIR}"/${P}-ffmpeg-vf-setdar.patch )
+
+src_install() {
+ dobin ttcut
+
+ insinto /usr/share/applications
+ doins "${FILESDIR}"/${PN}.desktop
+
+ dodoc AUTHORS BUGS CHANGELOG README.* TODO
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}