Recherche avancée

Médias (91)

Sur d’autres sites (330)

  • Stream map 'data-re' matches no streams

    15 septembre 2023, par DreamSky007

    C :\Users\pengp>ffmpeg -ss 5 -i Flight.mpg -map data-re -codec copy -f data - > out.klv
ffmpeg version 2023-09-07-git-9c9f48e7f2-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
configuration : —enable-gpl —enable-version3 —enable-static —disable-w32threads —disable-autodetect —enable-fontconfig —enable-iconv —enable-gnutls —enable-libxml2 —enable-gmp —enable-bzlib —enable-lzma —enable-libsnappy —enable-zlib —enable-librist —enable-libsrt —enable-libssh —enable-libzmq —enable-avisynth —enable-libbluray —enable-libcaca —enable-sdl2 —enable-libaribb24 —enable-libaribcaption —enable-libdav1d —enable-libdavs2 —enable-libuavs3d —enable-libzvbi —enable-librav1e —enable-libsvtav1 —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxavs2 —enable-libxvid —enable-libaom —enable-libjxl —enable-libopenjpeg —enable-libvpx —enable-mediafoundation —enable-libass —enable-frei0r —enable-libfreetype —enable-libfribidi —enable-libharfbuzz —enable-liblensfun —enable-libvidstab —enable-libvmaf —enable-libzimg —enable-amf —enable-cuda-llvm —enable-cuvid —enable-ffnvcodec —enable-nvdec —enable-nvenc —enable-dxva2 —enable-d3d11va —enable-libvpl —enable-libshaderc —enable-vulkan —enable-libplacebo —enable-opencl —enable-libcdio —enable-libgme —enable-libmodplug —enable-libopenmpt —enable-libopencore-amrwb —enable-libmp3lame —enable-libshine —enable-libtheora —enable-libtwolame —enable-libvo-amrwbenc —enable-libcodec2 —enable-libilbc —enable-libgsm —enable-libopencore-amrnb —enable-libopus —enable-libspeex —enable-libvorbis —enable-ladspa —enable-libbs2b —enable-libflite —enable-libmysofa —enable-librubberband —enable-libsoxr —enable-chromaprint
libavutil 58. 19.100 / 58. 19.100
libavcodec 60. 26.100 / 60. 26.100
libavformat 60. 11.100 / 60. 11.100
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100
[in#0 @ 0000029d9a2cfc40] Error opening input : No such file or directory
Error opening input file Flight.mpg.
Error opening input files : No such file or directory

    


    C :\Users\pengp>ffmpeg -ss 5 -i C :\Users\pengp\Desktop\Flight.mpg -map data-re -codec copy -f data - > out.klv
ffmpeg version 2023-09-07-git-9c9f48e7f2-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
configuration : —enable-gpl —enable-version3 —enable-static —disable-w32threads —disable-autodetect —enable-fontconfig —enable-iconv —enable-gnutls —enable-libxml2 —enable-gmp —enable-bzlib —enable-lzma —enable-libsnappy —enable-zlib —enable-librist —enable-libsrt —enable-libssh —enable-libzmq —enable-avisynth —enable-libbluray —enable-libcaca —enable-sdl2 —enable-libaribb24 —enable-libaribcaption —enable-libdav1d —enable-libdavs2 —enable-libuavs3d —enable-libzvbi —enable-librav1e —enable-libsvtav1 —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxavs2 —enable-libxvid —enable-libaom —enable-libjxl —enable-libopenjpeg —enable-libvpx —enable-mediafoundation —enable-libass —enable-frei0r —enable-libfreetype —enable-libfribidi —enable-libharfbuzz —enable-liblensfun —enable-libvidstab —enable-libvmaf —enable-libzimg —enable-amf —enable-cuda-llvm —enable-cuvid —enable-ffnvcodec —enable-nvdec —enable-nvenc —enable-dxva2 —enable-d3d11va —enable-libvpl —enable-libshaderc —enable-vulkan —enable-libplacebo —enable-opencl —enable-libcdio —enable-libgme —enable-libmodplug —enable-libopenmpt —enable-libopencore-amrwb —enable-libmp3lame —enable-libshine —enable-libtheora —enable-libtwolame —enable-libvo-amrwbenc —enable-libcodec2 —enable-libilbc —enable-libgsm —enable-libopencore-amrnb —enable-libopus —enable-libspeex —enable-libvorbis —enable-ladspa —enable-libbs2b —enable-libflite —enable-libmysofa —enable-librubberband —enable-libsoxr —enable-chromaprint
libavutil 58. 19.100 / 58. 19.100
libavcodec 60. 26.100 / 60. 26.100
libavformat 60. 11.100 / 60. 11.100
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100
[mpegts @ 00000242148b8380] start time for stream 1 is not set in estimate_timings_from_pts
Input #0, mpegts, from 'C :\Users\pengp\Desktop\Flight.mpg' :
Duration : 00:03:14.88, start : 10.000000, bitrate : 4187 kb/s
Program 1
Stream #0:0[0x1e1] : Video : h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720, 60 fps, 60 tbr, 90k tbn
Stream #0:1[0x1f1] : Data : klv (KLVA / 0x41564C4B)
[mpegts @ 00000242148b8380] Invalid stream specifier : data-re.
Last message repeated 3 times
Stream map 'data-re' matches no streams.
To ignore this, add a trailing ' ?' to the map.
Failed to set value 'data-re' for option 'map' : Invalid argument
Error parsing options for output file -.
Error opening output files : Invalid argument

    


    Want to use ffmpeg klv to parse klv data display?

    


  • FFmpeg conform DASH to YouTube Live Stream requirements

    4 septembre 2023, par Aniol Pagès

    I'm trying to stream to YouTube using FFmpeg and DASH. I've generated the stream key and I'm successfully sending the generated files to YouTube. However, YouTube refuses the MPD manifest because it has two AdaptationSet (one for video and one for audio), and the documentation specifies that I should use only one for both video and audio

    


    I've tried to use the -adaptation_sets flag unsuccessfully, and also the -map flag.

    


    Here is one of the commands I've tried :
ffmpeg -re -i "/Users/user/Desktop/file.mp4" \        -map 0:v -map 0:a \        -use_template 1 -use_timeline 1 -window_size 5 -min_seg_duration 5000000 \        -f dash dash.mpd

    


    And with the -adaptation_sets flag :
ffmpeg -re -i "/Users/aniolpages/Desktop/2023-09-03 Taller colar filtrar assubtilar.mp4" -map 0 -map 0 -c:a aac -c:v libx264 \ -use_timeline 1 -use_template 1 \ -window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" \ -f dash dash.mpd

    


    Has someone been successful to conform the manifest to YouTube requirements ?

    


    Thank you very much !

    


  • MoviePy error : failed to read the first frame of video file... That may also mean that you are using a deprecated version of FFMPEG

    30 août 2023, par Alister Kwapisz

    When I run a python telegram bot script locally, it works completely fine but when I run the script on PythonAnywhere I get an error that shows up when I try to generate a video :

    


    "2023-08-29 15:21:53,138 (__init__.py:960 MainThread) ERROR - TeleBot: "Infinity polling exception: MoviePy error: failed to read the first frame of video file /home/AlisterK/video_clips/Video 2023-01-10 &#xA;18 45 07.mp4. That might mean that the file is corrupted. That may also mean that you are using a deprecated version of FFMPEG. On Ubuntu/Debian for instance the version in the repos is deprecated. Pleas&#xA;e update to a recent version from the website."&#xA;2023-08-29 15:21:53,138 (__init__.py:962 MainThread) ERROR - TeleBot: "Exception traceback:&#xA;Traceback (most recent call last):&#xA;  File "/home/AlisterK/.local/lib/python3.10/site-packages/telebot/__init__.py", line 955, in infinity_polling&#xA;    self.polling(non_stop=True, timeout=timeout, long_polling_timeout=long_polling_timeout,&#xA;  File "/home/AlisterK/.local/lib/python3.10/site-packages/telebot/__init__.py", line 1043, in polling&#xA;    self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout,&#xA;  File "/home/AlisterK/.local/lib/python3.10/site-packages/telebot/__init__.py", line 1118, in __threaded_polling&#xA;    raise e&#xA;  File "/home/AlisterK/.local/lib/python3.10/site-packages/telebot/__init__.py", line 1074, in __threaded_polling&#xA;    self.worker_pool.raise_exceptions()&#xA;  File "/home/AlisterK/.local/lib/python3.10/site-packages/telebot/util.py", line 147, in raise_exceptions&#xA;    raise self.exception_info&#xA;  File "/home/AlisterK/.local/lib/python3.10/site-packages/telebot/util.py", line 90, in run&#xA;    task(*args, **kwargs)&#xA;  File "/home/AlisterK/.local/lib/python3.10/site-packages/telebot/__init__.py", line 6788, in _run_middlewares_and_handler&#xA;    result = handler[&#x27;function&#x27;](message)&#xA;  File "/home/AlisterK/Video generator.py", line 34, in generate_video_command&#xA;    generated_video = generate_video(audio_files[user_id])&#xA;  File "/home/AlisterK/Video generator.py", line 72, in generate_video&#xA;    clips = [VideoFileClip(os.path.join(input_folder, clip_file)).subclip(0, clip_duration) for clip_file in video_clips]&#xA;  File "/home/AlisterK/Video generator.py", line 72, in <listcomp>&#xA;    clips = [VideoFileClip(os.path.join(input_folder, clip_file)).subclip(0, clip_duration) for clip_file in video_clips]&#xA;  File "/home/AlisterK/.local/lib/python3.10/site-packages/moviepy/video/io/VideoFileClip.py", line 88, in __init__&#xA;    self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt,&#xA;  File "/home/AlisterK/.local/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_reader.py", line 73, in __init__&#xA;    self.lastread = self.read_frame()&#xA;  File "/home/AlisterK/.local/lib/python3.10/site-packages/moviepy/video/io/ffmpeg_reader.py", line 133, in read_frame&#xA;    raise IOError(("MoviePy error: failed to read the first frame of "&#xA;OSError: MoviePy error: failed to read the first frame of video file /home/AlisterK/video_clips/Video 2023-01-10 18 45 07.mp4. That might mean that the file is corrupted. That may also mean that you are using a deprecated version of FFMPEG. On Ubuntu/Debian for instance the version in the repos is deprecated. Please update to a recent version from the website."&#xA;</listcomp>

    &#xA;

    I tried updating ffmpeg and moviepy. I even tried different versions but to no avail. The video clips are not corrupted as I checked.

    &#xA;

    This part of the code is responsible for generating the videos :

    &#xA;

    def generate_video(audio_path):&#xA;    input_folder = &#x27;/home/AlisterK/video_clips&#x27;  # Replace with your folder path&#xA;    output_file = &#x27;/home/AlisterK/output_combined_video.mp4&#x27;&#xA;    clip_duration = 3  # Duration of each clip in seconds&#xA;    num_clips = 10     # Number of video clips to select and combine&#xA;&#xA;    width = 1080  # Replace with your desired width&#xA;    height = 1920  # Replace with your desired height&#xA;&#xA;    video_clips = random_files_in_folder(input_folder, &#x27;.mp4&#x27;, num_clips)&#xA;&#xA;    clips = [VideoFileClip(os.path.join(input_folder, clip_file)).subclip(0, clip_duration) for clip_file in video_clips]&#xA;    standardized_clips = [clip.resize((width, height)) for clip in clips]  # Ensure consistent resolutions&#xA;&#xA;    final_clip = concatenate_videoclips(standardized_clips)&#xA;&#xA;    final_audio = AudioFileClip(audio_path)&#xA;

    &#xA;