Recherche avancée

Médias (0)

Mot : - Tags -/médias

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

Autres articles (48)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

Sur d’autres sites (6553)

  • ffserver : translate cropped video

    26 janvier 2021, par Michael O.

    I'm getting the h264 video from IP camera. I need to crop it and retranslate with ffserver. Here is the command ffmpeg to get a stream :

    


    ffmpeg -rtsp_transport tcp -i "rtsp://admin:@192.168.88.10:554/channel=1&stream=0.sdp" -filter:v "crop=400:250:800:1045" -vcodec h264 tmp.mp4


    


    It works fine and I get the cropped video in the file tmp.mp4.

    


    Here are the ffserver settings :

    


    <feed>&#xA;File /tmp/feed1.ffm&#xA;FileMaxSize 200M&#xA;Launch ffmpeg -rtsp_transport tcp -i "rtsp://admin:@192.168.88.10:554/channel=1&amp;stream=0.sdp" -filter:v "crop=400:250:800:1045" -vcodec h264&#xA;</feed>&#xA;<stream>&#xA;Feed feed1.ffm&#xA;Format mjpeg&#xA;VideoBitRate 1000&#xA;VideoBufferSize 400&#xA;VideoFrameRate 17&#xA;VideoSize 400x250&#xA;VideoGopSize 10&#xA;NoAudio&#xA;Preroll 5&#xA;NoDefaults&#xA;</stream>&#xA;

    &#xA;

    Trying to launch ffserver :

    &#xA;

    $ ffserver -loglevel debug -d -f /etc/ffserver.conf&#xA;ffserver started on 2021-01-27 at 01:02:43&#xA;Report written to "ffserver-20210127-010243.log"&#xA;ffserver version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)&#xA;  configuration: --prefix=/usr --extra-version=0ubuntu0.2 --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;Wed Jan 27 01:02:43 2021 [NULL @ 0x55769974cbc0]Opening &#x27;/tmp/feed1.ffm&#x27; for reading&#xA;Wed Jan 27 01:02:43 2021 [file @ 0x557699755300]Setting default whitelist &#x27;file,crypto&#x27;&#xA;Wed Jan 27 01:02:43 2021 [ffm @ 0x55769974cbc0]Format ffm probed with size=2048 and score=101&#xA;Wed Jan 27 01:02:43 2021 [NULL @ 0x557699757320]Setting entry with key &#x27;b&#x27; to value &#x27;1000000&#x27;&#xA;Wed Jan 27 01:02:43 2021 [NULL @ 0x557699757320]Setting entry with key &#x27;bufsize&#x27; to value &#x27;3276800&#x27;&#xA;Wed Jan 27 01:02:43 2021 [NULL @ 0x557699757320]Setting entry with key &#x27;time_base&#x27; to value &#x27;1/17&#x27;&#xA;Wed Jan 27 01:02:43 2021 [NULL @ 0x557699757320]Setting entry with key &#x27;video_size&#x27; to value &#x27;400x250&#x27;&#xA;Wed Jan 27 01:02:43 2021 [NULL @ 0x557699757320]Setting entry with key &#x27;g&#x27; to value &#x27;10&#x27;&#xA;Wed Jan 27 01:02:43 2021 Codecs do not match for stream 0&#xA;Wed Jan 27 01:02:43 2021 [AVIOContext @ 0x55769974d7a0]Statistics: 4096 bytes read, 0 seeks&#xA;Wed Jan 27 01:02:43 2021 [file @ 0x5576997552e0]Setting default whitelist &#x27;file,crypto&#x27;&#xA;Wed Jan 27 01:02:43 2021 [ffm @ 0x55769974cbc0]Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.&#xA;Wed Jan 27 01:02:43 2021 writing recommended configuration: b=1000000,bufsize=3276800,time_base=1/17,video_size=400x250,g=10&#xA;Wed Jan 27 01:02:43 2021 [AVIOContext @ 0x557699757be0]Statistics: 0 seeks, 1 writeouts&#xA;Wed Jan 27 01:02:43 2021 FFserver started.&#xA;Wed Jan 27 01:02:43 2021 Launch command line: ./ffmpeg -rtsp_transport tcp -i rtsp://admin:@192.168.88.10:554/channel=1&amp;stream=0.sdp -filter:v crop=400:250:800:1045 -vcodec h264 http://127.0.0.1:8090/feed1.ffm &#xA;feed1.ffm: Pid 30808 exited with status 256 after 0 seconds&#xA;

    &#xA;

    There is the line :

    &#xA;

    Codecs do not match for stream 0&#xA;

    &#xA;

    every time when I try to launch it. I tried various video formats : mpjpeg, avi, mpeg, flv, mp4, webm, and the result is the same. How can I successfully launch ffserver ?

    &#xA;

  • How to schedule ffmpeg audio streams of varying lengths with titles and metadata ?

    10 septembre 2021, par underdoot

    I have a Shoutcast stream that I want to archive 24/7 with ffmpeg. Shows on this stream vary in length between 1-3 hours, but have a regular weekly schedule.

    &#xA;

    How do I download these shows, and give the files appropriate titles according to the show playing (determined by day of week and hour of day) ? I want the title of files to be along the lines of "2021.09.21 - 0300-0400 — Radio Show Name" and automatically add to a set folder. I also want to run the program only once, and have it running in the background constantly.

    &#xA;

  • FFMPEG Api conversion from YUV420P to RGB produces strange output

    20 novembre 2024, par fasc8

    I'm using the FFMPEG Api in Rust to get RGB images from video files.

    &#xA;

    While some videos work correct and I get the frames back as expected, some work not. Or at least the result is not the way I expected it to be.

    &#xA;

    The code I use in Rust :

    &#xA;

    ffmpeg::init().unwrap();&#xA;&#xA;let in_ctx = input(&amp;Path::new(source)).unwrap();&#xA;let input = in_ctx&#xA;    .streams()&#xA;    .best(Type::Video)&#xA;    .ok_or(ffmpeg::Error::StreamNotFound)?;&#xA;&#xA;let decoder = input.codec().decoder().video()?;&#xA;&#xA;let scaler = Context::get(&#xA;    decoder.format(),&#xA;    decoder.width(),&#xA;    decoder.height(),&#xA;    Pixel::RGB24,&#xA;    decoder.width(),&#xA;    decoder.height(),&#xA;    Flags::FULL_CHR_H_INT | Flags::ACCURATE_RND,&#xA;)?; // &lt;--- Is basically sws_getContext&#xA;&#xA;// later to get the actual frame&#xA;let mut decoded = Video::empty();&#xA;if self.decoder.receive_frame(&amp;mut decoded).is_ok() {&#xA;    let mut rgb_frame = Video::empty();&#xA;    self.scaler.run(&amp;decoded, &amp;mut rgb_frame)?; // &lt;--- Does sws_scale&#xA;    println!("Converted Pixel Format: {}", rgb_frame.format() as i32);&#xA;    Ok(Some(rgb_frame))&#xA;}&#xA;

    &#xA;

    Which should roughly translate to C like so :

    &#xA;

    // Get the context and video stream&#xA;SwsContext * ctx = sws_getContext(imgWidth, imgHeight,&#xA;                              imgFormat, imgWidth, imgHeight,&#xA;                              AV_PIX_FMT_RGB24, 0, 0, 0, 0);&#xA;sws_scale(ctx, decoded.data, decoded.linesize, 0, decoded.height, rgb_frame.data, rbg_frame.linesize);&#xA;

    &#xA;

    And like I said earlier, sometimes it works fine and I get the expected frame back. But sometimes I get something like this :&#xA;Weird result image

    &#xA;

    I saved the images as .ppm files for quick visual comparison. I used this method, which basically writes the bytes to a file with a simple .ppm header :

    &#xA;

    fn save_file(frame: &amp;Video, index: usize) -> std::result::Result&lt;(), std::io::Error> &#xA;{&#xA;    let mut file = File::create(format!("frame{}.ppm", index))?;&#xA;    file.write_all(format!("P6\n{} {}\n255\n", frame.width(), frame.height()).as_bytes())?;&#xA;    file.write_all(frame.data(0))?;&#xA;    Ok(())&#xA;}&#xA;

    &#xA;

    Here you can see that on the left side there is a good image result vs. on the right side there is a bad image result.&#xA;Comparison of the .ppm files

    &#xA;

    To come to the question now :

    &#xA;

    Why is this happening. I tested everything on my side and the only thing left is ffmpeg conversion. FFMPEG seems to convert these two test files differently even though it reports YUV420P as format for both. I cannot figure out what the difference may be...

    &#xA;

    Here the info for the two video files i used :

    &#xA;

    Good video file :

    &#xA;

    General&#xA;Complete name                            : /mnt/smb/Snapchat-174933781.mp4&#xA;Format                                   : MPEG-4&#xA;Format profile                           : Base Media / Version 2&#xA;Codec ID                                 : mp42 (isom/mp42)&#xA;File size                                : 1.90 MiB&#xA;Duration                                 : 9 s 612 ms&#xA;Overall bit rate                         : 1 661 kb/s&#xA;Encoded date                             : UTC 2021-07-28 22:09:36&#xA;Tagged date                              : UTC 2021-07-28 22:09:36&#xA;eng                                      : -180.00&#xA;&#xA;Video&#xA;ID                                       : 512&#xA;Format                                   : AVC&#xA;Format/Info                              : Advanced Video Codec&#xA;Format profile                           : High@L3.1&#xA;Format settings                          : CABAC / 1 Ref Frames&#xA;Format settings, CABAC                   : Yes&#xA;Format settings, Reference frames        : 1 frame&#xA;Format settings, GOP                     : M=1, N=30&#xA;Codec ID                                 : avc1&#xA;Codec ID/Info                            : Advanced Video Coding&#xA;Duration                                 : 9 s 598 ms&#xA;Bit rate                                 : 1 597 kb/s&#xA;Width                                    : 480 pixels&#xA;Height                                   : 944 pixels&#xA;Display aspect ratio                     : 0.508&#xA;Frame rate mode                          : Variable&#xA;Frame rate                               : 29.797 FPS&#xA;Minimum frame rate                       : 15.000 FPS&#xA;Maximum frame rate                       : 30.000 FPS&#xA;Color space                              : YUV&#xA;Chroma subsampling                       : 4:2:0&#xA;Bit depth                                : 8 bits&#xA;Scan type                                : Progressive&#xA;Bits/(Pixel*Frame)                       : 0.118&#xA;Stream size                              : 1.83 MiB (96%)&#xA;Title                                    : Snap Video&#xA;Language                                 : English&#xA;Encoded date                             : UTC 2021-07-28 22:09:36&#xA;Tagged date                              : UTC 2021-07-28 22:09:36&#xA;Color range                              : Full&#xA;colour_range_Original                    : Limited&#xA;Color primaries                          : BT.709&#xA;Transfer characteristics                 : BT.601&#xA;transfer_characteristics_Original        : BT.709&#xA;Matrix coefficients                      : BT.709&#xA;Codec configuration box                  : avcC&#xA;&#xA;Audio&#xA;ID                                       : 256&#xA;Format                                   : AAC LC&#xA;Format/Info                              : Advanced Audio Codec Low Complexity&#xA;Codec ID                                 : mp4a-40-2&#xA;Duration                                 : 9 s 612 ms&#xA;Bit rate mode                            : Constant&#xA;Bit rate                                 : 62.0 kb/s&#xA;Channel(s)                               : 1 channel&#xA;Channel layout                           : C&#xA;Sampling rate                            : 44.1 kHz&#xA;Frame rate                               : 43.066 FPS (1024 SPF)&#xA;Compression mode                         : Lossy&#xA;Stream size                              : 73.3 KiB (4%)&#xA;Title                                    : Snap Audio&#xA;Language                                 : English&#xA;Encoded date                             : UTC 2021-07-28 22:09:36&#xA;Tagged date                              : UTC 2021-07-28 22:09:36&#xA;

    &#xA;

    Bad video file :

    &#xA;

    General&#xA;Complete name                            : /mnt/smb/Snapchat-1989594918.mp4&#xA;Format                                   : MPEG-4&#xA;Format profile                           : Base Media / Version 2&#xA;Codec ID                                 : mp42 (isom/mp42)&#xA;File size                                : 2.97 MiB&#xA;Duration                                 : 6 s 313 ms&#xA;Overall bit rate                         : 3 948 kb/s&#xA;Encoded date                             : UTC 2019-07-11 06:43:04&#xA;Tagged date                              : UTC 2019-07-11 06:43:04&#xA;com.android.version                      : 9&#xA;&#xA;Video&#xA;ID                                       : 1&#xA;Format                                   : AVC&#xA;Format/Info                              : Advanced Video Codec&#xA;Format profile                           : Baseline@L3.1&#xA;Format settings                          : 1 Ref Frames&#xA;Format settings, CABAC                   : No&#xA;Format settings, Reference frames        : 1 frame&#xA;Format settings, GOP                     : M=1, N=30&#xA;Codec ID                                 : avc1&#xA;Codec ID/Info                            : Advanced Video Coding&#xA;Duration                                 : 6 s 313 ms&#xA;Bit rate                                 : 3 945 kb/s&#xA;Width                                    : 496 pixels&#xA;Height                                   : 960 pixels&#xA;Display aspect ratio                     : 0.517&#xA;Frame rate mode                          : Variable&#xA;Frame rate                               : 29.306 FPS&#xA;Minimum frame rate                       : 19.767 FPS&#xA;Maximum frame rate                       : 39.508 FPS&#xA;Color space                              : YUV&#xA;Chroma subsampling                       : 4:2:0&#xA;Bit depth                                : 8 bits&#xA;Scan type                                : Progressive&#xA;Bits/(Pixel*Frame)                       : 0.283&#xA;Stream size                              : 2.97 MiB (100%)&#xA;Title                                    : VideoHandle&#xA;Language                                 : English&#xA;Encoded date                             : UTC 2019-07-11 06:43:04&#xA;Tagged date                              : UTC 2019-07-11 06:43:04&#xA;Color range                              : Limited&#xA;Color primaries                          : BT.709&#xA;Transfer characteristics                 : BT.709&#xA;Matrix coefficients                      : BT.709&#xA;Codec configuration box                  : avcC&#xA;

    &#xA;

    Or as a diff image : image diff

    &#xA;

    The problem is that I am not that familiar with ffmpeg yet I don't know all the quirks it has.

    &#xA;

    I hope someone can point me in the right direction.

    &#xA;