View Full Version : do i use scenecut or keyint/keyint_min for this?
morph166955
29th April 2006, 19:13
Im working on some HDTV encodes but im having an issue and im not sure which to use or if i should use both. Due to the software thats doing the initial record (fusion5hdtv usb's software) the mpeg-ts stream has issues with searching (known issue from what i have read). So what im doing to snip out commercials is encode the entire thing as x264 first and then clip out the commercials rather then clip commercials and then encode.
Its mostly working but im having issues when cutting it up where i get the "reference picture missing during reorder" error and blockyness until it hits the next GOP (i think). if i dont start at the gop i get the blocks, if i do then i either miss the first few seconds (2-3 max) or i get the end of the commercials and i dont want that either. I was thinking of simply reducing keyint down to 30 (im downscaling from the 60fps to 30fps since for me it doesnt matter) and possibly downscaling the keyint_min down to 1 so that it will always write a keyint at the end of a scene. my other idea was to use scenecut and just put that at a high number but i really have no idea what a good value for that is or if that will help my situation.
ive read up on the manuals and on here and google but im not sure which to use in this case? i dont have a problem with it using more space since im doing the encoding twice of sorts right now. i was going to first encode it at crf=12 or so (yea i know how big that will get, im doing it for speed), then clip it up and create a final composition w/o commercials, then create my final pass with crf=22 (i wouldnt use the keyint/scenecut stuff here since its already all sliced up and now its just for viewing...right?). i have PLENTY (over a TB free) of scratch space and while i care about encoding time i dont mind if it takes me a little longer to get what i want if it looks right.
thanks much.
morph166955
29th April 2006, 19:41
just as another few thoughts i just had.
does it matter if i did this all in one pass using crf=22 and keyint/scenecut? from what i read all this can affect me negatively is in size but really how much size difference am i going to get in 45 mins at crf=22?
also, would it make more sense to do a first pass in say xvid or something else, set the keyint to like 10 frames and bitrate really high (say 4000+) for speed, chop that up, then pass the final cut version to x264 for a final shrinkdown?
Im working on some HDTV encodes but im having an issue and im not sure which to use or if i should use both. Due to the software thats doing the initial record (fusion5hdtv usb's software) the mpeg-ts stream has issues with searching (known issue from what i have read).
Have you tried demuxing with ProjectX? At least that's the way to go with DVB streams. If ProjectX doesn't work properly with your Fusion5HDTV streams, you could ask if the developers are willing to add support for it.
morph166955
29th April 2006, 20:10
forgot to mention...im doing this on a linux/freebsd setup so were straight up linux cli only...no gui (i have x11 loaded but i really prefer not to use it since im trying to make scripts to do this all auto)
morph166955
29th April 2006, 20:13
also note...im ASTC not DVB...
foxyshadis
29th April 2006, 21:05
Another option is lossless, or xvid_encraw with a near-lossless matrix. Both have good scenecut detection as-is - if the commercial break is a nice clean cut (instead of a fade in/out) it'll definitely pick it up as an I-frame. Try a test encode to see. If it doesn't pick a few up, then yeah, shrink the interval or lower the threshold.
xvid with a small gop and EHR (or even 6of9 if that's too big) matrix is my favorite method, it's faster than lossless to encode and decode (no slow settings used, just a q2), because it's less hard drive work, with no visible degradation. I've been using it for everything I edit for months now.
forgot to mention...im doing this on a linux/freebsd setup so were straight up linux cli only...no gui (i have x11 loaded but i really prefer not to use it since im trying to make scripts to do this all auto)
ProjectX works without the GUI, I use it within a script for demuxing VDR recordings on 64-bit Debian Sid. After that I encode with Mencoder/x264 :)
also note...im ASTC not DVB...
I know.
morph166955
29th April 2006, 23:49
interesting idea foxy. you just gave me another. If i went straight from mpeg-ts to an mpeg2 stream using the lavc codec and croped/scaled/reduced fps before anything, would it go faster? i think at that point i would be able to go through and do the commercials from that, composite it, and then do a final encode with x264 on the already smaller, croped, lower fps file. would that work with out loosing data? i also assume since im crop/scaling the original in there then i can scale down the bitrate by a ratio equal to the original area/new area, and maybe add a little just to be safe? in the end i think that could bring me down to a very usable mpeg2 stream which i can simply throw to mencoder and be done with right?
foxyshadis
30th April 2006, 00:40
No reason it shouldn't, other than probably needing double the bitrate (unless you don't mind a bit of degradation) over mpeg-4. Still need a high bitrate matrix.
morph166955
30th April 2006, 01:55
wait...confusion.
the video comming in is @ 19000kbit/s MPEG-TS (i believe that its MPEG2 right)? this is what mplayer says when i run it with no options at all
Playing House.tp.
TS file format detected.
DEMUX OPEN, AUDIO_ID: -1, VIDEO_ID: -1, SUBTITLE_ID: -2,
PROBING UP TO 2000000, PROG: 0
VIDEO MPEG2(pid=49)AUDIO A52(pid=52) NO SUBS (yet)! PROGRAM N. 3
Opened TS demuxer, audio: 2000(pid 52), video: 10000002(pid 49)...POS=63732, PROBE=2000000
VIDEO: MPEG2 1280x720 (aspect 3) 59.940 fps 19000.0 kbps (2375.0 kbyte/s)
im cropping to 1280:704:0:10 based on mplayers cropdetect filter. i then have it doing "scale=720:-2" which is making it 720x396 (i think this # is wrong but its what mencoder is picking so for now ill use it). 1280x704 is ~ 3.3 times larger area then 720x396. so wouldnt it stand to reason that if i divided 19000 by 3.3 and then added some (i think i set it at 8000 even though thats ALOT higher then the ~6000 that it had to be just for safe measure) it would give me the same quality?
also, what is a high bitrate matrix and how do i enable it? right now im using the following:
mencoder House.tp -ofps 30000/1001 -oac mp3lame -lameopts preset=insane -ovc lavc -lavcopts vcodec=mpeg2video:threads=4:mbd=1:keyint=5:psnr:vbitrate=8000 -vf softskip,crop=1280:704:0:10,scale=720:-2 -o House.mpeg2video.avi
its in the middle of a pass now but heres one of the lines from the bottom of the log where its at now. im kinda liking the 78 fps speed
Pos:3255.2s 195085f (76%) 78.21fps Trem: 12min 2574mb A-V:0.059 [4734:320]
morph166955
30th April 2006, 02:16
nm bout the matrix (i think). searched around and found sharktooths below. im assuming the top grid is intra and the bottom is inter? the video that my pass just did just spit out the following:
Video stream: 4756.309 kbit/s (594538 B/s) size: 2496722547 bytes 4199.429 secs 251685 frames
Audio stream: 320.000 kbit/s (40000 B/s) size: 167960640 bytes 4199.016 secs
PSNR: Y:46.35, Cb:47.69, Cr:48.75, All:46.88
it seems that even though i put it at 8000 kbit/s it only wanted to do it at ~4800 which is about 1000kbit/s lower then what my math put it at (~6000). 4800 for a 720x396 image still gives me a bpp of ~.57 which i think is good enough.
8 8 9 11 13 13 14 17
8 8 11 12 13 14 17 18
9 11 13 13 14 17 17 16
11 11 13 13 13 17 18 20
11 13 13 13 16 17 20 24
13 13 13 16 17 20 24 29
13 12 13 17 19 23 28 34
12 13 17 19 23 28 34 41
8 8 8 8 8 8 8 8
8 8 8 8 8 8 8 8
8 8 8 8 8 8 8 8
8 8 8 8 8 8 8 8
8 8 8 8 8 8 8 8
8 8 8 8 8 8 8 8
8 8 8 8 8 8 8 8
8 8 8 8 8 8 8 8
p.s. if im doing this wrong PLEASE either give me the lines that are right or explain to me whats wrong so i can fix my mistake...im lookin for the right way to do this.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.