diff options
Diffstat (limited to 'command')
-rw-r--r-- | command/demux.cpp | 2 | ||||
-rw-r--r-- | command/markad-standalone.cpp | 10 | ||||
-rw-r--r-- | command/streaminfo.cpp | 77 | ||||
-rw-r--r-- | command/video.cpp | 6 |
4 files changed, 49 insertions, 46 deletions
diff --git a/command/demux.cpp b/command/demux.cpp index 5a039fc..0423f2c 100644 --- a/command/demux.cpp +++ b/command/demux.cpp @@ -1352,7 +1352,7 @@ int cDemux::Process(uchar *Data, int Count, AvPacket *pkt) { if (h264) { - ts2pkt_vpid=new cTS2Pkt(vpid,"TS2H264",589824,true); + ts2pkt_vpid=new cTS2Pkt(vpid,"TS2H264",819200,true); } else { diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp index b8c8866..70e6d84 100644 --- a/command/markad-standalone.cpp +++ b/command/markad-standalone.cpp @@ -630,7 +630,9 @@ void cMarkAdStandalone::CheckIndexGrowing() { struct stat statbuf; if (stat(indexFile,&statbuf)==-1) { - esyslog("failed to stat %s",indexFile); + if (!macontext.Config->GenIndex) { + esyslog("failed to stat %s",indexFile); + } return; } @@ -694,8 +696,6 @@ void cMarkAdStandalone::CheckIndexGrowing() if (iwaittime) { esyslog("resuming after %is of interrupted recording, marks can be wrong now!",iwaittime); - } else { - tsyslog("we have enough frames (%i)",maxframes-framecnt); } iwaittime=0; sleepcnt=0; @@ -999,9 +999,9 @@ bool cMarkAdStandalone::ProcessFile(int Number) free(fbuf); if (f==-1) { if (isTS) { - esyslog("failed to open %05i.ts",Number); + dsyslog("failed to open %05i.ts",Number); } else { - esyslog("failed to open %03i.vdr",Number); + dsyslog("failed to open %03i.vdr",Number); } return false; } diff --git a/command/streaminfo.cpp b/command/streaminfo.cpp index 8657bb2..6defb45 100644 --- a/command/streaminfo.cpp +++ b/command/streaminfo.cpp @@ -121,7 +121,7 @@ bool cMarkAdStreamInfo::FindVideoInfos(MarkAdContext *maContext, uchar *pkt, int } return false; } -#include <stdio.h> + bool cMarkAdStreamInfo::FindH264VideoInfos(MarkAdContext *maContext, uchar *pkt, int len) { if ((!maContext) || (!pkt) || (!len)) return false; @@ -139,55 +139,56 @@ bool cMarkAdStreamInfo::FindH264VideoInfos(MarkAdContext *maContext, uchar *pkt, } else { - if (maContext->Video.Info.Interlaced) - { - if (H264.use_field) { - H264.use_field=false; - return true; - } else { - H264.use_field=true; - } - } else { - return true; - } - /* - if (maContext->Video.Info.Interlaced) { - if (H264.use_field) return true; + if (maContext->Video.Info.Interlaced) + { + if (H264.use_field) { + H264.use_field=false; + return true; + } else { + H264.use_field=true; + } } else { return true; } */ + + if (maContext->Video.Info.Interlaced) { + if (H264.use_field) return true; + } else { + return true; + } + } } - /* - if ((nalu==NAL_SLICE) || (nalu==NAL_IDR_SLICE)) + + if ((nalu==NAL_SLICE) || (nalu==NAL_IDR_SLICE)) + { + uint8_t *nal_data=(uint8_t*) alloca(len); + if (!nal_data) return false; + int nal_len = nalUnescape(nal_data, pkt + 5, len - 5); + cBitStream bs(nal_data, nal_len); + + bs.skipUeGolomb(); // first_mb_in_slice + bs.skipUeGolomb(); // slice_type + bs.skipUeGolomb(); // pic_parameter_set_id + if (H264.separate_colour_plane_flag) { - uint8_t *nal_data=(uint8_t*) alloca(len); - if (!nal_data) return false; - int nal_len = nalUnescape(nal_data, pkt + 5, len - 5); - cBitStream bs(nal_data, nal_len); - - bs.skipUeGolomb(); // first_mb_in_slice - bs.skipUeGolomb(); // slice_type - bs.skipUeGolomb(); // pic_parameter_set_id - if (H264.separate_colour_plane_flag) - { - bs.skipBits(2); // colour_plane_id - } - bs.skipBits(H264.log2_max_frame_num); // frame_num + bs.skipBits(2); // colour_plane_id + } + bs.skipBits(H264.log2_max_frame_num); // frame_num - if (maContext->Video.Info.Interlaced) + if (maContext->Video.Info.Interlaced) + { + if (bs.getBit()) // field_pic_flag { - if (bs.getBit()) // field_pic_flag - { - H264.use_field=bs.getBit(); // bottom_field_flag - } else { - H264.use_field=true; - } + H264.use_field=bs.getBit(); // bottom_field_flag + } else { + H264.use_field=true; } } - */ + } + if (nalu==NAL_SPS) { uint8_t *nal_data=(uint8_t*) alloca(len); diff --git a/command/video.cpp b/command/video.cpp index 868d6ce..1cfbd37 100644 --- a/command/video.cpp +++ b/command/video.cpp @@ -84,7 +84,7 @@ int cMarkAdLogo::Load(const char *directory, char *file, int plane) } int width,height; - if (fscanf(pFile, "P5\n#C%1i %3i\n%3d %3d\n255\n#", &area.corner,&area.mpixel[plane],&width,&height)!=4) + if (fscanf(pFile, "P5\n#C%1i %4i\n%3d %3d\n255\n#", &area.corner,&area.mpixel[plane],&width,&height)!=4) { fclose(pFile); return -2; @@ -336,11 +336,13 @@ int cMarkAdLogo::Detect(int framenumber, int *logoframenumber) if (extract) return LOGO_NOCHANGE; if (!processed) return LOGO_ERROR; + tsyslog("rp=%5i mp=%5i mpV=%5.f mpI=%5.f i=%3i s=%i",rpixel,mpixel,(mpixel*LOGO_VMARK),(mpixel*LOGO_IMARK),area.intensity,area.status); + if (processed==1) { // if we only have one plane we are "vulnerable" // to very bright pictures, so ignore them... - if (area.intensity>100) return LOGO_NOCHANGE; + if (area.intensity>180) return LOGO_NOCHANGE; } int ret=LOGO_NOCHANGE; |