Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (68)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

Sur d’autres sites (6562)

  • JavaFX MediaPlayer unable to play local m3u8 file

    3 mai 2017, par Lennart

    I want to show a live stream of a web cam in my JavaFX application using the MediaPlayer/MediaView. My attempt was to use ffmpeg to record a HLS and to play the resulting m3u8 file, but that throws the following exception (VLC plays the video without problems) :

    MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!
       at javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146)
       at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:511)
       at javafx.scene.media.MediaPlayer.<init>(MediaPlayer.java:414)
       at de.fraunhofer.iosb.ias.flow.assessment.management.monitor.MonitorViewController.testStream(MonitorViewController.java:203)
       ... 58 more
    Caused by: com.sun.media.jfxmedia.MediaException: Could not create player!
       at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:274)
       at com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:118)
       at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:467)
       ... 60 more
    </init>

    I debugged the player creation and the error occurs inside the constructor of GSTMediaPlayer when GSTMediaPlayer.gstInitPlayer() is called. This native method returns the error code 257, which javafx maps to MediaError.ERROR_MEDIA_NULL.

    I used the following ffmpeg command to record the video :

    ffmpeg -hide_banner -y -rtbufsize 250MB -f dshow -pixel_format yuv420p -video_size 960x720 -i video="Logitech HD Pro Webcam C920" -c:v libx264 -crf 20 -pix_fmt yuv420p out.m3u8

    I’m pretty sure that the encoding matches the requirements of javafx, because if I change the output container from m3u8 to mp4, the video is played without problems using the exact same ffmpeg command.

    This is the output of ffprobe for the m3u8 file :

    Input #0, hls,applehttp, from 'out.m3u8':
     Duration: 00:00:24.23, start: 1.466667, bitrate: 0 kb/s
     Program 0
       Metadata:
         variant_bitrate : 0
       Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 960x720, 30 fps, 30 tbr, 90k tbn, 60 tbc

    And for the mp4 file :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.41.100
     Duration: 00:01:04.93, start: 0.000000, bitrate: 1676 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x720, 1673 kb/s, 30 fps, 30 tbr, 10000k tbn, 60 tbc (default)
       Metadata:
         handler_name    : VideoHandler

    The resulting m3u8 file looks like this :

    #EXTM3U
    #EXT-X-VERSION:3
    #EXT-X-TARGETDURATION:9
    #EXT-X-MEDIA-SEQUENCE:0
    #EXTINF:8.333322,
    out0.ts
    #EXTINF:8.333333,
    out1.ts
    #EXTINF:7.133322,
    out2.ts
    #EXTINF:0.433333,
    out3.ts
    #EXT-X-ENDLIST

    Update : After I found this reference m3u file, I think that the problem is that the file is stored locally and isn’t delivered via HTTP. The video plays fine with this :

    Media media = new Media("http://download.oracle.com/otndocs/products/javafx/JavaRap/prog_index.m3u8");
    MediaPlayer player = new MediaPlayer(media);
    player.setAutoPlay(true);
    mediaView.setMediaPlayer(player);

    But after I downloaded the reference m3u and all of its segments and tried to open the local file like this, the error occurred again :

    File video = new File("H://Projects//Tools//ref//prog_index.m3u8");
    Media media = new Media(video.toURI().toString());
    MediaPlayer player = new MediaPlayer(media);
    player.setAutoPlay(true);
    mediaView.setMediaPlayer(player);

    I tried to change my m3u file so that the segements are referenced with absolute paths. I tried different notations (H:\f\out0.ts, H:/f/out0.ts, H://f//out0.ts, file:/H:/f/out0.ts, file:///H:/f/out0.ts), but I couldn’t get it to work.

  • How to stream H.264 bitstream to browser

    21 janvier 2019, par BobtheMagicMoose

    This is a followup to https://raspberrypi.stackexchange.com/questions/93254/stream-usb-webcam-with-audio?noredirect=1#comment150507_93254

    I, like many other brave tinkerers before me, thought it would be a simple task to take an old USB camera (c920) can pair it with a raspberry pi to make a network streaming device (e.g., baby monitor). As those that have gone before me, I have now realized (after two days of tearing my hair out), that this is an extremely complicated task.

    Problem statement : I have a raspberry pi zero and a c920 webcam. I want to use the H.264 bitstream from the webcam and serve it on the pi without transcoding it (the feeble processor would really struggle). I want to combine the video stream with its audio and send it over to a browser (phone, tablet, pc - something HTML5 without NAPI).

    My current strategy is to do the following :

    ffmpeg -re -f s16le -i /dev/zero -f v4l2 -thread_queue_size 512 -codec:v h264 -s 1920x1080 -i /dev/video0 -codec:v copy -acodec aac -ab 128k -g 50 http://localhost:8090/camera.ffm (this is with dummy audio - I figured I would add audio later)

    Followed by sudo ffserver -d -f /etc/ffserver.conf to received the feed and broadcast it as a stream. This is the ffserver.conf file :

    `HTTPPort 8090
    HTTPBindAddress 0.0.0.0
    MaxHTTPConnections 2000
    MaxClients 1000
    MaxBandwidth 100000
    CustomLog -
    <feed>
     File /tmp/streamwebm.ffm
     FileMaxSize 50M
     ACL allow localhost
     ACL allow 128.199.149.46
     #ACL allow 127.0.0.1
     ACL allow 192.168.0.0 192.168.0.255
    </feed>
    <stream stream="stream">
    Format webm

    # Video Settings
    VideoFrameRate 30
    VideoSize 1920x1080

    # Audio settings
    AudioCodec libvorbis
    AudioSampleRate 48000
    AVOptionAudio flags +global_header

    MaxTime 0
    AVOptionVideo me_range 16
    AVOptionVideo qdiff 4
    AVOptionVideo qmin 4
    AVOptionVideo qmax 40
    #AVOptionVideo good
    AVOptionVideo flags +global_header

    # Streaming settings
    PreRoll 10
    StartSendOnKey

    Metadata author "author"
    Metadata copyright "copyright"
    Metadata title "Web app name"
    Metadata comment "comment"
    </stream>

    My basic html is<video>  <source src="http://localhost:8090/stream"> </source></video>

    The stream however, doesn’t work (the browser won’t connect) and I get the following :
    enter image description here

    And the browser on the client says (failed) NET::ERR_CONNECTION_REFUSED

    Thoughts :
    - Begin stream simple mp4 with ffserver explains that ffserver can’t stream .mp4 because of headers or something. This is why I am using webm (which doesn’t support h.264 I believe and is causing the really slow performance converting to vp9). I’m not concerned about CPU usage at the moment, just want to get an image to appear on the browser !

    • I hear one issue deals with ’chunking’ - that the camera h.264 is a bitstream but h.264 streams for html5 should be chunked. Not sure how that would work.

    • I have tried VLC for some things (RTP) but haven’t have success.

    • Most resources (SE and other sites) are from 2010-2015 and it seems as thought v4l2 and other things have developed since then.

    • As my problem is most likely general ignorance of the subject matter, I would appreciate any answers that provide some general understanding as to the theory behind different techniques. I know this makes the question more of a call for opinion and less appropriate for SE, but I’m fixing to throw my computer out the window (you know the feeling).

    Thank you !

  • ffmpeg audio - video sync issue (audio ahead of video) - while screen recording using x11grab

    12 juillet 2023, par maheshg

    While screen-recording using the below ffmpeg options I consistently get audio ahead of video, delay is in the order of few seconds

    &#xA;

    ffmpeg cmd :

    &#xA;

    ffmpeg -y -f x11grab -thread_queue_size 1024 -draw_mouse 0 -video_size 1920x1080 -i :0 -f pulse -thread_queue_size 1024 -i default -c:v libx264 -threads 0 -preset faster -c:a flac -async 1 -vsync 1 -crf 30 -crf_max 33 -f matroska output.mkv

    &#xA;

    ffprobe output below :

    &#xA;

    $ ffprobe demo.mkv &#xA;ffprobe version 3.4.4-1~16.04.york0 Copyright (c) 2007-2018 the FFmpeg developers&#xA;  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609&#xA;  configuration: --prefix=/usr --extra-version=&#x27;1~16.04.york0&#x27; --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared&#xA;  libavutil      55. 78.100 / 55. 78.100&#xA;  libavcodec     57.107.100 / 57.107.100&#xA;  libavformat    57. 83.100 / 57. 83.100&#xA;  libavdevice    57. 10.100 / 57. 10.100&#xA;  libavfilter     6.107.100 /  6.107.100&#xA;  libavresample   3.  7.  0 /  3.  7.  0&#xA;  libswscale      4.  8.100 /  4.  8.100&#xA;  libswresample   2.  9.100 /  2.  9.100&#xA;  libpostproc    54.  7.100 / 54.  7.100&#xA;Input #0, matroska,webm, from &#x27;demo.mkv&#x27;:&#xA;  Metadata:&#xA;    ENCODER         : Lavf57.71.100&#xA;  Duration: 01:00:31.93, start: 0.000000, bitrate: 416 kb/s&#xA;    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)&#xA;    Metadata:&#xA;      ENCODER         : Lavc57.89.100 libx264&#xA;      DURATION        : 01:00:31.928000000&#xA;    Stream #0:1: Audio: flac, 48000 Hz, stereo, s16 (default)&#xA;    Metadata:&#xA;      ENCODER         : Lavc57.89.100 flac&#xA;      DURATION        : 01:00:30.912000000&#xA;

    &#xA;

    I have even tried using avoid_negative_ts flag, but it didnt help with the sync issue.

    &#xA;

    &#xA;

    OS : Ubuntu-18.04

    &#xA;

    ffmpeg version : 3.4

    &#xA;

    &#xA;

    Update : (with ffmpeg-4.0)&#xA;I have since split this process into 2 parts and tried as shown below (quality is better, but audio/video sync is still an issue)

    &#xA;

    # STEP-1: screen recording&#xA;/usr/bin/ffmpeg -y -f x11grab -thread_queue_size 1024 -draw_mouse 0 \&#xA;-video_size 1920x1080 -i :91141925 -f pulse -thread_queue_size 1024 \&#xA;-i virtual_sink.monitor -c:v libx264rgb -threads 0 -preset ultrafast \&#xA;-c:a flac -ac 1 -crf 0 -f matroska output.mkv&#xA;&#xA;# STEP-2: audio/video encoding&#xA;/usr/bin/ffmpeg -y -i output.mkv -c:v libx264 -threads 0 \&#xA;-preset faster -pix_fmt yuv420p -c:a copy -ac 1 -crf 25 \&#xA;-f matroska final_output.mkv&#xA;

    &#xA;

    STEP-1 uses much less CPU during screen recording, but audio is still ahead of video. the display I am using is xvfb one in STEP-1 (since, this is a headless machine in the cloud)

    &#xA;

    Also, i have tried flags -filter_complex aresample=44100 -vsync 1 in STEP-1 to no avail.

    &#xA;

    Can someone please help !

    &#xA;

    &#xA;

    Update 2 : (with latest ffmpeg from git master)

    &#xA;

    IT WORKED ! THANKS @llogan for the helpful comments.

    &#xA;

    &#xA;