Custom start-at and stop-at commands not working CLI

Discussion of the cross-platform HandBrake command line interface (CLI)
Forum rules
Activity Log is required for support requests. See Must Read: How To Get Questions Answered on These Forums for details
Post Reply
dooley2009
Posts: 3
Joined: Thu Apr 20, 2017 12:21 pm

Custom start-at and stop-at commands not working CLI

Post by dooley2009 » Fri Apr 21, 2017 7:58 am

Please detail your question or problem in as much detail as possible:

I can not get HBCLI to recognize these two commands.

start-at=duration:750:stop-at=duration:805

Start at 750 seconds and end encoding at 805 seconds. CLI keeps trying to encode the whole thing. I'll post my command line below.

As far as I can tell all of my other preset values are working.

Tell us about your environment. What version of HandBrake? What operating system are you running. etc.

HBCLI Version=HandBrakeCLI-20170419172723-1cbd2f5-master-win-x86_64

Windows 10 64bit V. 1703

If there was any exception or error displayed, please copy it and paste it here:

None that I saw

Please include the scan or encode log:


I can not figure out how to get CLI to post a log. Can you guys take a look at my CLI presets and help me get this to you?


I know that you can go blind looking at my code but that's what I have. (And besides the start and stop at commands in alphabetical order :D )

Code: Select all

HandBrakeCLI -i "PATH HERE" -o "PATH HERE" -6 stereo -a 1 -B 159k -E av_aac -e x265 -f av_mp4 -q 22 -R 48000 start-at=duration:750:stop-at=duration:805:allow-non-conformance=0:amp=0:analysis-mode=0:analyze-src-pics=0:annexb=1:aq-mode=1:aq-motion=0:aq-strength=1.00:aud=0:anamorphic=auto:b-adapt=2:bframes=4:bframe-bias=0:b-intra=0:b-pyramid=1:cbqpoffs=0:chromaloc=0:colormatrix=1:colorprim=1:constrained-intra=0:crf=23.0:crop=0:0:0:0:crqpoffs=0:csv-log-level=2:ctu=64:cu-lossless=0:cutree=1:deblock=0:0:decomb=0:display-window=0:dynamic-rd=0.00:early-skip=0:fast-intra=0:frame-threads=3:hash=0:hdr=0:high-tier=1:hrd=0:info=1:input-csp=1:input-res=1920x1080:interlace=0:ipratio=1.40:intra-refresh=0:keyint=300:level-idc=0:limit-modes=0:limit-refs=3:limit-tu=0:log2-max-poc-lsb=8:log-level=4:lookahead-slices=1:lossless=0:max-cll=0,0:max-luma=255:max-merge=2:max-tu-size=32:me=1:merange=57:min-cu-size=8:min-keyint=30:min-luma=0:multi-pass-opt-rps=0:nlmeans=ultralight:nr-inter=0:nr-intra=0:numa-pools=12:open-gop=1:opt-cu-delta-qp=0:opt-ref-list-length-pps=1:opt-qp-pps=1:overscan=0:pbratio=1.30:pme=0:pmode=0:psnr=0:psy-rd=2.00:psy-rdoq=0.00:qcomp=0.60:qg-size=32:qpmax=69:qpmin=0:qpstep=4:rskip=1:rc=crf:rc-grain=0:rc-lookahead=20:range=0:rd=3:rd-refine=0:rdoq-level=0:rdpenalty=0:rect=0:ref=3:repeat-headers=0:sao=1:sao-non-deblock=0:sar=1:scenecut=40:scenecut-bias=0.05:signhide=1:stats-read=0:stats-write=0:strict-cbr=0:strong-intra-smoothing=0:ssim=0:subme=2:temporal-layers=0:temporal-mvp=1:threads=auto:transfer=1:tskip=0:total-frames=0:tskip-fast=0:tu-inter-depth=1:tu-intra-depth=1:two-pass=0:uhd-bd=0:videoformat=5:vui-hrd-info=1:vui-timing-info=1:weightb=0:weightp=1:wpp=1:zone-count=0



Code: Select all

 Paste a log of the scan or encode between these code brackets, or use a pastebin website and provide us with the URL it gives you. 
 Logs are required for all support requests.

rollin_eng
Veteran User
Posts: 2113
Joined: Wed May 04, 2011 11:06 pm

Re: Custom start-at and stop-at commands not working CLI

Post by rollin_eng » Fri Apr 21, 2017 9:40 am

Could you please post your logs, instructions can be found here:

viewtopic.php?f=6&t=31236

User avatar
Rodeo
HandBrake Team
Posts: 11580
Joined: Tue Mar 03, 2009 8:55 pm

Re: Custom start-at and stop-at commands not working CLI

Post by Rodeo » Fri Apr 21, 2017 11:06 am

dooley2009 wrote:
Fri Apr 21, 2017 7:58 am
Please detail your question or problem in as much detail as possible:

I can not get HBCLI to recognize these two commands.

start-at=duration:750:stop-at=duration:805
They're HandBrake options, not x265 options (BTW the start of your command line looks fine, not sure why you somehow stopped using correct syntax midway):

Code: Select all

HandBrakeCLI -i "PATH HERE" -o "PATH HERE" -6 stereo -a 1 -B 160k -E av_aac -e x265 -f av_mp4 -q 22 -R 48000 --start-at duration:750 --stop-at duration:805 --encopts "X265_OPTIONS_HERE"
(note the single dash for short single-letter options, but you need the double dash for long options)

dooley2009
Posts: 3
Joined: Thu Apr 20, 2017 12:21 pm

Re: Custom start-at and stop-at commands not working CLI

Post by dooley2009 » Fri Apr 21, 2017 12:47 pm

Hey thanks for getting back with me you two.


rollin_eng: Below is my log.

I let HBCLI (nightly) encode around 2.5% of the 23 Min 13 Second test video then I killed it using Q in cmd.exe

Code: Select all

[08:30:51] hb_init: starting libhb thread
[08:30:51] thread 1 started ("libhb")
HandBrake 20170416095940-75fbd0a-master (2017041901) - MinGW x86_64 - https://handbrake.fr
12 CPUs detected
Opening C:\Users\jeffr\Desktop\Storage\Video Editing Folder\Test Video x264.mp4...
[08:30:51] CPU: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz
[08:30:51]  - Intel microarchitecture Haswell
[08:30:51]  - logical processor count: 12
[08:30:51] Intel Quick Sync Video support: no
[08:30:51] hb_scan: path=C:\Users\jeffr\Desktop\Storage\Video Editing Folder\Test Video x264.mp4, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:274: failed opening UDF image C:\Users\jeffr\Desktop\Storage\Video Editing Folder\Test Video x264.mp4
src/libbluray/disc/disc.c:352: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:352: error opening file BDMV\BACKUP\index.bdmv
[08:30:51] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[08:30:51] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\jeffr\Desktop\Storage\Video Editing Folder\Test Video x264.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf55.33.100
  Duration: 00:23:13.25, start: 0.000000, bitrate: 8524 kb/s
    Stream #0:0(eng): Video: h264 (High) [avc1 / 0x31637661]
      yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 8324 kb/s
      29.97 fps, 30k tbn (default)
    Metadata:
      handler_name    : DataHandler
      encoder         : libx264
    Stream #0:1(eng): Audio: aac (LC) [mp4a / 0x6134706D]
      48000 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      handler_name    : DataHandler
[08:30:51] scan: decoding previews for title 1
[08:30:51] scan: audio 0x1: aac, rate=48000Hz, bitrate=192011 English (AAC) (2.0 ch)

Scanning title 1 of 1, preview 1, 10.00 %
Scanning title 1 of 1, preview 6, 60.00 %
Scanning title 1 of 1, preview 10, 100.00 %[08:30:52] scan: 10 previews, 1920x1080, 29.970 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[08:30:52] scan: supported video decoders: avcodec qsv
[08:30:52] libhb: scan thread found 1 valid title(s)
+ Using preset: CLI Default
+ title 1:
  + stream: C:\Users\jeffr\Desktop\Storage\Video Editing Folder\Test Video x264.mp4
  + duration: 00:23:13
  + size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 29.970 fps
  + autocrop: 0/0/0/0
  + support opencl: no
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:23:13
  + audio tracks:
    + 1, English (AAC) (2.0 ch) (iso639-2: eng)
  + subtitle tracks:
[08:30:52] 1 job(s) to process
[08:30:52] json job:
{
    "Audio": {
        "AudioList": [
            {
                "Bitrate": 160,
                "Encoder": 65536,
                "Mixdown": 4,
                "Samplerate": 48000,
                "Track": 0
            }
        ],
        "CopyMask": [
            "copy:aac",
            "copy:ac3",
            "copy:eac3",
            "copy:dtshd",
            "copy:dts",
            "copy:mp3",
            "copy:truehd",
            "copy:flac"
        ],
        "FallbackEncoder": "av_aac"
    },
    "Destination": {
        "ChapterList": [
            {
                "Name": ""
            }
        ],
        "ChapterMarkers": false,
        "File": "C:\\Users\\jeffr\\Desktop\\Storage\\Video Editing Folder\\Test Video(H.265).mp4",
        "Mp4Options": {
            "IpodAtom": false,
            "Mp4Optimize": false
        },
        "Mux": "m4v"
    },
    "Filters": {
        "FilterList": [
            {
                "ID": 6,
                "Settings": {
                    "mode": 0
                }
            },
            {
                "ID": 11,
                "Settings": {
                    "crop-bottom": 0,
                    "crop-left": 0,
                    "crop-right": 0,
                    "crop-top": 0,
                    "height": 1080,
                    "width": 1920
                }
            }
        ]
    },
    "Metadata": {},
    "PAR": {
        "Den": 1,
        "Num": 1
    },
    "SequenceID": 0,
    "Source": {
        "Angle": 0,
        "Path": "C:\\Users\\jeffr\\Desktop\\Storage\\Video Editing Folder\\Test Video x264.mp4",
        "Range": {
            "End": 139950000,
            "Start": 67500000,
            "Type": "time"
        },
        "Title": 1
    },
    "Subtitle": {
        "Search": {
            "Burn": true,
            "Default": false,
            "Enable": false,
            "Forced": false
        },
        "SubtitleList": []
    },
    "Video": {
        "ColorMatrixCode": 0,
        "Encoder": "x265",
        "OpenCL": false,
        "Options": "--stderr",
        "QSV": {
            "AsyncDepth": 4,
            "Decode": false
        },
        "Quality": 22.0,
        "Turbo": false,
        "TwoPass": false
    }
}
[08:30:52] starting job
[08:30:52] job configuration:
[08:30:52]  * source
[08:30:52]    + C:\Users\jeffr\Desktop\Storage\Video Editing Folder\Test Video x264.mp4
[08:30:52]    + title 1, start 00:12:30.00 stop 00:25:55.00
[08:30:52]    + container: mov,mp4,m4a,3gp,3g2,mj2
[08:30:52]    + data rate: 8524 kbps
[08:30:52]  * destination
[08:30:52]    + C:\Users\jeffr\Desktop\Storage\Video Editing Folder\Test Video(H.265).mp4
[08:30:52]    + container: MPEG-4 (libavformat)
[08:30:52]  * video track
[08:30:52]    + decoder: h264
[08:30:52]      + bitrate 8324 kbps
[08:30:52]    + filters
[08:30:52]      + Framerate Shaper (mode=0)
[08:30:52]        + frame rate: same as source (around 29.970 fps)
[08:30:52]      + Crop and Scale (width=1920:height=1080:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[08:30:52]        + source: 1920 * 1080, crop (0/0/0/0): 1920 * 1080, scale: 1920 * 1080
[08:30:52]    + Output geometry
[08:30:52]      + storage dimensions: 1920 x 1080
[08:30:52]      + pixel aspect ratio: 1 : 1
[08:30:52]      + display dimensions: 1920 x 1080
[08:30:52]    + encoder: H.265 (libx265)
[08:30:52]      + options: --stderr
[08:30:52]      + quality: 22.00 (RF)
[08:30:52]  * audio track 1
[08:30:52]    + decoder: English (AAC) (2.0 ch) (track 1, id 0x1)
[08:30:52]      + bitrate: 192 kbps, samplerate: 48000 Hz
[08:30:52]    + mixdown: Stereo
[08:30:52]    + encoder: AAC (libavcodec)
[08:30:52]      + bitrate: 160 kbps, samplerate: 48000 Hz
[08:30:52] sync: expecting 24155 video frames
[08:30:52] encx265: unknown option '--stderr'
x265 [info]: HEVC encoder version 2.3
x265 [info]: build info [Windows][GCC 5.3.1][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 12 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 30 / 300 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-22.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 rskip signhide tmvp strong-intra-smoothing
x265 [info]: tools: lslices=6 deblock sao
[08:30:52] sync: first pts video is 0
[08:30:52] sync: first pts audio 0x1 is 1755
[08:31:16] work: average encoding speed for job is 29.314135 fps
[08:31:16] vfr: lost time: 0 (0 frames)
[08:31:16] vfr: gained time: 0 (0 frames) (0 not accounted for)
[08:31:16] aac-decoder done: 1197 frames, 0 decoder errors
[08:31:16] h264-decoder done: 750 frames, 0 decoder errors
[08:31:16] sync: got 704 frames, 24155 expected
[08:31:16] sync: framerate min 29.970 fps, max 29.970 fps, avg 29.970 fps
x265 [info]: frame I:      3, Avg QP:20.43  kb/s: 14113.49
x265 [info]: frame P:    184, Avg QP:21.78  kb/s: 5276.69 
x265 [info]: frame B:    461, Avg QP:27.43  kb/s: 963.61  
x265 [info]: Weighted P-Frames: Y:0.5% UV:0.0%
x265 [info]: consecutive B-frames: 1.1% 4.2% 54.0% 27.5% 13.2% 

encoded 648 frames in 24.15s (26.84 fps), 2249.19 kb/s, Avg QP:25.79
[08:31:16] mux: track 0, 647 frames, 6078799 bytes, 2073.19 kbps, fifo 1024
[08:31:16] mux: track 1, 1098 frames, 469227 bytes, 160.03 kbps, fifo 2048
HandBrake has exited.
Rodeo: Thank you for trying to help me out. I unfortunately am still not able to use the --start-at & --stop-at commands. Below is the exact code that I put into HandBreakCLI via cmd.exe This is what generated the log I posted above.

Also yes I am new at this. Glad to have the help. I really need others to give me advice on the correct syntax at this stage in my learning.

Code: Select all

HandBrakeCLI -i "C:\Users\jeffr\Desktop\Storage\Video Editing Folder\Test Video x264.mp4" -o "C:\Users\jeffr\Desktop\Storage\Video Editing Folder\Test Video(H.265).mp4" -6 stereo -a 1 -B 160k -E av_aac -e x265 -f av_mp4 -q 22 -R 48000 --start-at duration:750 --stop-at duration:805 --encopts --stderr 2> my-activity-log.txt allow-non-conformance=0:amp=0:analysis-mode=0:analyze-src-pics=0:annexb=1:aq-mode=1:aq-motion=0:aq-strength=1.00:aud=0:anamorphic=auto:b-adapt=2:bframes=4:bframe-bias=0:b-intra=0:b-pyramid=1:cbqpoffs=0:chromaloc=0:colormatrix=1:colorprim=1:constrained-intra=0:crf=23.0:crop=0:0:0:0:crqpoffs=0:csv-log-level=2:ctu=64:cu-lossless=0:cutree=1:deblock=0:0:decomb=0:display-window=0:dynamic-rd=0.00:early-skip=0:fast-intra=0:frame-threads=3:hash=0:hdr=0:high-tier=1:hrd=0:info=1:input-csp=1:input-res=1920x1080:interlace=0:ipratio=1.40:intra-refresh=0:keyint=300:level-idc=0:limit-modes=0:limit-refs=3:limit-tu=0:log2-max-poc-lsb=8:log-level=3:lookahead-slices=1:lossless=0:max-cll=0,0:max-luma=255:max-merge=2:max-tu-size=32:me=1:merange=57:min-cu-size=8:min-keyint=30:min-luma=0:multi-pass-opt-rps=0:nlmeans=ultralight:nr-inter=0:nr-intra=0:numa-pools=12:open-gop=1:opt-cu-delta-qp=0:opt-ref-list-length-pps=1:opt-qp-pps=1:overscan=0:pbratio=1.30:pme=0:pmode=0:psnr=0:psy-rd=2.00:psy-rdoq=0.00:qcomp=0.60:qg-size=32:qpmax=69:qpmin=0:qpstep=4:rskip=1:rc=crf:rc-grain=0:rc-lookahead=20:range=0:rd=3:rd-refine=0:rdoq-level=0:rdpenalty=0:rect=0:ref=3:repeat-headers=0:sao=1:sao-non-deblock=0:sar=1:scenecut=40:scenecut-bias=0.05:signhide=1:stats-read=0:stats-write=0:strict-cbr=0:strong-intra-smoothing=0:ssim=0:subme=2:temporal-layers=0:temporal-mvp=1:threads=auto:transfer=1:tskip=0:total-frames=0:tskip-fast=0:tu-inter-depth=1:tu-intra-depth=1:two-pass=0:uhd-bd=0:videoformat=5:vui-hrd-info=1:vui-timing-info=1:weightb=0:weightp=1:wpp=1:zone-count=0

Woodstock
Veteran User
Posts: 1941
Joined: Tue Aug 27, 2013 6:39 am

Re: Custom start-at and stop-at commands not working CLI

Post by Woodstock » Fri Apr 21, 2017 3:42 pm

Isn't the stop-at value the number of seconds to encode, NOT the position to stop at? 805 seconds starting at 750 seconds is consistent with how handbrake interpreted it:
[08:30:52] + title 1, start 00:12:30.00 stop 00:25:55.00
What happens if you use "--stop-at duration:55" instead?

bipedal42
Posts: 1
Joined: Wed Feb 03, 2016 3:59 am

Re: Custom start-at and stop-at commands not working CLI

Post by bipedal42 » Thu May 18, 2017 9:59 pm

I'm going to take a crack at this after using this community for answers for a year, and learning handbrake myself. I think your reading this command wrong like I did the first time. Start at 750 seconds and end at 805 seconds does not mean encode from 750 sec to 805 sec. It means start encoding at 705 sec, then encode for 805 sec, and then stop encoding. You get an 805 second encode starting 705 seconds into the title. Darn it, guess I missed Woodstock’s comment, either way, his is right, mine is just longer and way late.

dooley2009
Posts: 3
Joined: Thu Apr 20, 2017 12:21 pm

Re: Custom start-at and stop-at commands not working CLI

Post by dooley2009 » Fri May 19, 2017 8:03 am

Woodstock,

Even though this is an incredibly late reply I wanted to let you know that your suggestion to use

--stop-at duration:55

worked great.

Thanks to everyone who pitched in to help me out.

Post Reply