## 1 Introduction  
Multimedia streaming has been on the hype during the last decade, enabling a smarter video-watching system. It is clear to all how well-known brands, e.g., YouTube, Netflix, Prime Video, Hulu, Disney+, etc., have completely changed the way people watch video content. According to the statistics, the majority of Internet traffic originates from video streaming applications such as Netflix, YouTube, etc. [1]. This spread is heavily supported by a set of new technologies introduced in the last decades that enabled a smart implementation of streaming solutions for everyone. Among others, Dynamic Adaptive Streaming over HTTP (DASH) made it possible to stream large video content while adapting to the variable network conditions and exploiting HTTP protocol [2], hence, overcoming older protocols (e.g., Real-time Transport Protocol--RTP) suffering from reduced client compatibility and gateway port filtering. In order to implement a proper video streaming application, new network protocols required a huge amount of storage space and computing efforts. On the one hand, videos require lots of storage space. Despite the recently introduced more efficient encoding standards, video content still remains one of the heaviest in terms of data size [3]. At the same time, an increased number of devices, video codecs, and user requirements have pushed towards scalable approaches where the same video content should be adapted to the users' requests [4]. In order to do this, additional processing capabilities are required. Therefore, cloud computing facilities soon became one of the main enabling technologies for video streaming services [5]. Despite big efforts in integrating cloud computing in streaming scenarios, the last years have been characterized by an impressive increase in multimedia content, highlighting some disadvantages inherently present in the centralized cloud computing approach, mainly in terms of high latency and scalability issues. In future 5G mobile networks, the low end-to-end communication latency and high available bandwidth allows the mobile users to stream with high quality. Fog [6; 7] and edge [8; 9] computing paradigms, by bringing the services closer to the users, have indeed increased the interest of the multimedia world as a feasible way of solving latency and scalability, which leads towards satisfying the requirements of 5G networks. On one side, edge and fog computing nodes can be installed nearer to the users, reducing the latency, and, on the other side, their numbers can be increased, reducing the problem of scalability [10; 11; 12]. By exploiting the fog computing paradigm, we are aiming at integrating the DASH approach into a fog computing scenario. In particular, by exploiting the DASH media segment organization, we propose a joint storage and processing approach that, leveraging on a fog computing infrastructure, allows to optimally place the video segments in order to maximize the user experience. In particular, the proposed approach allows taking into account the possible limitations of the fog nodes in terms of the amount of data that can be stored so as to build an implementable solution for delivering videos at the edge. In addition, based on the fact that videos are usually organized in multiple quality levels, targeted to different user requests, we aim at integrating an on-demand approach that allows to jointly consider the video quality scalability and transcoding. While scalable video coding (SVC) allows to interleave different streams, typically one basic stream and one additional stream, so as to increase the quality from the basic to the targeted higher quality, in the case of transcoding, the quality can be changed to fit the user requests [13]. To this aim, a proper procedure is proposed for integrating both scalability and transcoding in the fog computing architecture, aiming at minimizing the overall video delivery latency.