Recherche avancée

Médias (91)

Autres articles (35)

  • Modifier la date de publication

    21 juin 2013, par

    Comment changer la date de publication d’un média ?
    Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
    Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
    Dans la rubrique "Champs à ajouter, cocher "Date de publication "
    Cliquer en bas de la page sur Enregistrer

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

Sur d’autres sites (5904)

  • ffmpeg determine correct codec to use

    8 avril 2020, par nha

    I am trying to use .y4m files that I feed into Chrome for playing.
This is the only format that I can use.

    



    I have a set of .y4m files that are working for my use case, taken from here.
For example let's say that I use the file mobile_qcif_7.5fps.y4m.

    



    I also have a .mp4 file (specifically the sample small.mp4 file from techslides ). I know how to convert small.mp4 to small.y4m with the following command :

    



    ffmpeg -y -i small.mp4 small.y4m

    



    I would like the resulting file to be accepted by Chrome, just like the other file.
What options should I use (and how to find them) ?

    



    Additional information

    



    ffprobe gives :

    



    $ ffprobe small.y4m 
avprobe version 0.8.13-6:0.8.13-0ubuntu0.13.10.1, Copyright (c) 2007-2014 the Libav developers
  built on Jul 15 2014 13:48:35 with gcc 4.8.1
[yuv4mpegpipe @ 0x23160c0] Estimating duration from bitrate, this may be inaccurate
Input #0, yuv4mpegpipe, from 'small.y4m':
  Duration: N/A, bitrate: N/A
    Stream #0.0: Video: rawvideo, yuv420p, 560x320, 30 fps, 30 tbr, 30 tbn, 30 tbc


$ ffprobe mobile_qcif_7.5fps.y4m
avprobe version 0.8.13-6:0.8.13-0ubuntu0.13.10.1, Copyright (c) 2007-2014 the Libav developers
  built on Jul 15 2014 13:48:35 with gcc 4.8.1
[yuv4mpegpipe @ 0x1e080c0] max_analyze_duration reached
[yuv4mpegpipe @ 0x1e080c0] Estimating duration from bitrate, this may be inaccurate
Input #0, yuv4mpegpipe, from 'mobile_qcif_7.5fps.y4m':
  Duration: N/A, bitrate: N/A
    Stream #0.0: Video: rawvideo, yuv420p, 176x144, PAR 128:117 DAR 1408:1053, 7.50 fps, 7.50 tbr, 7.50 tbn, 7.50 tbc


    



    OS : I am using ffmpeg in Ubuntu 13.10 from the default repository : I ran sudo apt-get install ffmpeg libavcodec-extra-53

    



    Complete console output

    



    $ ffmpeg -y -i small.mp4 small.y4m
ffmpeg version 0.8.13-6:0.8.13-0ubuntu0.13.10.1, Copyright (c) 2000-2014 the Libav developers
  built on Jul 15 2014 13:48:35 with gcc 4.8.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'small.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2010-03-20 21:29:11
    encoder         : HandBrake 0.9.4 2009112300
  Duration: 00:00:05.56, start: 0.000000, bitrate: 551 kb/s
    Stream #0.0(und): Video: h264 (Constrained Baseline), yuv420p, 560x320, 465 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc
    Metadata:
      creation_time   : 2010-03-20 21:29:11
    Stream #0.1(eng): Audio: aac, 48000 Hz, mono, s16, 83 kb/s
    Metadata:
      creation_time   : 2010-03-20 21:29:11
[buffer @ 0x7274e0] w:560 h:320 pixfmt:yuv420p
Output #0, yuv4mpegpipe, to 'small.y4m':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2010-03-20 21:29:11
    encoder         : Lavf53.21.1
    Stream #0.0(und): Video: rawvideo, yuv420p, 560x320, q=2-31, 200 kb/s, 90k tbn, 30 tbc
    Metadata:
      creation_time   : 2010-03-20 21:29:11
Stream mapping:
  Stream #0.0 -> #0.0
Press ctrl-c to stop encoding
frame=  166 fps=  0 q=0.0 Lsize=   43576kB time=5.53 bitrate=64513.5kbits/s    
video:0kB audio:0kB global headers:0kB muxing overhead inf%


    



    Head of the files

    



    Not sure if this is relevant, but the text content of both files begin like that :

    



    mobile_qcif_7.5fps.y4m
YUV4MPEG2 W176 H144 F15:2 Ip A128:117
FRAME

small.y4m (invalid)
YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420mpeg2 XYSCSS=420MPEG2
FRAME


    



    Additional experiment

    



    Taking the sample mobile_qcif_7.5fps.y4m, turning it into a .mp4 file and then back into a .y4m produces an invalid file (at least for Chrome).

    



    Answer to comments in the answer of @SirDarius

    



    Following the suggestion of @SirDarius ; I tried the following commands.
They failed to produce a valid file.

    



    # [COMMAND]   # [RESULT] [HEADER]
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv444p -y small_yuv444p.y4m   # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C444 XYSCSS=444
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv422p -y small_yuv422p.y4m   # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C422 XYSCSS=422
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv420p -y small_yuv420p.y4m   # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420mpeg2 XYSCSS=420MPEG2
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv411p -y small_yuv411p.y4m   # KO   YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C411 XYSCSS=411

ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p9 -y small_yuv420p9.y4m   # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420p9 XYSCSS=420P9
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p12 -y small_yuv420p12.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420p12 XYSCSS=420P12
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p14 -y small_yuv420p14.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420p14 XYSCSS=420P14
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p16 -y small_yuv420p16.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420p16 XYSCSS=420P16


    



    When trying other formats (like yuv420p12be, which was in the output of -pix_fmts), I had the following output (hence my previous trials) :

    



    $  ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv420p12be -y small_yuv420p12be.y4m 
ffmpeg version N-68884-g3ebd76a Copyright (c) 2000-2015 the FFmpeg developers
  built on Jan  6 2015 11:03:21 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
  configuration: 
  libavutil      54. 16.100 / 54. 16.100
  libavcodec     56. 19.100 / 56. 19.100
  libavformat    56. 18.100 / 56. 18.100
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  6.100 /  5.  6.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x21d0220] overread end of atom 'colr' by 1 bytes
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'small.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2010-03-20 21:29:11
    encoder         : HandBrake 0.9.4 2009112300
  Duration: 00:00:05.57, start: 0.000000, bitrate: 551 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 560x320, 465 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2010-03-20 21:29:11
      encoder         : JVT/AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 83 kb/s (default)
    Metadata:
      creation_time   : 2010-03-20 21:29:11
[yuv4mpegpipe @ 0x21d8180] ERROR: yuv4mpeg can only handle yuv444p, yuv422p, yuv420p, yuv411p and gray8 pixel formats. And using 'strict -1' also yuv444p9, yuv422p9, yuv420p9, yuv444p10, yuv422p10, yuv420p10, yuv444p12, yuv422p12, yuv420p12, yuv444p14, yuv422p14, yuv420p14, yuv444p16, yuv422p16, yuv420p16 and gray16 pixel formats. Use -pix_fmt to select one.
Output #0, yuv4mpegpipe, to 'small_yuv420p12be.y4m':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    encoder         : Lavf56.18.100
    Stream #0:0(und): Video: rawvideo ([12][11]3Y / 0x59330B0C), yuv420p12be, 560x320, q=2-31, 200 kb/s, 7.50 fps, 7.50 tbn, 7.50 tbc (default)
    Metadata:
      creation_time   : 2010-03-20 21:29:11
      encoder         : Lavc56.19.100 rawvideo
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Could not write header for output file #0 (incorrect codec parameters ?): Input/output error


    



    After that, I also tried to edit with an hexadecimal editor (bless) the small_yuv420p.y4m file. I replace C420mpeg2 by C420, and the file was accepted by Chrome.
What does the number in 420p[number] correspond to ? It is not explained there.
Is there any way to make ffmpeg output this kind of header files ?

    



    @SirDarius, thank you again for your help.

    



    The question

    



    (in case you forgot after this text blob)

    



    How can I convert the small.mp4 into a small.y4m file that has the same properties as the mobile_qcif_7.5fps.y4m file ?

    


  • Picture in picture problem on output stream in FFMPEG

    7 mai 2020, par mat thew

    I have a problem with ffmpeg output video.

    



    I am using Raspberry Pi to connect video (stream with IP camera) and audio. Its work fine.
I would like to add to my output video another video with second camera (in left-top side).

    



    Graphics it is looks like :

    



    _________________
| |_2_|         |
|               |
|        1      |
|_______________|


    



    1 is head video, 2 is video to add

    



    that is my code to situation with top :

    



    /home/pi/FFmpeg/ffmpeg -y -thread_queue_size 512K \
-re -vsync 1 -rtsp_transport tcp -itsoffset 0 -use_wallclock_as_timestamps 1 \
-i "rtsp://admin:admin@172.16.7.7:554/cam/realmonitor?channel=1&subtype=0" \
-thread_queue_size 512K -i "rtsp://video:video@172.16.7.8:554/cam/realmonitor?channel=1&subtype=0" \
-filter_complex "[1]scale=iw/3:ih/3 [pip]; [0][pip] overlay=3:3" \
-ar 44100 -itsoffset 1.5 -ac 2 -f alsa -ac 2 -thread_queue_size 512K -i default -f h264 \
-c:a aac -ab 128k -g 50 -strict -2 -f flv rtmp://127.0.0.1/sesja/transmisja


    



    Stream is running, however number of fps is 4-5, speed is 0.3 what makes it output stream does not work properly.

    



    I am asking from help in configuration, maybe Raspberry does not support this solution in hardware.

    



    FULL LOG :

    



    ffmpeg version N-92540-g28c96c2ce2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
  configuration: --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree --enable-indev=alsa --enable-outdev=alsa
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 40.100 / 58. 40.100
  libavformat    58. 23.100 / 58. 23.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 46.100 /  7. 46.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, rtsp, from 'rtsp://admin:admin@172.16.7.7:554/cam/realmonitor?channel=1&subtype=0':
  Metadata:
    title           : RTSP Session/2.0
  Duration: N/A, start: 1588833830.370000, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 20 fps, 20 tbr, 90k tbn, 40 tbc
[rtsp @ 0x31cc480] max delay reached. need to consume packet
[rtsp @ 0x31cc480] RTP: missed 35 packets
[rtsp @ 0x31cc480] max delay reached. need to consume packet
[rtsp @ 0x31cc480] RTP: missed 7 packets
[h264 @ 0x31e4180] concealing 3081 DC, 3081 AC, 3081 MV errors in I frame
[rtsp @ 0x31cc480] max delay reached. need to consume packet
[rtsp @ 0x31cc480] RTP: missed 34 packets
[h264 @ 0x31e4180] error while decoding MB 30 1, bytestream -11
[h264 @ 0x31e4180] concealing 3539 DC, 3539 AC, 3539 MV errors in P frame
[rtsp @ 0x31cc480] max delay reached. need to consume packet
[rtsp @ 0x31cc480] RTP: missed 13 packets
Input #1, rtsp, from 'rtsp://video:video@172.16.7.8:554/cam/realmonitor?channel=1&subtype=0':
  Metadata:
    title           : RTSP Session/2.0
  Duration: N/A, start: 0.430000, bitrate: N/A
    Stream #1:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 20 fps, 100 tbr, 90k tbn, 40 tbc
Guessed Channel Layout for Input Stream #2.0 : stereo
Input #2, alsa, from 'default':
  Duration: N/A, start: 1588833833.133715, bitrate: 1411 kb/s
    Stream #2:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
  Stream #0:0 (h264) -> overlay:main (graph 0)
  Stream #1:0 (h264) -> scale (graph 0)
  overlay (graph 0) -> Stream #0:0 (flv)
  Stream #2:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[h264 @ 0x3389140] concealing 3081 DC, 3081 AC, 3081 MV errors in I frame
[rtsp @ 0x31cc480] max delay reached. need to consume packet
[rtsp @ 0x31cc480] RTP: missed 51 packets
[swscaler @ 0x3b3b6f0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x3b56cf0] deprecated pixel format used, make sure you did set range correctly
Output #0, flv, to 'rtmp://127.0.0.1/sesja/transmisja':
  Metadata:
    title           : RTSP Session/2.0
    encoder         : Lavf58.23.100
    Stream #0:0: Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 20 fps, 1k tbn, 20 tbc (default)
    Metadata:
      encoder         : Lavc58.40.100 flv
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.40.100 aac
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   [h264 @ 0x3831c40] error while decoding MB 30 1, bytestream -11
[h264 @ 0x3831c40] concealing 3539 DC, 3539 AC, 3539 MV errors in P frame
frame=    2 fps=1.5 q=2.0 size=       0kB time=00:00:00.05 bitrate=  57.9kbits/s[h264 @ 0x384a1a0] error while decoding MB 64 6, bytestream -13
[h264 @ 0x384a1a0] concealing 3105 DC, 3105 AC, 3105 MV errors in P frame
frame=    6 fps=2.8 q=7.0 size=     265kB time=00:00:01.50 bitrate=1447.5kbits/sframe=    9 fps=3.3 q=15.5 size=     270kB time=00:00:01.50 bitrate=1472.7kbits/frame=   13 fps=3.7 q=26.4 size=     274kB time=00:00:01.50 bitrate=1496.4kbits/frame=   15 fps=3.6 q=30.2 size=     276kB time=00:00:01.50 bitrate=1507.6kbits/frame=   17 fps=3.6 q=31.0 size=     278kB time=00:00:01.50 bitrate=1518.9kbits/frame=   20 fps=3.6 q=31.0 size=     284kB time=00:00:01.50 bitrate=1551.1kbits/[h264 @ 0x3389140] error while decoding MB 42 4, bytestream -5
[h264 @ 0x3389140] concealing 3287 DC, 3287 AC, 3287 MV errors in P frame
frame=   23 fps=3.7 q=31.0 size=     287kB time=00:00:01.50 bitrate=1568.5kbits/frame=   24 fps=3.6 q=31.0 size=     288kB time=00:00:01.50 bitrate=1574.1kbits/frame=   60 fps=5.7 q=31.0 size=     295kB time=00:00:02.95 bitrate= 817.9kbits/frame=   62 fps=5.5 q=31.0 size=     418kB time=00:00:03.05 bitrate=1121.3kbits/frame=   62 fps=5.2 q=31.0 size=     419kB time=00:00:03.07 bitrate=1114.9kbits/frame=   62 fps=5.0 q=31.0 size=     419kB time=00:00:03.07 bitrate=1114.9kbits/frame=   62 fps=4.8 q=31.0 size=     419kB time=00:00:03.07 bitrate=1114.9kbits/frame=   62 fps=4.6 q=31.0 size=     419kB time=00:00:03.07 bitrate=1114.9kbits/frame=   62 fps=4.4 q=31.0 size=     419kB time=00:00:03.07 bitrate=1114.9kbits/frame=   62 fps=4.2 q=31.0 size=     419kB time=00:00:03.07 bitrate=1114.9kbits/frame=   63 fps=4.1 q=31.0 size=     419kB time=00:00:03.10 bitrate=1108.0kbits/frame=   65 fps=4.0 q=31.0 size=     424kB time=00:00:03.20 bitrate=1084.3kbits/frame=   68 fps=4.0 q=31.0 size=     429kB time=00:00:03.35 bitrate=1049.4kbits/frame=   71 fps=4.0 q=31.0 size=     435kB time=00:00:03.50 bitrate=1017.3kbits/frame=   74 fps=4.1 q=31.0 size=     441kB time=00:00:03.65 bitrate= 988.5kbits/frame=   77 fps=4.1 q=31.0 size=     446kB time=00:00:03.80 bitrate= 961.0kbits/frame=   80 fps=4.1 q=31.0 size=     452kB time=00:00:03.95 bitrate= 936.5kbits/frame=   83 fps=4.1 q=31.0 size=     457kB time=00:00:04.10 bitrate= 913.1kbits/frame=   85 fps=4.1 q=31.0 size=     461kB time=00:00:04.21 bitrate= 896.4kbits/frame=   88 fps=4.1 q=31.0 size=     467kB time=00:00:04.35 bitrate= 878.6kbits/frame=   91 fps=4.1 q=31.0 size=     473kB time=00:00:04.50 bitrate= 860.1kbits/[flv @ 0x37246b0] Failed to update header with correct duration.
[flv @ 0x37246b0] Failed to update header with correct filesize.
frame=   93 fps=4.0 q=31.0 Lsize=     478kB time=00:00:04.63 bitrate= 844.7kbits/s dup=38 drop=36 speed=0.202x    
video:425kB audio:49kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.859331%
[aac @ 0x3268610] Qavg: 185.380
Exiting normally, received signal 2.


    



    Thanks

    


  • avformat/crypto.c : remove unnecessary code

    14 juillet 2020, par Steven Liu
    avformat/crypto.c : remove unnecessary code
    

    Because the newpos variable is set value before use it.
    The newpos variable declared at the head partition of crypto_seek.
    Make the code clean.

    Signed-off-by : Steven Liu <lq@chinaffmpeg.org>

    • [DH] libavformat/crypto.c