Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Florian Franzmann (df16567d3577b2610e5dfe818b9650b2ae649870)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Florian Franzmann <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Florian Franzmann (df16567d3577b2610e5dfe818b9650b2ae649870)
  • Date: Sat, 7 Apr 2007 06:40:46 -0500

GIT changes to master grimoire by Florian Franzmann
<siflfran AT hawo.stw.uni-erlangen.de>:

ChangeLog | 1
video/dvbcut/BUILD | 1
video/dvbcut/DEPENDS | 3
video/dvbcut/DETAILS | 19 ++
video/dvbcut/HISTORY | 7
video/dvbcut/INSTALL | 1
video/dvbcut/PRE_BUILD | 4
video/dvbcut/desktop/dvbcut.desktop | 10 +
video/dvbcut/dvbcut-SConstruct.diff | 12 +
video/dvbcut/dvbcut-newffmpeg.diff | 337
++++++++++++++++++++++++++++++++++++
10 files changed, 395 insertions(+)

New commits:
commit df16567d3577b2610e5dfe818b9650b2ae649870
Author: Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
Commit: Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>

video/dvbcut: readded

diff --git a/ChangeLog b/ChangeLog
index b97f0b6..c1c19a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2007-04-07 Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
* video/kmenc15: re-added after it was removed in revert of
54d2425bcb1cecec633d82ce29768606edcfb567
+ * video/dvbcut: re-added

2007-04-07 Treeve Jelbert <treeve AT sourcemage.org>
* accouts, groups: add davfs2
diff --git a/video/dvbcut/BUILD b/video/dvbcut/BUILD
new file mode 100755
index 0000000..d96966b
--- /dev/null
+++ b/video/dvbcut/BUILD
@@ -0,0 +1 @@
+make PREFIX=$INSTALL_ROOT/usr MANPATH=$INSTALL_ROOT/usr/share/man
diff --git a/video/dvbcut/DEPENDS b/video/dvbcut/DEPENDS
new file mode 100755
index 0000000..936f6c7
--- /dev/null
+++ b/video/dvbcut/DEPENDS
@@ -0,0 +1,3 @@
+depends qt-x11 &&
+depends libao &&
+depends scons
diff --git a/video/dvbcut/DETAILS b/video/dvbcut/DETAILS
new file mode 100755
index 0000000..a3dc7c9
--- /dev/null
+++ b/video/dvbcut/DETAILS
@@ -0,0 +1,19 @@
+ SPELL=dvbcut
+ VERSION=20070330
+ SOURCE="${SPELL}-${VERSION}.tar.bz2"
+# SOURCE_URL[0]=svn_http://svn.sourceforge.net/svnroot/dvbcut/trunk:dvbcut
+
SOURCE_URL[0]='http://www.hawo.stw.uni-erlangen.de/~siflfran/smgl/$SPELL/$SOURCE'
+
SOURCE_HASH=sha512:c7b5464a151890554ca3d3010c2e7279b8512a4c18217441ab6bf1d93f0244a9374ec509c1ab96392225cb2d8acd351c8b58328134749050fbacf76fb3cefb94
+SOURCE_DIRECTORY="${BUILD_DIRECTORY}/$SPELL-$VERSION"
+ WEB_SITE="http://dvbcut.sourceforge.net";
+ LICENSE[0]=GPL
+ ENTERED=20070404
+ SHORT="a Qt application that allows you to select certain parts
of an MPEG transport stream and save these parts into a single MPEG output
file"
+cat << EOF
+dvbcut is a Qt application that allows you to select certain parts of an MPEG
+transport stream (as received via Digital Video Broadcasting, DVB) and save
+these parts into a single MPEG output file. It follows a "keyhole surgery"
+approach where the input video and audio data is mostly kept unchanged,
+and only very few frames at the beginning and/or end of the selected range
+are re-encoded in order to obtain a valid MPEG file.
+EOF
diff --git a/video/dvbcut/HISTORY b/video/dvbcut/HISTORY
new file mode 100644
index 0000000..a1eb316
--- /dev/null
+++ b/video/dvbcut/HISTORY
@@ -0,0 +1,7 @@
+2007-04-07 Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
+ * dvbcut-SConstruct.diff: removed binary garbage
+
+2007-04-04 Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
+ * dvbcut-newffmpeg.diff, desktop/dvbcut.desktop, BUILD,
+ HISTORY, dvbcut-SConstruct.diff, INSTALL, PRE_BUILD,
+ DEPENDS, DETAILS: spell created
diff --git a/video/dvbcut/INSTALL b/video/dvbcut/INSTALL
new file mode 100755
index 0000000..d7ed39f
--- /dev/null
+++ b/video/dvbcut/INSTALL
@@ -0,0 +1 @@
+make PREFIX=$INSTALL_ROOT/usr MANPATH=$INSTALL_ROOT/usr/share/man install
diff --git a/video/dvbcut/PRE_BUILD b/video/dvbcut/PRE_BUILD
new file mode 100755
index 0000000..35bba38
--- /dev/null
+++ b/video/dvbcut/PRE_BUILD
@@ -0,0 +1,4 @@
+default_pre_build &&
+cd $SOURCE_DIRECTORY &&
+patch -p1 < ${SCRIPT_DIRECTORY}/dvbcut-newffmpeg.diff &&
+patch -p1 < ${SCRIPT_DIRECTORY}/dvbcut-SConstruct.diff
diff --git a/video/dvbcut/desktop/dvbcut.desktop
b/video/dvbcut/desktop/dvbcut.desktop
new file mode 100644
index 0000000..676685a
--- /dev/null
+++ b/video/dvbcut/desktop/dvbcut.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=
+Name=dvbcut
+Type=Application
+Comment=a Qt application that allows you to select certain parts of an MPEG
transport stream and save these parts into a single MPEG output file
+Exec=dvbcut
+Icon=
+Categories=Application;Multimedia;Video;
+Term=
diff --git a/video/dvbcut/dvbcut-SConstruct.diff
b/video/dvbcut/dvbcut-SConstruct.diff
new file mode 100644
index 0000000..50c1075
--- /dev/null
+++ b/video/dvbcut/dvbcut-SConstruct.diff
@@ -0,0 +1,12 @@
+diff -Naur dvbcut-newffmpeg/SConstruct dvbcut-SConstruct/SConstruct
+--- dvbcut-newffmpeg/SConstruct 2007-03-30 22:55:19.000000000 +0200
++++ dvbcut-SConstruct/SConstruct 2007-03-30 23:01:22.000000000 +0200
+@@ -46,6 +46,8 @@
+ else:
+ env.Append(CCFLAGS=['-O3','-Wall'])
+
++env.Append(CCFLAGS=['-I/usr/include/qt'])
++
+ env.Replace(CXXFILESUFFIX=".cpp")
+
+ env.Append(CPPDEFINES=[("_FILE_OFFSET_BITS", "64"), "_LARGEFILE_SOURCE"])
diff --git a/video/dvbcut/dvbcut-newffmpeg.diff
b/video/dvbcut/dvbcut-newffmpeg.diff
new file mode 100644
index 0000000..2409401
--- /dev/null
+++ b/video/dvbcut/dvbcut-newffmpeg.diff
@@ -0,0 +1,337 @@
+diff -Naur dvbcut.orig/ffmpeg-patches/cvs20050918.diff
dvbcut-newffmpeg/ffmpeg-patches/cvs20050918.diff
+--- dvbcut.orig/ffmpeg-patches/cvs20050918.diff 2007-03-30
22:54:44.000000000 +0200
++++ dvbcut-newffmpeg/ffmpeg-patches/cvs20050918.diff 2007-03-30
22:55:19.000000000 +0200
+@@ -762,7 +762,7 @@
+ #ifdef CONFIG_AC3
+ -#ifdef CONFIG_AC3_DECODER
+ + register_avcodec(&ac3_encoder);
+- register_avcodec(&ac3_decoder);
++ register_avcodec(&liba52_decoder);
+ -#endif //CONFIG_AC3_DECODER
+ #endif
+ +
+diff -Naur dvbcut.orig/ffmpeg.src/libavcodec/a52dec.c
dvbcut-newffmpeg/ffmpeg.src/libavcodec/a52dec.c
+--- dvbcut.orig/ffmpeg.src/libavcodec/a52dec.c 2007-03-30 22:54:44.000000000
+0200
++++ dvbcut-newffmpeg/ffmpeg.src/libavcodec/a52dec.c 2007-03-30
22:55:19.000000000 +0200
+@@ -250,7 +250,7 @@
+ return 0;
+ }
+
+-AVCodec ac3_decoder = {
++AVCodec liba52_decoder = {
+ "ac3",
+ CODEC_TYPE_AUDIO,
+ CODEC_ID_AC3,
+diff -Naur dvbcut.orig/ffmpeg.src/libavcodec/allcodecs.c
dvbcut-newffmpeg/ffmpeg.src/libavcodec/allcodecs.c
+--- dvbcut.orig/ffmpeg.src/libavcodec/allcodecs.c 2007-03-30
22:54:44.000000000 +0200
++++ dvbcut-newffmpeg/ffmpeg.src/libavcodec/allcodecs.c 2007-03-30
22:55:19.000000000 +0200
+@@ -47,7 +47,7 @@
+
+ #ifdef CONFIG_AC3
+ register_avcodec(&ac3_encoder);
+- register_avcodec(&ac3_decoder);
++ register_avcodec(&liba52_decoder);
+ #endif
+
+ #ifdef CONFIG_DTS
+diff -Naur dvbcut.orig/ffmpeg.src/libavcodec/avcodec.h
dvbcut-newffmpeg/ffmpeg.src/libavcodec/avcodec.h
+--- dvbcut.orig/ffmpeg.src/libavcodec/avcodec.h 2007-03-30
22:54:44.000000000 +0200
++++ dvbcut-newffmpeg/ffmpeg.src/libavcodec/avcodec.h 2007-03-30
22:55:19.000000000 +0200
+@@ -2115,7 +2115,7 @@
+ extern AVCodec rawvideo_decoder;
+
+ /* the following codecs use external GPL libs */
+-extern AVCodec ac3_decoder;
++extern AVCodec liba52_decoder;
+ extern AVCodec dts_decoder;
+
+ /* subtitles */
+diff -Naur dvbcut.orig/SConscript.ffmpeg dvbcut-newffmpeg/SConscript.ffmpeg
+--- dvbcut.orig/SConscript.ffmpeg 2007-03-30 22:54:44.000000000 +0200
++++ dvbcut-newffmpeg/SConscript.ffmpeg 2007-03-30 22:55:19.000000000 +0200
+@@ -20,8 +20,8 @@
+ --disable-audio-oss
+ --enable-codec=mpeg2encoder
+ --enable-codec=mp2_encoder
+- --enable-codec=ac3_decoder
+- --enable-codec=ac3_encoder
++ --enable-codec=liba52_decoder
++ --enable-codec=liba52_decoder
+ --enable-a52
+ """%(Dir('.').abspath,)).split()
+
+diff -Naur dvbcut.orig/src/psfile.cpp dvbcut-newffmpeg/src/psfile.cpp
+--- dvbcut.orig/src/psfile.cpp 2007-03-30 22:54:44.000000000 +0200
++++ dvbcut-newffmpeg/src/psfile.cpp 2007-03-30 22:55:19.000000000 +0200
+@@ -100,7 +100,7 @@
+ streamnumber[sid]=audiostream(audiostreams);
+ stream *S=&s[audiostream(audiostreams++)];
+ S->id=sid;
+- S->dec=&ac3_decoder;
++ S->dec=&liba52_decoder;
+ S->type=streamtype::ac3audio;
+ if (audiostreams>=MAXAUDIOSTREAMS)
+ break;
+diff -Naur dvbcut.orig/src/tsfile.cpp dvbcut-newffmpeg/src/tsfile.cpp
+--- dvbcut.orig/src/tsfile.cpp 2007-03-30 22:54:44.000000000 +0200
++++ dvbcut-newffmpeg/src/tsfile.cpp 2007-03-30 22:55:19.000000000 +0200
+@@ -78,7 +78,7 @@
+ stream *S=&s[audiostream(audiostreams++)];
+ S->id=it->second;
+ if (it->first==0xbd) {
+- S->dec=&ac3_decoder;
++ S->dec=&liba52_decoder;
+ S->enc=&ac3_encoder;
+ S->type=streamtype::ac3audio;
+ } else {
+diff -Naur dvbcut.orig/src/tsfile.cpp~ dvbcut-newffmpeg/src/tsfile.cpp~
+--- dvbcut.orig/src/tsfile.cpp~ 1970-01-01 01:00:00.000000000 +0100
++++ dvbcut-newffmpeg/src/tsfile.cpp~ 2007-03-30 22:55:19.000000000 +0200
+@@ -0,0 +1,247 @@
++/* dvbcut
++ Copyright (c) 2005 Sven Over <svenover AT svenover.de>
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
++*/
++
++#include "port.h"
++#include "tsfile.h"
++#include "streamhandle.h"
++#include <list>
++#include <utility>
++
++#include <ffmpeg/avcodec.h>
++
++tsfile::tsfile(const std::string &filename, inbuffer &b, int initial_offset)
++ : mpgfile(filename, b, initial_offset)
++ {
++ int vid=-1;
++ for(unsigned int i=0;i<8192;++i)
++ streamnumber[i]=-1;
++
++ int inpackets=buf.providedata(buf.getsize(),initialoffset)/TSPACKETSIZE;
++ if (inpackets>40000) inpackets=40000;
++
++ // Find video PID and audio PID(s)
++ bool apid[8192]={};
++ std::list<std::pair<int,int> > audios;
++ for(int i=0;i<inpackets;++i) {
++ const tspacket &p=((const tspacket*)buf.data())[i];
++ if (p.transport_error_indicator())
++ continue; // drop invalid packet --mr
++ int pid=p.pid();
++ if (apid[pid])
++ continue; // already had this pid --mr
++ int sid=p.sid();
++ if (sid<0)
++ continue;
++ // if ((sid==0xbd || sid==0xbf)&&p.payload_length()>9) // private
stream
++ // {
++ // const uint8_t *payload=(const uint8_t*) p.payload();
++ // if (p.payload_length()>9+payload[8])
++ // sid=payload[9+payload[8]] | ((sid==0xbd)?0x100:0x200);
++ // }
++
++ if ((sid&0xe0) == 0xc0) // mpeg audio stream
++ {
++ audios.push_back(std::pair<int,int>(sid,pid));
++ apid[pid]=true;
++ } else if (sid==0xbd) // private stream 1, possibly AC3 audio stream
++ {
++ const uint8_t *payload=(const uint8_t*) p.payload();
++ // if (p.payload_length()>9+payload[8])
++ // sid=payload[9+payload[8]] | ((sid==0xbd)?0x100:0x200);
++ if ((p.payload_length()>=9) && (p.payload_length()>=11+payload[8]) &&
++ (*(uint16_t*)&payload[9+payload[8]]==mbo16(0xb77)) )
++ {
++ audios.push_back(std::pair<int,int>(sid,pid));
++ apid[pid]=true;
++ }
++ } else if (vid<0 && ((sid&0xf0)==0xe0)) // mpeg video stream
++ vid=pid;
++ }
++ audios.sort();
++ for (std::list<std::pair<int,int> >::iterator
it=audios.begin();it!=audios.end();++it) {
++ streamnumber[it->second]=audiostream(audiostreams);
++ stream *S=&s[audiostream(audiostreams++)];
++ S->id=it->second;
++ if (it->first==0xbd) {
++ S->dec=&ac3_decoder;
++ S->enc=&ac3_encoder;
++ S->type=streamtype::ac3audio;
++ } else {
++ S->dec=&mp2_decoder;
++ S->enc=&mp2_encoder;
++ S->type=streamtype::mpegaudio;
++ }
++ if (audiostreams>=MAXAUDIOSTREAMS)
++ break;
++ }
++
++ if (vid>=0) {
++ videostreams=1;
++ streamnumber[vid]=VIDEOSTREAM;
++ stream *S=&s[VIDEOSTREAM];
++ S->id=vid;
++ S->allocavcc();
++ S->avcc->codec_type=CODEC_TYPE_VIDEO;
++ S->avcc->codec_id=CODEC_ID_MPEG2VIDEO;
++ S->dec=&mpeg2video_decoder;
++ S->enc=&mpeg2video_encoder;
++ S->type=streamtype::mpeg2video;
++ }
++
++ for (int i=0;i<audiostreams;++i)
++ initaudiocodeccontext(i);
++ }
++
++tsfile::~tsfile()
++ {}
++
++int tsfile::streamreader(streamhandle &s)
++ {
++ int returnvalue=0;
++ bool lostsync(false);
++
++ for(;;) {
++ dvbcut_off_t packetpos=s.fileposition;
++ {
++ int pd=buf.providedata(TSPACKETSIZE,packetpos);
++ if (pd<0)
++ return pd;
++ if (pd<TSPACKETSIZE)
++ return returnvalue;
++ }
++
++ const tspacket *p=(const tspacket*) buf.data();
++
++ if ((p->data[0]!=TSSYNCBYTE)||lostsync) // we lost sync
++ {
++
++ {
++ int pd=buf.providedata(4<<10,packetpos);
++ if (pd<(4<<10))
++ {
++ return returnvalue; // end of file, probably
++ }
++ }
++
++ lostsync=true;
++ const uint8_t *data = (const uint8_t*) buf.data();
++ int ts;
++ for (ts = 0; ts < 2048; ++ts)
++ {
++ int pos;
++ for (pos = ts;pos < 4096;pos += TSPACKETSIZE)
++ if (data[ pos ] != TSSYNCBYTE)
++ break;
++ if (pos >= 4096) // from here, we are in sync again
++ { lostsync=false;
++ break;
++ }
++ }
++
++ s.fileposition+=ts;
++ continue;
++ }
++
++ s.fileposition+=TSPACKETSIZE;
++
++ // Abandon invalid packets --mr
++ if (p->transport_error_indicator())
++ continue;
++ // Abandon packets which have no payload or have invalid adaption field
length
++ if (p->payload_length()<=0)
++ continue;
++ int sn=streamnumber[p->pid()];
++ if (sn<0)
++ continue;
++ streamdata *sd=s.stream[sn];
++ if (!sd)
++ continue;
++
++ if (p->payload_unit_start_indicator()) {
++ sd->header=std::string((const char
*)p->payload(),p->payload_length());
++ sd->nextfilepos=packetpos;
++ } else if (!sd->header.empty())
++ sd->header+=std::string((const char
*)p->payload(),p->payload_length());
++ else {
++ if (!sd->itemlist().empty()) {
++ returnvalue += p->payload_length();
++ sd->append(p->payload(),p->payload_length());
++ }
++ continue;
++ }
++
++ if (sd->header.size()<9)
++ continue;
++
++ if (sd->header[0]!=0 || sd->header[1]!=0 || sd->header[2]!=1) {
++ sd->header.clear();
++ continue;
++ }
++ int sid=(uint8_t)sd->header[3];
++
++ unsigned int payloadbegin=9u+(uint8_t)sd->header[8];
++
++ if (sd->header.size()<payloadbegin)
++ continue;
++ // if (sid==0xbd || sid==0xbf)
++ // {
++ // if (sd->header.size()<payloadbegin+1) continue;
++ // sid=((sid==0xbd)?0x100:0x200)|((unsigned char)
sd->header[payloadbegin]);
++ // ++payloadbegin;
++ // }
++ // else
++ {
++ if (sid>=0xe0 && sid<0xf0 && sd->header.size()>=payloadbegin+4)
++ if (
*(uint32_t*)(sd->header.c_str()+payloadbegin)==mbo32(0x00000001) )
++ ++payloadbegin;
++ }
++
++ sd->appenditem(filepos_t(sd->nextfilepos,0),
std::string(sd->header,6,payloadbegin-6),
++ sd->header.c_str()+payloadbegin,
sd->header.size()-payloadbegin);
++ returnvalue += sd->header.size()-payloadbegin;
++ sd->header.clear();
++ return returnvalue;
++ }
++ }
++
++/// This function probes the data in the given inbuffer for an mpeg
transport stream.
++/// If it finds a syncbyte (ascii 'G') within the first 8kB which is then
followed by
++/// another syncbyte every 188 bytes (ts packet size) in the next 2kB, then
++/// this data is assumed to be a transport stream.
++/// It returns the buffer offset at which the transport stream starts, or
-1 if
++/// no transport stream was identified.
++int tsfile::probe(inbuffer &buf)
++ {
++ int latestsync=buf.inbytes()-2048;
++ if (latestsync>(8<<10))
++ latestsync=8<<10;
++
++ // Find TS syncbyte 'G' within the first 2048 bytes?
++ const uint8_t *data = (const uint8_t*) buf.data();
++ int ts;
++ for (ts = 0; ts < latestsync; ++ts) {
++ int testupto=ts+2048;
++ int pos;
++ for (pos = ts;pos < testupto;pos += TSPACKETSIZE)
++ if (data[ pos ] != TSSYNCBYTE)
++ break;
++ if (pos >= testupto) // this is a MPEG TS file
++ return ts;
++ }
++ return -1;
++ }



  • [SM-Commit] GIT changes to master grimoire by Florian Franzmann (df16567d3577b2610e5dfe818b9650b2ae649870), Florian Franzmann, 04/07/2007

Archive powered by MHonArc 2.6.24.

Top of Page