eladg / ffmpeg-by-example

Creative Commons Attribution 4.0 International
8 stars 5 forks source link

Print a data channel to STDOUT using ffmpeg - FFmpeg By Example #92

Open eladg opened 10 months ago

eladg commented 10 months ago

https://www.ffmpegbyexample.com/examples/wk7c9c6q/print_data_channel_to_stdout_using_ffmpeg/

In this specific example, we read an RTSP stream from a server. The RTSP server has two streams - A video stream and a 'Data' stream. Since we aim to print the data channel byte data to STDOUT, we are 'mapping' the 2nd stream of the first input (i.e.: -map 0:1) to the output. We ensure the 'encoding' we use is text and that this encoding is set to 'data' format (i.e.: -c text -f data).

Finally, since FFmpeg typically expects a file output, we add the - to indicate we would like the output to go to STDOUT. That's it!