Also, I suspect that if I ran ffmpeg commands in quick succession it could lead to stuttering the video being played - because ffmpeg could clean up chunks that were not played back yet, but ffmpeg considered them old. Of course, I still have to make sure that I have the next video ready when the current video playback comes to an end. The player picks everything up automatically. When ffmpeg command finishes, I just have to re-run it with the video I want to go next. The result is the infinite video that I can play with ffplay out.m3u8. I also changed the default number of chunks in the playlist to 30 with -hls_list_size 30 flag. To prevent that, and also to make sure that ffmpeg cleanups and does not override the existing playlist, I added these flags: -hls_flags delete_segments+append_list+omit_endlist. By default, ffmpeg adds a terminating command to the m3u8 file. It makes ffmpeg take the input video, split it in chunks, save them and generate a playlist for HLS consumer (ffplay in my case).īut I want to make sure that the playlist is infinite. To make this work, I added -f hls flag to the ffmpeg command. The player does not need to know beforehand how many chunks there are and which will be next - these were exactly my requirements. In a nutshell, it's pretty simple - it just lists chunks of video and their duration in a text file, so that player knew which chunk to play next. HTTP Live Streaming is a protocol implemented by Apple. I've managed to get what I want with the following command (by following Ryan Williams's tip to use HLS): ffmpeg -i source.mp4 -s 640x360 -hls_list_size 30 -hls_flags delete_segments+append_list+omit_endlist -f hls out.m3u8 I hope you'll be able to get me into the right direction. I'm really new to ffmpeg, so I'm sorry if I'm asking for something obvious or impossible. ffplay should automatically and seamlessly start playing it, but only after it finished with the first file ffplay should automatically start playing it If I run the same ffmpeg command again, ffplay plays the video from the start with ugly artifacts. You may also want to change the resolution to match the new screen mode (check fbset's command line options) orangeman. You can recreate the console with: Code: Select all. I tried to append to a file and just play it with ffplay like this: ffmpeg -re -i source.mp4 -f mpegts - > video.tsīut that didn't work - once ffmpeg is done with the file, ffplay stops playing. Changing screen resolution on the fly If you want to change your screen resolution, while still running Linux but you are not using Gnome or KDE, which gives good options to change screen resolution, you will have to use the xrandr command If you enter it alone: xrandr It will display the list of available reolutions. You will lose any overlays on the screen when switching mode. When one video is finished, the next one should be played seamlessly, without any delay. I'm going to playback videos with ffplay. This should work locally, without any networking. However, killing the old feed and then streaming a different resolution into the device does not change the advertised capabilities, and just scrambles the screen in vlc.I want to show videos non-stop without knowing beforehand which videofile would go next on a Linux host. $ ffmpeg -f v4l2 -list_formats all -i /dev/video2įfmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developersĬonfiguration: -prefix=/usr -disable-debug -disable-static -disable-stripping -enable-avisynth -enable-fontconfig -enable-gmp -enable-gnutls -enable-gpl -enable-ladspa -enable-libaom -enable-libass -enable-libbluray -enable-libdav1d -enable-libdrm -enable-libfreetype -enable-libfribidi -enable-libgsm -enable-libiec61883 -enable-libjack -enable-libmfx -enable-libmodplug -enable-libmp3lame -enable-libopencore_amrnb -enable-libopencore_amrwb -enable-libopenjpeg -enable-libopus -enable-libpulse -enable-librav1e -enable-libsoxr -enable-libspeex -enable-libsrt -enable-libssh -enable-libtheora -enable-libv4l2 -enable-libvidstab -enable-libvmaf -enable-libvorbis -enable-libvpx -enable-libwebp -enable-libx264 -enable-libx265 -enable-libxcb -enable-libxml2 -enable-libxvid -enable-nvdec -enable-nvenc -enable-omx -enable-shared -enable-version3 This works fine: $ ffmpeg -f lavfi -i color=c=black:s=1920x1080:r=25/1 -vcodec rawvideo -pix_fmt yuv420p -f v4l2 /dev/video2 As an example, I feed a 1920x1080 black screen video into /dev/video2, and then open it in vlc. I'm trying to switch from one advertised resolution/framerate to a different one on the fly, preferably while other applications are consuming the v4l2loopback feed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |