[FFmpeg-user] Problem getting 2 croped video streams +audio
Fabrice DUPRAT
duprat at ipmc.cnrs.fr
Wed Jan 22 13:06:18 EET 2020
Moritz
Thank you very much for your advices, it is working perfectly
On this list, we kindly ask you to provide us with the complete, uncut output of your ffmpeg command. And that implies not using "-hide_banner" (which you didn't, obviously), and not reducing the log level.
With "-loglevel warning", you are asking ffmpeg not to give you all the useful information. Useful not only for us, but also for you. For example, ffmpeg tells you which inputs it is mapping to which filters, which it is mapping to which outputs.
That said, I can explain your issue from the command line:
> -map 0:a:0 -t 00:00:10 audio.wav
> -map 0:v:0 -filter_complex [0:v]crop=in_w/2:in_h:0:0[out_L]
> -filter_complex [0:v]crop=in_w/2:in_h:in_w/2:0[out_R]
> -map [out_L] -t 00:00:10 -r 12 -y -c:v libx265 -metadata title="id_L"
> videoL.mp4 -map [out_R] -t 00:00:10 -r 12 -y -c:v libx265 -metadata
> title="id_R" videoR.mp4
You are providing three outputs (as you did explain), but four "-map"
instructions. So the second and the third "-map" both map to output videoL.mp4. In other words, videoL.mp4 will contain both "0:v:0" and "[out_L]" as separate video streams. If you fiddle with VLC's menus, you will see both streams.
(Furthermore I thought that you cannot use "-filter_complex" twice, but it turns out you can.. You can also define several chains by using one such option and separating the chains with ';'."
This would be your correct command line (guesssing a bit here -
untested):
$ ffmpeg -r 12 -rtsp_transport tcp -i "rtsp://login:pass@XXXX:554/12" \ -map 0:a:0 -t 00:00:10 audio.wav \ -filter_complex "[0:v]crop=in_w/2:in_h:0:0[out_L]; [0:v]crop=in_w/2:in_h:in_w/2:0[out_R]" \ -map [out_L] -t 00:00:10 -r 12 -y -c:v libx265 -metadata title="id_L" videoL.mp4 \ -map [out_R] -t 00:00:10 -r 12 -y -c:v libx265 -metadata title="id_R" videoR.mp4
(Not sure whether you can use "[0:v]" twice, but you'll see.)
Cheers,
Moritz
More information about the ffmpeg-user
mailing list