[FFmpeg-trac] #8004(undetermined:new): Optinal maps: Filtering and streamcopy cannot be used together

FFmpeg trac at avcodec.org
Mon Jul 8 15:38:51 EEST 2019


#8004: Optinal maps: Filtering and streamcopy cannot be used together
-------------------------------------+-------------------------------------
             Reporter:  atorp        |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:               |               Blocked By:
  map,optional,filter                |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 How to reproduce:
 {{{
 % ffmpeg -f mpegts -i input.ts \
  -filter_complex "[i:256]null[video]" \
  -map "i:256"   -c:v:0 copy \
  -map "[video]" -c:v:1 h264 \
  -map "i:258?"  -c:v:2 copy \
  -f mpegts output.ts
 }}}

 This command WORKS when the input file has just ONE video stream in the
 PID 256. Then it generates an output with identical video streams in PIDS
 256 (a copy of the original one) and 257 (the new compressed in H.264).


 However, if we change it to:
 {{{
 % ffmpeg -f mpegts -i input.ts \
  -filter_complex "[i:256]null[video]" \
  -map "i:256"   -c:v:0 copy \
  -map "[video]" -c:v:1 h264 \
  -map "i:257?"  -c:v:2 copy \
  -f mpegts output.ts
 }}}

 then it FAILS with this error:
 {{{
 Streamcopy requested for output stream 0:1, which is fed from a complex
 filtergraph. Filtering and streamcopy cannot be used together.
 }}}

 And the cause is because FFmpeg uses the PID 257 for the second video in
 the output (PID number collision).

 But, when using the "?" conditional mapping, this error is a bug as the
 collision doesn't have sense. The correct behaviour is: if the input has a
 video stream with the PID 257 then copy it. And this should be true with
 independence of the filter graph, as the error is because the output
 filter for the stream 0:1 is using the PID 257 that's already present in
 the input. So, when the PID 257 doesn't exists in the input the output
 needs to be the same as the first example (PIDs 256 & 257). And when the
 input has the PID 257, the output needs to be: 256 (copy of 256), 257
 (copy of 257) and 258 (the new H.264 stream).

 Please, can you fix this problem?
 Thank you.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8004>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list