
Recherche avancée
Autres articles (90)
-
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur
8 février 2011, parLa visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
Configuration de la boite multimédia
Dès (...)
Sur d’autres sites (7362)
-
ffmpeg dash Segment offset
18 mars 2019, par inkubuxI’m trying to integrate live-transcoding like "plex" or "emby" with my application.
I am able to serve dash content over to shaka-player or dash.js but only in ’live-mode’. But I want to enable seeking through the player.
I looked at plex and to enable this they create their own mpd file with duration so the player will have a full seekbar.
However when seeking the player will ask for a segment number eg : 449. I need to stop ffmpeg and restart with an offset
(-ss <<segment>>)</segment>
, but ffmpeg will just restart a transcode session from segment 0 with an initial segment.What I want is to tell ffmpeg to start at a seekpoint but only output from segment number and now-on.
When playing with hls and mpegts, I can tell ffmpeg to output at a certain segment : with the option
-segment_start_number
but this is not available for dash. And plex use their own transcoder based of ffmpeg with the option-skip_to_segment
I tried to ’hack’ around by keeping a manual offset on my web-server, even if I serve the "supposed" right segment after the seek point dash.js and shaka-player can’t recover the stream.. VLC on the other habd is able to (probably more tolerent) to errors in segments.
Is the supposed right segment after a seek in dash (contains the initial segment) or only the segment.
Is ffmpeg able to start segmenting dash as a supposed segment (for seek and resume)
The same technique works in hls with forced key frames and a custom m3u8 (with all the "predicted" segments) but calculating the right segment length and the right bandwidth is much harder and hackish and dash is more tolerant to variation.
I would really like to be able to seek through my live transcoding video.
For reference here is a custom mpd file I serve to enable "seeking" :
<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" suggestedpresentationdelay="PT1S" mediapresentationduration="PT49M2.920S" maxsegmentduration="PT2S" minbuffertime="PT10S">
<period start="PT0S" duration="PT49M2.920S">
<adaptationset segmentalignment="true">
<segmenttemplate timescale="1" duration="1" initialization="$RepresentationID$/initial.mp4" media="$RepresentationID$/$Number$.m4s" startnumber="1">
</segmenttemplate>
<representation mimetype="video/mp4" codecs="avc1.640029" bandwidth="3766000" width="1920" height="1080">
</representation>
</adaptationset>
<adaptationset segmentalignment="true">
<segmenttemplate timescale="1" duration="1" initialization="$RepresentationID$/initial.mp4" media="$RepresentationID$/$Number$.m4s" startnumber="1">
</segmenttemplate>
<representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="188000" audiosamplingrate="48000">
<audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="6"></audiochannelconfiguration>
</representation>
</adaptationset>
</period>
</mpd>And here is the ffmpeg command to pull it off :
ffmpeg -ss 0 -i movie.mkv -y -acodec aac -vcodec libx264 -f dash -min_seg_duration 1000000 -individual_header_trailer 0 -pix_fmt yuv420p -vf scale=trunc(min(max(iw\,ih*dar)\,1920)/2)*2:trunc(ow/dar/2)*2 -bsf:v h264_mp4toannexb -profile:v high -level 4.1 -map_chapters -1 -map_metadata -1 -preset veryfast -movflags frag_keyframe+empty_moov -use_template 1 -use_timeline 0 -remove_at_exit 1 -crf 23 -bufsize 7532k -maxrate 3766k -start_at_zero -threads 0 -force_key_frames expr:if(isnan(prev_forced_t),eq(t,t),gte(t,prev_forced_t+1)) -init_seg_name $RepresentationID$/0_initial.mp4 -media_seg_name $RepresentationID$/0_$Number$.m4s /transcoding_temp/Z1GVWEc/index.mpd
The
media_seg_name
is where I prepend the custom seek_point let’s say I want to seek to segment 1233 the template would be :-media_seg_name $RepresentationID$/1233_$Number$.m4s
and the segments would be 1233_1 1233_2 1233_* So I can serve the right segment after seek. but the player does not recover and still downloading subsequent segments. I guess since a new initial segment is generated and I somehow miss headers for continuous playback after seek but I’m probably wrong.
Thanks for your help
-
Using ffmpeg to generate dash manifest and it cannot be played by dash.js
18 mars 2019, par PunkheadI’m using ffmpeg to encode incoming stream via rtmp protocol, the code as following :
ffmpeg -re -i rtmp://localhost:1935${StreamPath} -use_timeline 1 /
-use_template 1 -window_size 10 -min_seg_duration 5000 -f dash out.mpdThe manifest looks like this :
<?xml version="1.0" encoding="utf-8"?>
<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediapresentationduration="PT1M36.4S" minbuffertime="PT8.3S">
<programinformation>
</programinformation>
<period start="PT0.0S">
<adaptationset contenttype="video" segmentalignment="true" bitstreamswitching="true" framerate="30/1">
<representation mimetype="video/mp4" codecs="avc1.640028" width="1920" height="1080" framerate="30/1">
<segmenttemplate timescale="15360" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startnumber="4">
<segmenttimeline>
<s t="384000" d="128000"></s>
<s d="71680"></s>
<s d="128000" r="4"></s>
<s d="56832"></s>
<s d="128000"></s>
<s d="72704"></s>
</segmenttimeline>
</segmenttemplate>
</representation>
</adaptationset>
<adaptationset contenttype="audio" segmentalignment="true" bitstreamswitching="true">
<representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="128000" audiosamplingrate="44100">
<audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></audiochannelconfiguration>
<segmenttemplate timescale="44100" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startnumber="4">
<segmenttimeline>
<s t="1099755" d="367616"></s>
<s d="205824"></s>
<s d="367616" r="4"></s>
<s d="162816"></s>
<s d="367616"></s>
<s d="207872"></s>
</segmenttimeline>
</segmenttemplate>
</representation>
</adaptationset>
</period>
</mpd>When I try to play it on dash.js player, a error occured :
[112] Parsing complete: ( xml2json: 3.50ms, objectiron: 1.76ms, total: 0.00526s) Debug.js:127
[116] SegmentTimeline detected using calculated Live Edge Time Debug.js:127
[118] MediaSource attached to element. Waiting on open... Debug.js:127
[119] Manifest has been refreshed at Tue Jan 02 2018 01:57:35 GMT+0800 [1514829455.1] Debug.js:127
[155] MediaSource is open! Debug.js:127
[156] Duration successfully set to: 96.4 Debug.js:127
[157] Added 0 inline events Debug.js:127
[158] video codec: video/mp4;codecs="avc1.640028" Stream.js:225
Uncaught TypeError: Cannot read property 'type' of null
at z (Stream.js:225)
at C (Stream.js:285)
at D (Stream.js:373)
at E (Stream.js:398)
at Object.d [as activate] (Stream.js:107)
at y (StreamController.js:363)
at MediaSource.c (StreamController.js:342)then it fails to playback...
Is it because I didn’t set the parameters right on ffmpeg or this is a bug in dash.js ?
I really stuck here !
-
Download encrypted TS files from video stream
8 janvier 2021, par albertma789Following this post, I usually download transport stream (.ts) files by using the browser's developer console to find the URLs of the .ts files and then I use wget to download them. After that I use the
ffmpeg -f concat
method to combine them into an mp4 file.


Recently I come across a site that streams videos and I used the same method to download all the .ts files. The site is here. After I downloaded all the individual .ts files, I use ffmprobe to check the file format but realized the .ts files cannot be understood by ffmpeg/ffmprobe. While the site uses http (not https) I thought the streams are not encrypted so I tried to open the .ts file in an hex editor but I don't know what format it is (but they don't look like zip/gz). My question is : are the transport steams encrypted ? If yes, is there a way to decrypt them ? If not ? Can anyone point me to the right direction such that I can make ffmpeg understand them ?



An example transport stream (first & second) are here and here but the link might expire in a bit. In that case you will need to open the site in developer console to find the updated link to the .ts files.



The site uses JW Player 8.0.0