[FFmpeg-user] ffmpeg - splitting, overlaying and selecting time range in multiple input/outputs with complex video filter producing empty output

Josep Carner Marsal jcm807 at nyu.edu
Tue Oct 10 17:37:46 EEST 2017



Hi,

I am trying to use ffmpeg to apply multiple filters -single input, multiple outputs- . In concrete, I am splitting the output in two, then applying an overlaying patch to one of those streams, split again and select a time range. The command I am using is:

   ffmpeg \
    -i ./dataset_test/videos/jz_10_huron_barstow.mkv \
    -an \
    -sn \
    -loglevel error \
    -filter_complex \
        "[0:v]split=2[L_in][F_in];
         [L_in]
            crop=226:307:21:74,scale=200x200,setdar=200:200,split=2\
         [L_in_0][L_in_1];\
         color=#808080:226x307,setpts=PTS-STARTPTS[L_PATCH];\
         [F_in][L_PATCH]
            overlay=21:74:shortest=1,scale=200x200,setdar=200:200,split=2\
         [F_in_0][F_in_1];\
         [F_in_0]select='between(t\,32\,212)',select='not(mod(n\,20))',setpts=(PTS-STARTPTS)/20[F_0];\
         [F_in_1]select='between(t\,213\,393)',select='not(mod(n\,20))',setpts=(PTS-STARTPTS)/20[F_1];\
         [L_in_0]select='between(t\,32\,212)',select='not(mod(n\,20))',setpts=(PTS-STARTPTS)/20[L_0];\
         [L_in_1]select='between(t\,213\,393)',select='not(mod(n\,20))',setpts=(PTS-STARTPTS)/20[L_1]\
         "\
    -map [F_0] -an -sn ./out/jz_10_huron_barstow/F/0_F.mp4\
    -map [F_1] -an -sn ./out/jz_10_huron_barstow/F/1_F.mp4\
    -map [L_0] -an -sn ./out/jz_10_huron_barstow/L/0_L.mp4\
    -map [L_1] -an -sn ./out/jz_10_huron_barstow/L/1_L.mp4\
For some reason, 0_F.mp4 is empty and 1_F.mp4 is cropped. My intuition is that it has something to do with applying splitting + overlaying + selecting. I think at some point some filter before select is changing the PTS of the frames in some way select is not properly discarding them, but I honestly don't know how to solve it. Some insights:

1) L_0 and L_1 are fine (no overlay is used in those two)

2) If I supress L outputs everything works fine (no "split" is needed at the beginning)

Could someone provide some light? I've beens stucked with this for two days and I don't really know what else to try. 

Many thanks,

Josep



More information about the ffmpeg-user mailing list