Recherche avancée

Médias (0)

Mot : - Tags -/tags

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (68)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (6854)

  • Everytime I run my code ffmpeg responds with this instead of doing its function. How do I fix ?

    25 juillet 2023, par Oreo F
    Output from ffmpeg/avlib:

ffmpeg version 2023-07-19-git-efa6cec759-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-d3d11va --enable-dxva2 --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. 14.100 / 58. 14.100
  libavcodec     60. 22.100 / 60. 22.100
  libavformat    60. 10.100 / 60. 10.100
  libavdevice    60.  2.101 / 60.  2.101
  libavfilter     9.  8.102 /  9.  8.102
  libswscale      7.  3.100 /  7.  3.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100


    


    Everytime I run the code it does this.

    


    code :

    


    import praw
import requests
import cv2
import os
from pydub import AudioSegment

def download_video(url, filename):
    response = requests.get(url)
    with open(filename, 'wb') as f:
        f.write(response.content)

def combine_videos(video_urls, output_filename):
    video_clips = []
    audio_clips = []
    for i, url in enumerate(video_urls):
        temp_filename = f'temp_video_{i}.mp4'
        download_video(url, temp_filename)
        video_clip = cv2.VideoCapture(temp_filename)
        audio_clip = AudioSegment.from_file(temp_filename, format="mp4")
        video_clips.append(video_clip)
        audio_clips.append(audio_clip)
    
    if not video_clips:
        print("No video clips to combine.")
        return

    frame_width = int(video_clips[0].get(cv2.CAP_PROP_FRAME_WIDTH))
    frame_height = int(video_clips[0].get(cv2.CAP_PROP_FRAME_HEIGHT))
    fps = int(video_clips[0].get(cv2.CAP_PROP_FPS))

    fourcc = cv2.VideoWriter_fourcc(*'mp4v')
    output_clip = cv2.VideoWriter(output_filename, fourcc, fps, (frame_width, frame_height))

    for i, video_clip in enumerate(video_clips):
        while True:
            ret, frame = video_clip.read()
            if not ret:
                break
            output_clip.write(frame)
    
    for video_clip in video_clips:
        video_clip.release()
    
    output_clip.release()

    # Combining audio using pydub
    combined_audio = sum(audio_clips)
    combined_audio.export("combined_audio.mp3", format="mp3")

    # Merging audio with video using ffmpeg
    os.system(f'ffmpeg -i {output_filename} -i combined_audio.mp3 -c:v copy -c:a aac -strict experimental -map 0:v:0 -map 1:a:0 final_output.mp4')

    # Cleaning up temporary files
    os.remove("combined_audio.mp3")

def main():
    reddit = praw.Reddit(
       client_id='XXX',
        client_secret='XXX',
        user_agent='Reddit Video Downloader'
    )
    
    subreddit_name = input("Enter the name of the subreddit: ")
    limit = int(input("Enter the number of videos to download: "))
    
    subreddit = reddit.subreddit(subreddit_name)
    submissions = subreddit.hot(limit=limit)
    
    video_urls = [submission.url for submission in submissions if submission.media and 'reddit_video' in submission.media]
    
    if video_urls:
        output_filename = input("Enter the output filename (e.g., output.mp4): ")
        combine_videos(video_urls, output_filename)
        print("Videos combined successfully!")
    else:
        print("No Reddit videos found in the subreddit.")

if __name__ == "__main__":
    main()


    


    Anyone got any idea why this happens ?

    


    I'm making a script that scrapes videos from a specific subreddit.

    


    Also if it helps the temp video file is corrupted when it gets made.

    


    I've put this into chatGPT as well and brought an expert friend and he hasn't been able to help me.

    


  • AVCodec h264_v4l2m2m hardware decoding unable to find device

    26 juillet 2023, par nathansizemore

    Using a custom compiled FFmpeg :

    


     $ ./ffmpeg -codecs | grep h264
ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
  configuration: --arch=aarch64 --enable-cross-compile --target-os=linux --cross-prefix=aarch64-linux-gnu- --prefix=/builds/dronesense/rust/ffmpeg-build/ffmpeg/out --pkgconfigdir= --pkg-config=pkg-config --extra-libs='-ldl -lpthread' --enable-libvpx --enable-libx264 --enable-libx265 --enable-decklink --enable-gpl --enable-nonfree --enable-shared --disable-static
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m ) (encoders: libx264 libx264rgb h264_v4l2m2m )


    


    /dev/video32 seems to have H.264 decoding support :

    


    $ v4l2-ctl --list-formats-out -d /dev/video32
ioctl: VIDIOC_ENUM_FMT
    Index       : 0
    Type        : Video Output Multiplanar
    Pixel Format: 'MPG2' (compressed)
    Name        : MPEG-2 ES

    Index       : 1
    Type        : Video Output Multiplanar
    Pixel Format: 'H264' (compressed)
    Name        : H.264

    Index       : 2
    Type        : Video Output Multiplanar
    Pixel Format: 'HEVC' (compressed)
    Name        : HEVC

    Index       : 3
    Type        : Video Output Multiplanar
    Pixel Format: 'VP80' (compressed)
    Name        : VP8

    Index       : 4
    Type        : Video Output Multiplanar
    Pixel Format: 'VP90' (compressed)
    Name        : VP9


    


    I've tried two approaches (Rust with bindgen) :

    


    Approach 1 :

    


    fn init_decoder() -> Arc<contextwrapper> {&#xA;    let name = CString::new("h264_v4l2m2m").unwrap();&#xA;    let codec = unsafe { ffmpeg::avcodec_find_decoder_by_name(name.as_ptr()) };&#xA;    if codec.is_null() {&#xA;        error!("finding codec");&#xA;        process::exit(1);&#xA;    }&#xA;&#xA;    let ctx = unsafe { ffmpeg::avcodec_alloc_context3(codec) };&#xA;    if ctx.is_null() {&#xA;        error!("creating context");&#xA;        process::exit(1);&#xA;    }&#xA;&#xA;    let r = unsafe { ffmpeg::avcodec_open2(ctx, codec, ptr::null_mut()) };&#xA;    if r &lt; 0 {&#xA;        error!("opening codec: {r}");&#xA;        process::exit(1);&#xA;    }&#xA;&#xA;    Arc::new(ContextWrapper(ctx))&#xA;}&#xA;</contextwrapper>

    &#xA;

    Results in :

    &#xA;

    [h264_v4l2m2m @ 0x7f1c001600] Could not find a valid device&#xA;[h264_v4l2m2m @ 0x7f1c001600] can&#x27;t configure decoder&#xA;[ERROR] [decoder] [webrtc::codec] opening codec: -1&#xA;

    &#xA;

    Approach 2

    &#xA;

    fn init_decoder() -> Arc<contextwrapper> {&#xA;    let name = CString::new("h264_v4l2m2m").unwrap();&#xA;    let codec = unsafe { ffmpeg::avcodec_find_decoder_by_name(name.as_ptr()) };&#xA;    if codec.is_null() {&#xA;        error!("finding codec");&#xA;        process::exit(1);&#xA;    }&#xA;&#xA;    let mut i = 0;&#xA;    let mut hw_pix_fmt: AVPixelFormat = unsafe { mem::zeroed() };&#xA;    loop {&#xA;        let config = unsafe { ffmpeg::avcodec_get_hw_config(codec, i) };&#xA;        if config.is_null() {&#xA;            error!("decoder not supported");&#xA;            process::exit(1);&#xA;        }&#xA;&#xA;        unsafe {&#xA;            info!("device type: {:?}", (*config).device_type);&#xA;            if ((*config).methods &amp; ffmpeg::AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX as i32) > 0 {&#xA;                hw_pix_fmt = (*config).pix_fmt;&#xA;                break;&#xA;            }&#xA;        }&#xA;    }&#xA;&#xA;    info!("pixel format: {:?}", hw_pix_fmt);&#xA;&#xA;    let ctx = unsafe { ffmpeg::avcodec_alloc_context3(codec) };&#xA;    if ctx.is_null() {&#xA;        error!("creating context");&#xA;        process::exit(1);&#xA;    }&#xA;&#xA;    let r = unsafe { ffmpeg::avcodec_open2(ctx, codec, ptr::null_mut()) };&#xA;    if r &lt; 0 {&#xA;        error!("opening codec: {r}");&#xA;        process::exit(1);&#xA;    }&#xA;&#xA;    Arc::new(ContextWrapper(ctx))&#xA;}&#xA;&#xA;</contextwrapper>

    &#xA;

    Results in :&#xA;error!("decoder not supported");

    &#xA;

    I feel like there is a major step missing because looking at FFmpeg's Hardware Decode Example there are looking for a device type, to which v4l2 is not a part of the enum, so I do not what functions to call to get it setup.

    &#xA;

    What is the proper way to setup an AVCodec decoder with H.264 hardware acceleration for v4l2m2m ?

    &#xA;

  • MP4 to HLS conversion error after resizing video using FFmpeg

    26 juillet 2023, par ITeptIcklyTa

    When trying to create HLS stream from original video, FFmpeg creates HLS stream without errors.

    &#xA;

    ~ $ ffmpeg -i test.mp4 -f hls -hls_time 3 -hls_segment_filename seg%02d.ts stream.m3u8&#xA;

    &#xA;

    But when I resize video using this command, I get a timestamps warning :

    &#xA;

    ~ $ ffmpeg -i test.mp4 -vf scale=426:240 test_240p.mp4&#xA;[mp4 @ 0xb400007429e52d00] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly&#xA;[mp4 @ 0xb400007429e52d00] Encoder did not produce proper pts, making some up.&#xA;

    &#xA;

    And when creating HLS stream from resized video, I'm getting an error :

    &#xA;

    ~ $ ffmpeg -i test_240p.mp4 -f hls -hls_time 3 -hls_segment_filename seg%02d.ts stream.m3u8                     ffmpeg version N-111626-g0ba719f726 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with clang version 16.0.6&#xA;  configuration: --arch=aarch64 --as=aarch64-linux-android-clang --cc=aarch64-linux-android-clang --cxx=aarch64-linux-android-clang&#x2B;&#x2B; --nm=llvm-nm --pkg-config=/data/data/com.termux/files/usr/bin/pkg-config --strip=llvm-strip --cross-prefix=aarch64-linux-android- --disable-indevs --disable-outdevs --enable-indev=lavfi --disable-static --disable-symver --enable-cross-compile --enable-gnutls --enable-gpl --enable-jni --enable-lcms2 --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgme --enable-libmp3lame --enable-libopus --enable-librav1e --enable-libsoxr --enable-libsrt --enable-libssh --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-mediacodec --enable-opencl --enable-shared --prefix=/data/data/com.termux/files/usr --target-os=android --extra-libs=-landroid-glob --disable-vulkan --enable-neon --disable-libfdk-aac                                                      libavutil      58. 14.100 / 58. 14.100                  libavcodec     60. 22.100 / 60. 22.100&#xA;  libavformat    60. 10.100 / 60. 10.100                  libavdevice    60.  2.101 / 60.  2.101&#xA;  libavfilter     9. 10.100 /  9. 10.100&#xA;  libswscale      7.  3.100 /  7.  3.100&#xA;  libswresample   4. 11.100 /  4. 11.100&#xA;  libpostproc    57.  2.100 / 57.  2.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;test_240p.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf60.10.100&#xA;  Duration: 00:00:10.01, start: 0.000000, bitrate: 178 kb/s&#xA;  Stream #0:0[0x1](und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/smpte170m, progressive), 426x240, 44 kb/s, SAR 640:639 DAR 16:9, 25 fps, 25 tbr, 12800 tbn (default)&#xA;    Metadata:&#xA;      handler_name    : ISO Media file produced by Google Inc. Created on: 02/24/2023.&#xA;      vendor_id       : [0][0][0][0]&#xA;      encoder         : Lavc60.22.100 h264_mediacodec&#xA;  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)&#xA;    Metadata:&#xA;      handler_name    : ISO Media file produced by Google Inc. Created on: 02/24/2023.&#xA;      vendor_id       : [0][0][0][0]&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_mediacodec))&#xA;  Stream #0:1 -> #0:1 (aac (native) -> aac (native))&#xA;Press [q] to stop, [?] for help&#xA;[h264_mediacodec @ 0xb400007da1f2ac00] Use 1 as the default MediaFormat i-frame-interval, please set gop_size properly (>= fps)&#xA;[h264_mediacodec @ 0xb400007da1f2ac00] Mediacodec encoder doesn&#x27;t support AV_CODEC_FLAG_GLOBAL_HEADER. Use extract_extradata bsf when necessary.&#xA;Output #0, hls, to &#x27;stream.m3u8&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf60.10.100&#xA;  Stream #0:0(und): Video: h264, yuv420p(tv, bt709/bt709/smpte170m, progressive), 426x240 [SAR 640:639 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 90k tbn (default)&#xA;    Metadata:&#xA;      handler_name    : ISO Media file produced by Google Inc. Created on: 02/24/2023.&#xA;      vendor_id       : [0][0][0][0]&#xA;      encoder         : Lavc60.22.100 h264_mediacodec&#xA;  Stream #0:1(und): Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s (default)&#xA;    Metadata:&#xA;      handler_name    : ISO Media file produced by Google Inc. Created on: 02/24/2023.&#xA;      vendor_id       : [0][0][0][0]&#xA;      encoder         : Lavc60.22.100 aac&#xA;frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.25 bitr[hls @ 0xb400007da1f27d00] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly&#xA;[hls @ 0xb400007da1f27d00] Encoder did not produce proper pts, making some up.&#xA;[mpegts @ 0xb400007da1f29100] H.264 bitstream error, startcode missing, size 0&#xA;[hls @ 0xb400007da1f27d00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 3600 >= 3600&#xA;[vost#0:0/h264_mediacodec @ 0xb400007da200a000] Error submitting a packet to the muxer: Invalid argument&#xA;[out#0/hls @ 0xb400007da1eaa6c0] Error muxing a packet&#xA;[hls @ 0xb400007da1f27d00] Opening &#x27;seg00.ts&#x27; for writing&#xA;[hls @ 0xb400007da1f27d00] Opening &#x27;stream.m3u8.tmp&#x27; for writing&#xA;[out#0/hls @ 0xb400007da1eaa6c0] video:2kB audio:5kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown&#xA;frame=    3 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.41 bitrate=N/A speed=3.39x&#xA;[aac @ 0xb400007da2051400] Qavg: 32468.840&#xA;Conversion failed!&#xA;~ $&#xA;

    &#xA;

    I tried to build FFmpeg from GitHub and install FFmpeg from repositories, and I'm still getting this error.

    &#xA;