Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (52)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • 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

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

Sur d’autres sites (7784)

  • Algorithm when recording SegmentTimeline of MPEG-DASH MPD in shaka packager

    25 mars 2021, par jgkim0518

    I packaged a media stream by mpeg-dash transcoded video at twice the speed and audio at normal speed.
Here is the command :

    


    ffmpeg -re -stream_loop -1 -i timing_logic.mp4 -c:v hevc_nvenc -filter:v "setpts=2*PTS" -c:a libfdk_aac -map 0:v -map 0:a -f mpegts udp://xxx.xxx.xxx.xxx:xxxx?pkt_size=1316


    


    The source information used here is as follows :

    


    Input #0, mpegts, from '/home/test/timing_logic/timing_logic.mp4':
Duration: 00:00:30.22, start: 1.400000, bitrate: 16171 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: hevc (Main 10) (HEVC / 0x43564548), yuv420p10le(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 128 kb/s Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> hevc (hevc_nvenc))
Stream #0:1 -> #0:1 (mp2 (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
Output #0, mpegts, to 'udp://xxx.xxx.xxx.xxx:xxxx?pkt_size=1316':
Metadata:
encoder : Lavf58.45.100
Stream #0:0: Video: hevc (hevc_nvenc) (Main 10), p010le, 3840x2160 [SAR 1:1 DAR 16:9], q=-1--1, 2000 kb/s, 50 fps, 90k tbn, 50 tbc
Metadata:
encoder : Lavc58.91.100 hevc_nvenc
Side data:
cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: N/A
Stream #0:1(eng): Audio: aac (libfdk_aac), 48000 Hz, stereo, s16, 139 kb/s
Metadata:
encoder : Lavc58.91.100 libfdk_aac


    


    My shaka packager command is :

    


    packager \ 'in=udp://xxx.xxx.xxx.xxx:xxxx,stream=video,init_segment=/home/test/timing_logic/package/video/0/video.mp4,segment_template=/home/test/timing_logic/package/video/0/$Time$.m4s' \
'in=udp://xxx.xxx.xxx.xxx:xxxx,stream=audio,init_segment=/home/test/timing_logic/package/audio/0/audio.mp4,segment_template=/home/test/timing_logic/package/audio/0/$Time$.m4a' \
--segment_duration 5 --fragment_duration 5 --minimum_update_period 5 --min_buffer_time 5 \
--preserved_segments_outside_live_window 24 --time_shift_buffer_depth 40 \
--allow_codec_switching --allow_approximate_segment_timeline --log_file_generation_deletion \
--mpd_output $OUTPUT/$output_mpd.mpd &


    


    Looking at the mpd generated as a result of packaging, the duration of the audio is twice that of the video, and the number of segments is half.
The following is the content of mpd :

    


    &lt;?xml version="1.0" encoding="UTF-8"?>&#xA;&#xA;<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" minbuffertime="PT5S" type="dynamic" publishtime="2021-03-23T10:01:57Z" availabilitystarttime="2021-03-23T09:59:55Z" minimumupdateperiod="PT5S" timeshiftbufferdepth="PT40S">&#xA;<period start="PT0S">&#xA;<adaptationset contenttype="audio" segmentalignment="true">&#xA;<representation bandwidth="140020" codecs="mp4a.40.2" mimetype="audio/mp4" audiosamplingrate="48000">&#xA;<audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></audiochannelconfiguration>&#xA;<segmenttemplate timescale="90000" initialization="/home/test/timing_logic/package/audio/0/audio.mp4" media="/home/test/timing_logic/package/audio/0/$Time$.m4a" startnumber="16">&#xA;<segmenttimeline>&#xA;<s t="6751436" d="449280"></s>&#xA;<s t="7200716" d="451200"></s>&#xA;<s t="7651916" d="449280"></s>&#xA;<s t="8101196" d="374400"></s>&#xA;<s t="8551196" d="449280"></s>&#xA;<s t="9000476" d="451200"></s>&#xA;<s t="9451674" d="449280"></s>&#xA;<s t="9900956" d="449280"></s>&#xA;<s t="10350236" d="451200"></s>&#xA;<s t="10801434" d="374400"></s>&#xA;</segmenttimeline>&#xA;</segmenttemplate>&#xA;</representation>&#xA;</adaptationset>&#xA;<adaptationset contenttype="video" width="3840" height="2160" framerate="90000/3600" segmentalignment="true" par="16:9">&#xA;<representation bandwidth="1520392" codecs="hvc1.2.4.L153" mimetype="video/mp4" sar="1:1">&#xA;<segmenttemplate timescale="90000" initialization="/home/test/timing_logic/package/video/0/video.mp4" media="/home/test/timing_logic/package/video/0/$Time$.m4s" startnumber="19">&#xA;<segmenttimeline>&#xA;<s t="16954440" d="900000" r="4"></s>&#xA;</segmenttimeline>&#xA;</segmenttemplate>&#xA;</representation>&#xA;</adaptationset>&#xA;</period>&#xA;</mpd>&#xA;

    &#xA;

    When looking at the MPD, it seems that the shaka packager checks the PTS or DTS of the TS when creating a segment and recording the contents of the SegmentTimeline.&#xA;But I couldn't understand even by looking at the MPEG standard documentation and the DASH-IF documentation.

    &#xA;

    My question is whether the packager refers to PTS or DTS when creating a segment.&#xA;How are SegmentTimeline's S@t and S@d recorded ?&#xA;What algorithm is the SegmentTimeline recorded with ? Please help me. Thank you.

    &#xA;

  • ffmpeg creates empty mpd-file

    1er avril 2021, par Macster

    I'm trying to live stream a webm file using ffmpeg and Dash.js as a Player. Creating chunks with ffmpeg seems to work fine, but when want to create the manifest it says Could not find codec parameters for stream 0 (Video: vp9, none, 640x480): unspecified pixel format Consider increasing the value for the &#x27;analyzeduration&#x27; and &#x27;probesize&#x27; options and at the end Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used).

    &#xA;

    Commands I use

    &#xA;

    ffmpeg -re -r 25 -i Dash/strm.webm&#xA; -map 0:v:0&#xA; -pix_fmt yuv420p&#xA; -c:v libvpx-vp9&#xA; -s 640x480 -keyint_min 25 -g 25 &#xA; -speed 6 -threads 8 -static-thresh 0 -max-intra-rate 300 &#xA; -deadline realtime -lag-in-frames 0 -error-resilient 1&#xA; -f webm_chunk &#xA; -header "Dash/glass_360.hdr"&#xA; -chunk_start_index 1&#xA; Dash\glass_360_%d.chk&#xA;

    &#xA;

    Manifest

    &#xA;

    ffmpeg ^&#xA; -f webm_dash_manifest -live 1&#xA; -r 25&#xA; -i Dash/glass_360.hdr&#xA; -c copy&#xA; -map 0&#xA; -r 25&#xA; -framerate 25&#xA; -f webm_dash_manifest -live 1&#xA; -adaptation_sets "id=0,streams=0"&#xA; -chunk_start_index 1&#xA; -chunk_duration_ms 1000&#xA; -time_shift_buffer_depth 7200&#xA; -minimum_update_period 7200&#xA; Dash/glass_live_manifest.mpd&#xA;

    &#xA;

    Manifest Output

    &#xA;

     libavutil      56. 49.100 / 56. 49.100&#xA;  libavcodec     58. 87.101 / 58. 87.101&#xA;  libavformat    58. 43.100 / 58. 43.100&#xA;  libavdevice    58.  9.103 / 58.  9.103&#xA;  libavfilter     7. 83.100 /  7. 83.100&#xA;  libswscale      5.  6.101 /  5.  6.101&#xA;  libswresample   3.  6.100 /  3.  6.100&#xA;  libpostproc    55.  6.100 / 55.  6.100&#xA;[webm_dash_manifest @ 0000015f19f2ea40] Could not find codec parameters for stream 0 (Video: vp9, none, 640x480): unspecified pixel format&#xA;Consider increasing the value for the &#x27;analyzeduration&#x27; and &#x27;probesize&#x27; options&#xA;Input #0, webm_dash_manifest, from &#x27;Dash/glass_360.hdr&#x27;:&#xA;  Metadata:&#xA;    ENCODER         : Lavf58.43.100&#xA;  Duration: N/A, bitrate: N/A&#xA;    Stream #0:0(eng): Video: vp9, none, 640x480, SAR 1:1 DAR 4:3, 1k tbr, 1k tbn, 1k tbc (default)&#xA;    Metadata:&#xA;      ALPHA_MODE      : 1&#xA;      ENCODER         : Lavc58.87.101 libvpx-vp9&#xA;      webm_dash_manifest_file_name: glass_360.hdr&#xA;      webm_dash_manifest_track_number: 1&#xA;Output #0, webm_dash_manifest, to &#x27;stream_manifest.mpd&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf58.43.100&#xA;    Stream #0:0(eng): Video: vp9, none, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 1k tbr, 1k tbn, 1k tbc (default)&#xA;    Metadata:&#xA;      ALPHA_MODE      : 1&#xA;      ENCODER         : Lavc58.87.101 libvpx-vp9&#xA;      webm_dash_manifest_file_name: glass_360.hdr&#xA;      webm_dash_manifest_track_number: 1&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (copy)&#xA;Press [q] to stop, [?] for help&#xA;frame=    0 fps=0.0 q=-1.0 Lsize=       1kB time=00:00:00.00 bitrate=N/A speed=   0x&#xA;video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown&#xA;Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)&#xA;

    &#xA;

    glass_live_manifest.mpd

    &#xA;

    &lt;?xml version="1.0" encoding="UTF-8"?>&#xA;&#xA;<period start="PT0S">&#xA;<adaptationset mimetype="video/webm" codecs="vp9" lang="eng" bitstreamswitching="true" subsegmentalignment="true" subsegmentstartswithsap="1">&#xA;<contentcomponent type="video"></contentcomponent>&#xA;<segmenttemplate timescale="1000" duration="1000" media="glass_$RepresentationID$_$Number$.chk" startnumber="1" initialization="glass_$RepresentationID$.hdr"></segmenttemplate>&#xA;<representation bandwidth="1000000" width="640" height="480" codecs="vp9" mimetype="video/webm" startswithsap="1"></representation>&#xA;</adaptationset>&#xA;</period>&#xA;&#xA;

    &#xA;

    UPDATE

    &#xA;

    I fixed the "warnings" by changing the comands like this :

    &#xA;

    ffmpeg -re -r 25 -i Dash/strm.webm&#xA;-map 0:v:0&#xA;-pix_fmt yuv420p&#xA;-c:v libvpx&#xA;-s 640x480 -keyint_min 60 -g 60 -speed 6 -tile-columns 4 -frame-parallel 1 -threads 8 -static-thresh 0 -max-intra-rate 300 -deadline realtime -lag-in-frames 0 -error-resilient 1&#xA;-b:v 3000k&#xA;-f webm_chunk&#xA;-header "Dash/glass_360.hdr"&#xA;-chunk_start_index 1 Dash/glass_360_%d.chk&#xA;-map 0:a:0&#xA;-c:a libvorbis&#xA;-b:a 128k -ar 44100&#xA;-f webm_chunk&#xA;-audio_chunk_duration 2000&#xA;-header Dash/glass_171.hdr&#xA;-chunk_start_index 1 Dash/glass_171_%d.chk&#xA;&#xA;ffmpeg&#xA;-f webm_dash_manifest -live 1&#xA;-i Dash/glass_360.hdr&#xA;-f webm_dash_manifest -live 1&#xA;-i Dash/glass_171.hdr&#xA;-c copy&#xA;-map 0 -map 1&#xA;-f webm_dash_manifest -live 1&#xA;-adaptation_sets "id=0,streams=0 id=1,streams=1"&#xA;-chunk_start_index 1&#xA;-chunk_duration_ms 2000&#xA;-time_shift_buffer_depth 7200&#xA;-minimum_update_period 7200 Dash/glass_video_manifest.mpd&#xA;

    &#xA;

    However, it's still not working.

    &#xA;

  • FFmpeg overlay PNG after scaling has not necessary black borders

    24 mars 2021, par Mikołaj Henklewski

    I have two PNG files that I want to add to the video :

    &#xA;

    &#xA;

    but on the final video, they have black borders (they do not have it originally !) Actual Result.. The question is why FFmpeg is adding it on scale effect, and how to avoid adding it ? Command is :

    &#xA;

    ffmpeg -i 3d9678e2e58c4d08a24363468d0cfd3e.mp4 -i caption-1616544596077-d.png -i caption-1616544596080-d.png -filter_complex &#xA;[1:v]rotate=6.178465552059927:c=none:ow=rotw(6.178465552059927):oh=roth(6.178465552059927)[1_rot];&#xA;[1_rot]scale=iw/2:ih/2[1_rot_scale];&#xA;[0:v][1_rot_scale]overlay=x=288:y=50:enable=&#x27;between(t,0,3.2)&#x27;:format=auto[1_out];&#xA;[2:v]rotate=0.0:c=none:ow=rotw(0.0):oh=roth(0.0)[2_rot];[2_rot]scale=iw/2:ih/2[2_rot_scale];&#xA;[1_out[2_rot_scale]overlay=x=589:y=71:enable=&#x27;between(t,0,3.2)&#x27;:format=auto" -preset ultrafast -crf 23 out.mp4&#xA;

    &#xA;

    Here is also log from ffmpeg :

    &#xA;

    ffmpeg version 4.3.2 Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with Apple clang version 12.0.0 (clang-1200.0.32.29)&#xA;  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.2_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;3d9678e2e58c4d08a24363468d0cfd3e.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.77.100&#xA;  Duration: 00:00:03.72, start: 0.000000, bitrate: 2333 kb/s&#xA;    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 2331 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)&#xA;    Metadata:&#xA;      handler_name    : VideoHandler&#xA;Input #1, png_pipe, from &#x27;caption-1616544596077-d.png&#x27;:&#xA;  Duration: N/A, bitrate: N/A&#xA;    Stream #1:0: Video: png, rgba(pc), 1382x884, 25 tbr, 25 tbn, 25 tbc&#xA;Input #2, png_pipe, from &#x27;caption-1616544596080-d.png&#x27;:&#xA;  Duration: N/A, bitrate: N/A&#xA;    Stream #2:0: Video: png, rgba(pc), 612x612, 25 tbr, 25 tbn, 25 tbc&#xA;File &#x27;out.mp4&#x27; already exists. Overwrite? [y/N] y&#xA;Stream mapping:&#xA;  Stream #0:0 (h264) -> overlay:main&#xA;  Stream #1:0 (png) -> rotate&#xA;  Stream #2:0 (png) -> rotate&#xA;  overlay -> Stream #0:0 (libx264)&#xA;Press [q] to stop, [?] for help&#xA;[libx264 @ 0x7f8999025c00] using SAR=1/1&#xA;[libx264 @ 0x7f8999025c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2&#xA;[libx264 @ 0x7f8999025c00] profile High 4:4:4 Predictive, level 3.1, 4:4:4, 8-bit&#xA;[libx264 @ 0x7f8999025c00] 264 - core 161 r3048 b86ae3c - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=6 threads=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0&#xA;Output #0, mp4, to &#x27;out.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.45.100&#xA;    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv444p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)&#xA;    Metadata:&#xA;      encoder         : Lavc58.91.100 libx264&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A&#xA;frame=   93 fps=0.0 q=-1.0 Lsize=     967kB time=00:00:03.68 bitrate=2152.5kbits/s speed=8.66x&#xA;video:966kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.122451%&#xA;[libx264 @ 0x7f8999025c00] frame I:1     Avg QP:20.00  size: 85204&#xA;[libx264 @ 0x7f8999025c00] frame P:92    Avg QP:18.23  size:  9817&#xA;[libx264 @ 0x7f8999025c00] mb I  I16..4: 100.0%  0.0%  0.0%&#xA;[libx264 @ 0x7f8999025c00] mb P  I16..4:  1.7%  0.0%  0.0%  P16..4: 19.9%  0.0%  0.0%  0.0%  0.0%    skip:78.4%&#xA;[libx264 @ 0x7f8999025c00] coded y,u,v intra: 33.6% 3.0% 4.9% inter: 8.6% 0.9% 0.8%&#xA;[libx264 @ 0x7f8999025c00] i16 v,h,dc,p: 30% 33% 18% 18%&#xA;[libx264 @ 0x7f8999025c00] kb/s:2125.53&#xA;

    &#xA;