最近のCMカット情勢

Posted on 2014/05/17 (土) 20:25
Filed Under 技術 | 1 Comment | TrackBack | ���̃G���g�����͂Ăȃu�b�N�}�[�N�ɒlj� Share on Tumblr

comskipを使った前回のCMカット記事「foltiaで全自動CMカットを実現しよう」からもう半年以上も経ってしまったけど最近のCMカット情勢の途中経過。

いろんな局のCMをカットして行ったら、当初のパラメータだとMXTVが切りにくかったんで調べて行ったところ、「comskipのUNIX化 - なんとな~くしあわせ?の日記」さんで紹介されていた、「自動TSエンコードバッチ(AutoConvert) | らんだむけんきゅうじょ」さんのAutoConvertのcomskip.iniの具合がよろしかった。
ので、それをベースにさせてもらってさらにいじりつつ、今使ってるcomskip.iniはこれ。

; See comskip.txt in the distribution zip file for many settable parameters, read manual.html, tuning.html and debugwindow.html for how to tune and debug comskip
detect_method=198 ;1=black frame, 2=logo, 4=scene change, 8=fuzzy logic, 17=closed captions, 32=aspect ration, 64=silence, 128=cutscenes, 255=all
validate_silence=1 ; Default, set to 0 to force using this clues if selected above.
validate_uniform=1 ; Default, set to 0 to force using this clues (like pure white frames) if blackframe is selected above.
validate_scenechange=1 ; Default, set to 0 to force using this clues if selected above.
verbose=0 ;show a lot of extra info, level 5 is also OK, set to 0 to disable
max_brightness=60 ;frame not black if any pixels checked are greater than this (scale 0 to 255)
test_brightness=40 ;frame not pure black if any pixels checked are greater than this, will check average brightness (scale 0 to 255)
max_avg_brightness=25 ;maximum average brightness for a dim frame to be considered black (scale 0 to 255) 0 means autosetting
max_commercialbreak=600 ;maximum length in seconds to consider a segment a commercial break
min_commercialbreak=25 ;minimum length in seconds to consider a segment a commercial break
max_commercial_size=125 ;maximum time in seconds for a single commercial or multiple commercials if no breaks in between
min_commercial_size=4 ;mimimum time in seconds for a single commercial
min_show_segment_length=125 ;[changed from 250] any segment longer than this will be scored towards show.
non_uniformity=500 ; Set to 0 to disable cutpoints based on uniform frames
max_volume=15 ; [changed]any frame with sound volume larger than this will not be regarded as black frame
min_silence=20 ; [changed]Any deep silence longer than this amount of frames is a possible cutpoint
ticker_tape=0 ; Amount of pixels from bottom to ignore in all processing
logo_at_bottom=0 ; Set to 1 to search only for logo at the lower half of the video, do not combine with subtitle setting
subtitles=0 ; [add]
punish=0 ; Compare to average for sum of 1=brightness, 2=uniform 4=volume, 8=silence, 16=schange, set to 0 to disable
punish_threshold=1.3 ; Multiply when amount is above average * punish_threshold
punish_modifier=2 ; When above average * threshold multiply score by this value
intelligent_brightness=0 ; Set to 1 to use a USA specific algorithm to tune some of the settings, not adviced outside the USA
logo_percentile=0.92 ; if more then this amount of logo is found then logo detection will be disabled
logo_threshold=0.30 ; [changed] from 0.75
punish_no_logo=1 ; [changed from 1]Default, set to 0 to avoid show segments without logo to be scored towards commercial
aggressive_logo_rejection=0
connect_blocks_with_logo=1 ; set to 1 if you want successive blocks with logo on the transition to be regarded as connected, set to 0 to disable
logo_filter=4 ; [changed]set the size of the filter to apply to bad logo detection, 4 seems to be a good value.
cut_on_ar_change=1 ; set to 1 if you want to cut also on aspect ratio changes when logo is present, set to 2 to force cuts on aspect ratio changes. set to 0 to disable
delete_show_after_last_commercial=0 ; set to 1 if you want to delete the last block if its a show and after a commercial
delete_show_before_or_after_current=0 ; set to 1 if you want to delete the previous and the next show in the recording, this can lead to the deletion of trailers of next show
delete_block_after_commercial=0 ; set to max size of block in seconds to be discarded, set to 0 to disable
remove_before=0 ; amount of seconds of show to be removed before ALL commercials
remove_after=0 ; amount of seconds of show to be removed after ALL commercials
shrink_logo=5 ; Reduce the duration of the logo with this amount of seconds
after_logo=0 ; set to number of seconds after logo disappears comskip should start to search for silence to insert an additional cutpoint
padding=0
ms_audio_delay=5
volume_slip=30 ;[changed]from 40
skip_b_frames=0 ; Set to 1 to force Comskip to skip frames for higher processing speed.
max_repair_size=200 ; Will repair maximum 200 missing MPEG frames in the timeline, set to 0 to disable repairing for players that don't use PTS.
disable_heuristics=4 ; bit pattern for disabling heuristics, adding 1 disables heristics 1, adding 2 disables heristics 2, adding 4 disables heristics 3, 255 disables all heuristics
delete_logo_file=0 ; set to 1 if you want comskip to tidy up after finishing
output_framearray=0 ; create a big excel file for detailed analysis, set to 0 to disable
output_data=0 ; create a dump of the user data channel, used for CC and XDS (such as V-Chip info). Can be use together with output_framearray to remote debug CC decoding
output_videoredo=0
output_womble=0
output_mls=0 ; set to 1 if you want MPeg Video Wizard bookmark file output
output_cuttermaran=0
output_mpeg2schnitt=0
output_mpgtx=0
output_dvrcut=0
output_zoomplayer_chapter=0
output_zoomplayer_cutlist=0
output_edl=0 ;[changed]
output_dvrmstb=0 ; Set to 1 if you're running DVRMS-Toolbox
output_edlx=0
output_vcf=0
output_bsplayer=0
output_btv=0 ; set to 1 if you want Beyond TV chapter cutlist output
output_projectx=0 ; set to 1 if you want ProjectX cutlist output (Xcl)
output_avisynth=0 :
output_vdr=1 ; set to 1 if you want XBMC to skipping commercials
output_demux=0 ; set to 1 if you want comskip to demux the mpeg file while scanning
sage_framenumber_bug=0
sage_minute_bug=0
live_tv=0 ; set to 1 if you use parallelprocessing and need the output while recording
live_tv_retries=4 ; change to 16 when using live_tv in BTV, used for mpeg PS and TS
dvrms_live_tv_retries=300 ; only used for dvr_ms
standoff=0 ; change to 8000000 when using live_tv in BTV
cuttermaran_options="cut=\"true\" unattended=\"true\" muxResult=\"false\" snapToCutPoints=\"true\" closeApp=\"true\""
mpeg2schnitt_options="mpeg2schnitt.exe /S /E /R25 /Z %2 %1"
avisynth_options="" ;[changed]
dvrcut_options="dvrcut \"%s.dvr-ms\" \"%s_clean.dvr-ms\" "
windowtitle="Comskip - %s"
view raw comskip.ini hosted with ❤ by GitHub

logo_thresholdの値を大きくすると、本編にCMが混じりにくくなるかわりに本編が誤カットされやすくなるよう。
0.35まで下げるとMXTVでも本編は誤カットされずに残る感じがした。(しかしたまにCMが混じる)
処理するソースの局ロゴの鮮明さで調整すると最適感。
あと10秒程度の独立した次回予告とかエンドカードとかは本編扱いされずに飛んでしまうのは今のところの課題。

そしてカット編集。
ffmpegではカット位置の指定がなん種類かあって速度や精度が違うと説明されている(Seeking with FFmpeg – FFmpeg)のだけど、地デジは切れてBSが切れなかったり、いろいろ都合が悪かったりしたので、処理時間は要するけど正確でどのtsでも切れる方法を使うことにした。

[事例]
・地デジは高速に切れるけれどもBSは切れない。

ffmpeg -y -ss 0:27:45.76 -i ./3238-9-20140310-0135.m2t -c copy -t 0:00:44.94 -sn ./3238-9-20140310-0135-004c.ts

・BSも地デジも切れるけれどもすげー処理時間がかかる。

ffmpeg -y -i ./3238-9-20140310-0135.m2t -c copy -ss 0:27:45.76 -to 0:28:30.70 -sn ./3238-9-20140310-0135-004a.ts

参考:「ffmpeg で時間単位やフレーム単位でカットする方法 : ニコニコ動画研究所

それと、編集したあとのtsがPS3(システムソフトウェア4.55)で早送り早戻しのトリックプレイできたり出来なかったりする。
なんとなく局によるようで、MXTV、TBS、フジテレビは出来ずにBS11、テレ東、日テレ、テレビ朝日はできることが多いよう。
なんでですかね?

MP4へのチャプタと再生環境

Posted on 2014/05/03 (土) 1:53
Filed Under foltia | Leave a Comment | TrackBack | ���̃G���g�����͂Ăȃu�b�N�}�[�N�ɒlj� Share on Tumblr

チャプタを入れたMP4の再生環境を調べてみた。

【準備編】
comskipから生成した.vdrファイルをMAQ-3339-4-20140426-0225.chapters.txtというファイル名にリネーム。
下のコマンド例のようにmp4chapsで.chapters.txtをもとにチャプタを追加。

[foltia@foltia mita]$ cat MAQ-3339-4-20140426-0225.chapters.txt
0:00:00.33 start
0:01:28.48 end
0:14:46.21 start
0:16:45.47 end
0:27:06.55 start
0:28:36.51 end
0:30:28.59 start
0:30:39.57 end
[foltia@foltia mita]$ mp4chaps –verbose 3 -i MAQ-3339-4-20140426-0225.MP4
job begin: MAQ-3339-4-20140426-0225.MP4
Importing 8 QuickTime and Nero chapters from file MAQ-3339-4-20140426-0225.chapters.txt into file “MAQ-3339-4-20140426-0225.MP4″
WARNING: Chapter ‘end’ start: 00:30:39:570, playlength of file: 00:30:39:404, chapter cannot be set
closing MAQ-3339-4-20140426-0225.MP4
job end
exit code 0
[foltia@foltia mita]$ MP4Box -info MAQ-3339-4-20140426-0225.MP4
* Movie Info *
Timescale 600 - Duration 00:30:39.403
Fragmented File no - 3 track(s)
File Brand M4V - version 1
Created: GMT Sat Apr 26 04:17:41 2014

File has root IOD (9 bytes)
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: AVC/H264 Profile (0×15)
Audio PL: AAC Profile @ Level 2 (0×29)
No streams included in root OD

Chapters:
Chapter #1 - 00:00:00.000 - “start”
Chapter #2 - 00:01:28.150 - “end”
Chapter #3 - 00:14:45.880 - “start”
Chapter #4 - 00:16:45.140 - “end”
Chapter #5 - 00:27:06.220 - “start”
Chapter #6 - 00:28:36.180 - “end”
Chapter #7 - 00:30:28.260 - “start”

Track # 1 Info - TrackID 1 - TimeScale 30000 - Duration 00:30:39.404
Media Info: Language “Undetermined” - Type “vide:avc1″ - 55127 samples
Visual Track layout: x=0 y=0 width=483 height=272
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0×21
AVC/H264 Video - Visual Size 480 x 272
AVC Info: 1 SPS - 1 PPS - Profile High @ Level 1.3
NAL Unit length bits: 32
Pixel Aspect Ratio 136:135 - Indicated track size 483 x 272
Self-synchronized

Track # 2 Info - TrackID 2 - TimeScale 48000 - Duration 00:30:38.826
Media Info: Language “Undetermined” - Type “soun:mp4a” - 86195 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0×40
MPEG-4 Audio MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 48000
Synchronized on stream 1

Track # 3 Info - TrackID 4 - TimeScale 1000 - Duration 00:30:39.074
Track is disabled
Media Info: Language “Undetermined” - Type “text:text” - 7 samples
3GPP/MPEG-4 Timed Text - Size 0 x 0 - Translation X=0 Y=0 - Layer 0

[foltia@foltia mita]$

【再生編】
ざっと言ってチャプタを認識してジャンプできたかどうか。

[期待通り動作した]
VLC media player Version 2.1.4 Rincewind (Intel 64bit)
QuickTime Player バージョン 10.3 / ストリーミング再生 (727.3)(QTX)再生種別追記
QuickTime Player バージョン 10.3 / ファイル再生 (727.3)(QTX)
iTunesでVideoアプリにMoviesとして転送した/iOS 7.1.1(11D201) iPad Air

[認識しない]
QuickTime Player 7 バージョン 7.6.6 (1709)
Safariでストリーミング再生/iOS 7.1.1(11D201) iPad Air
iTunesでFolcastを取得してiPadに同期/iOS 7.1.1(11D201) iPad Air
iTunesでVideoアプリにホームビデオとして転送した/iOS 7.1.1(11D201) iPad Air

ていうか、チャプタ認識しないことが多すぎてえれー不便。
iPadのVideoアプリ内で再生した時も、ムービー再生中はチャプタリストが出なくなったようでこれまた不便感。チャプタ単位のジャンプは出来ずに|< < >>|の前後移動だけ可能。(iOS6では出てたような気がしたが未確認)

Recently


Categories


Archives


Wish list

宗子さんのほしい物リスト2015/5-
Pages (152): [1] 2 3 4 5 6 7 8 9 10 11 ... Last »