While at first sight it seems that transcoding might be always a good thing, because it makes sure that our media will be compatible with the limitations of our consumers, the fact is that the transcoding step will rapidly saturate the CPU as soon as several streams need to be processed at the same time. Modern codecs are incredibly sophisticated and able to obtain huge savings in file size without introducing much quality loss due to compression, but doing so comes at a high cost in terms of computational resources. The video and audio tracks are extracted (" demultiplexed", in the multimedia jargon) from the container and then streamed as-is, without first reintroducing (or " multiplexing") them into any container.
![ffmpeg concat all files in directory ffmpeg concat all files in directory](https://i.stack.imgur.com/RrLmq.png)
Note that when streaming video and/or audio with RTP, containers are not an issue because the inner media tracks themselves are transmitted. A transcoding step is needed to convert between these: video and audio need to be re-encoded with correct codecs, and the results have to be stored in the proper container format.
#Ffmpeg concat all files in directory mp4#
However, our consumer is only able to process MP4 files with video encoded with H.264 and audio encoded with MP3. Here, we have a Matroska file video.mkv, containing video that was encoded with Google's VP8 and audio encoded with the OPUS codec.
![ffmpeg concat all files in directory ffmpeg concat all files in directory](https://assets.hongkiat.com/uploads/ffmpeg-guide/convert-a-video-file-from-one-format-to-another.jpg)
This is typically done for compatibility purposes, such as when a media source provides a format that the intended target is not able to process an in-between adaptation step is required: Transcoding is the act of transforming one media encoding format directly to another. The command syntax is generally the same on all platforms, but you might need to adapt some platform-specific details such as continuation lines ( \ on Linux, ^ on Windows), or access to environment variables ( $NAME or $ on Linux, %NAME% on Windows).īefore heading directly into practical examples of RTP streaming, we have to talk about transcoding, a concept that ends up appearing sooner or later around the topic of media streaming.
![ffmpeg concat all files in directory ffmpeg concat all files in directory](http://ffmpeg2.giganeomarket.com/assets/GigaNeo.png)
You still need to know what is a codec, a parser, a filter, etc., how and why are you using all these together, and be able to work your way through technical documentation and asking the right questions, in order to end up using these tools in an effective way.Īll the examples shown here will be formatted for a Linux terminal. The matter of fact is that media processing in and of itself is a complex topic, and tools like FFmpeg or GStreamer couldn't do much to smoothen this without at the same time compromising on their feature set. Using these tools can be somewhat confusing or complex for the uninitiated, though. We'll be having a look at how these are handled by some of the best known open-source multimedia tools, FFmpeg and GStreamer: what are the characteristics and shortcomings of their RTP implementations, bugs, things to keep in mind, etc. While RTP is a pretty well established standard, not all extensions and operation modes are necessarily supported by all implementations.
#Ffmpeg concat all files in directory series#
In this series of posts we are talking about RTP and SDP: