@ slhck
This slows down one part of a video and keeps the rest as is.
I've never seen PTS-STARTPTS
before. I have always used just PTS
for this purpose. I have a recent script that hangs with just PTS
but it works with PTS-STARTPTS
. Can you explain why?
With PTS
ffmpeg -i "input.mkv" \
-filter_complex \
" \
[0:v]trim='00\:08\:23.961':'00\:08\:24.379',setpts=4*PTS,curves=psfile=curves40.acv,unsharp=13:13:1.5:13:13:1.5[v0]; \
[0:a]atrim='00\:08\:23.961':'00\:08\:24.379',asetpts=PTS,atempo=0.5,atempo=0.5[a0]; \
[0:v]trim='00\:08\:23.961':'00\:08\:24.379',reverse,setpts=4*PTS,curves=psfile=curves40.acv,unsharp=13:13:1.5:13:13:1.5[v1]; \
[0:a]atrim='00\:08\:23.961':'00\:08\:24.379',areverse,asetpts=PTS,atempo=0.5,atempo=0.5[a1]; \
[v0][a0][v1][a1]concat=n=2:v=1:a=1[out] \
" \
-map "[out]" \
-r $fps -c:v libx264 -preset slow -crf 10 -map_chapters -1 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 \
-movflags faststart "otput.mp4"
With PTS-STARTPTS
ffmpeg -i "input.mkv" \
-filter_complex \
" \
[0:v]trim='00\:08\:23.961':'00\:08\:24.379',setpts=4*(PTS-STARTPTS),curves=psfile=curves40.acv,unsharp=13:13:1.5:13:13:1.5[v0]; \
[0:a]atrim='00\:08\:23.961':'00\:08\:24.379',asetpts=PTS-STARTPTS,atempo=0.5,atempo=0.5[a0]; \
[0:v]trim='00\:08\:23.961':'00\:08\:24.379',reverse,setpts=4*(PTS-STARTPTS),curves=psfile=curves40.acv,unsharp=13:13:1.5:13:13:1.5[v1]; \
[0:a]atrim='00\:08\:23.961':'00\:08\:24.379',areverse,asetpts=PTS-STARTPTS,atempo=0.5,atempo=0.5[a1]; \
[v0][a0][v1][a1]concat=n=2:v=1:a=1[out] \
" \
-map "[out]" \
-r $fps -c:v libx264 -preset slow -crf 10 -map_chapters -1 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 \
-movflags faststart "otput.mp4"
In both cases I get frame= 0 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
but it works in this case.