
Advanced search
Medias (91)
-
#3 The Safest Place
16 October 2011, by
Updated: February 2013
Language: English
Type: Audio
-
#4 Emo Creates
15 October 2011, by
Updated: February 2013
Language: English
Type: Audio
-
#2 Typewriter Dance
15 October 2011, by
Updated: February 2013
Language: English
Type: Audio
-
#1 The Wires
11 October 2011, by
Updated: February 2013
Language: English
Type: Audio
-
ED-ME-5 1-DVD
11 October 2011, by
Updated: October 2011
Language: English
Type: Audio
-
Revolution of Open-source and film making towards open film making
6 October 2011, by
Updated: July 2013
Language: English
Type: Text
Other articles (29)
-
Librairies et binaires spécifiques au traitement vidéo et sonore
31 January 2010, byLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation; Oggz-tools : outils d’inspection de fichiers ogg; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores;
Binaires complémentaires et facultatifs flvtool2 : extraction / (...) -
Support audio et vidéo HTML5
10 April 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
De l’upload à la vidéo finale [version standalone]
31 January 2010, byLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier; La génération d’une vignette : extraction d’une (...)
On other websites (2277)
-
hls fails to play m3u8 playlist with videojs
9 November 2020, by charlieI created an hls stream from yuv frames with ffmpeg which appears to work just fine. It creates a playlist and updates that, and all .ts files as expected. However even videojs refuses to play it, and I really run out of ideas, probably missing the obvious?


First, the m3u8 list which is continuously updated:


#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:190
#EXTINF:2.000000,
test190.ts
#EXTINF:2.000000,
test191.ts
#EXTINF:2.000000,
test192.ts
#EXTINF:2.000000,
test193.ts
#EXTINF:2.000000,
test194.ts



Those .ts files exist and have sizes of approx 250 kBytes.
Then, I open this standard videojs html file (residing in the same directory):








 


 <h1>VSTream</h1>

 
 <source src="test.m3u8" type="application/x-mpegURL">
 
 
 <code class="echappe-js"><script src='http://stackoverflow.com/feeds/tag/video.min.js'></script>

<script src='http://stackoverflow.com/feeds/tag/videojs-http-streaming.min.js'></script>

 
<script>&#xA; var player = videojs(&#x27;my_video_1&#x27;);&#xA; </script>

 




I open this in Firefox (or Chrome, or Edge, none works) and use its debugger which in the console shows:




VIDEOJS: WARN: A plugin named "reloadSourceOnError" already exists.
You may want to avoid re-registering plugins! video.min.js:12:977
Specified “type” attribute of “application/x-mpegURL” is not
supported. Load of media resource test.m3u8 failed. vstream.html All
candidate resources failed to load. Media load paused. vstream.html
XML Parsing Error: syntax error Location: file:///C:/test/test.m3u8
Line Number 1, Column 1: 2 test.m3u8:1:1 MouseEvent.mozPressure is
deprecated. Use PointerEvent.pressure instead. video.min.js:12:9031
VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) Playback cannot continue. No
available working or supported playlists. Object code: 3, message:
"Playback cannot continue. No available working or supported
playlists." video.min.js:12:977




This doesn't make much sense to me. Why would it throw an XML parsing error for an m3u8 file? Of course, the MEDIA_ERR_DECODE points in some direction, but the same problem persists with fMP4 files.


The relevant ffmpeg c++ code (format is "hls" and formatContext works well in other scenarios, gop is 2):


AVDictionary* options = 0;
 if (fragmented)
 {
 // type
 if (codecID == AV_CODEC_ID_H264)
 av_dict_set (&options, "hls_segment_type", "fmp4", 0);
 else
 av_dict_set (&options, "hls_segment_type", "mpegts", 0);

 av_dict_set (&options, "hls_time", "2.0", 0);
 av_dict_set_int (&options, "hls_list_size", 5, 0);
 av_dict_set (&options, "hls_flags", "delete_segments", 0);
 }

 int ret = avformat_write_header (formatContext, &options);



...which returns success. Then writing frames


int ret = avcodec_send_frame (videoStream->codecContext, frame);
 av_init_packet (avPacket);
 AVRational timeBase = videoStream->getTimeBase ();
 avPacket->stream_index = streams.indexOf (videoStream);
 ret = avcodec_receive_packet (videoStream->codecContext, avPacket);
 avPacket->duration = av_rescale_q (1, videoStream->codecContext->time_base, videoStream->getTimeBase ());
 pts += avPacket->duration;
 avPacket->pts = pts;
 avPacket->dts = pts; // AV_NOPTS_VALUE;
 ret = av_interleaved_write_frame (formatContext, avPacket);



(videoStream here is an internal object representing the avstream).
I've omitted error checks for clarity. All return values show success.
Thanks for any help on this!


-
HLS playlist of self-contained fmp4 segments
16 October 2020, by MathieuI am working on a VMS that stores 10 second long video segments in MPEGTS format. Those segments can then be streamed using HLS, with playlists that look like this:


#EXTM3U
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:11
#EXT-X-PLAYLIST-TYPE:EVENT
#EXT-X-START:TIME-OFFSET=1.0,PRECISE=YES
#EXTINF:10,
1602816779831000000.ts
#EXTINF:10,
1602816789831000000.ts
#EXT-X-ENDLIST



This is working great as long as those files are encoded in h.264. However, if I try creating a similar playlist using h.265 segments, it works only with our Android client, Apple and hls.js having decided to support h.265 HLS using fragmented MP4 only.


"Natively" supporting h.265 by storing fmp4 files directly isn't an option for me, so I would like to transpackage those MPEGTS files to fmp4 on demand.


So what I have attempted to do is, return this playlist instead (changing only the file extension):


#EXTM3U
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:11
#EXT-X-PLAYLIST-TYPE:EVENT
#EXT-X-START:TIME-OFFSET=1.0,PRECISE=YES
#EXTINF:10,
1602816779831000000.mp4
#EXTINF:10,
1602816789831000000.mp4
#EXT-X-ENDLIST



and then lazily transpackage those MPEGTS files to fmp4 one by one using FFMPEG as they are getting requested:


ffmpeg -i 1602816779831000000.ts -c copy -movflags frag_keyframe+empty_moov+default_base_moof 1602816779831000000.mp4
ffmpeg -i 1602816789831000000.ts -c copy -movflags frag_keyframe+empty_moov+default_base_moof 1602816789831000000.mp4



Unfortunately, this seems to work only for playlists with a single segment (which means, up to 10 seconds in my case). As soon as I have 2+ files, it doesn't work, with a behavior that changes depending on which client I'm using: some will play the first file then stop, some will fast forward to the last file then play this one instead, some won't play at all...


I understand that the "normal" approach for fmp4 streaming over HLS is to use a "media initialization" segment and put it in a
#EXT-X-MAP
header for each segment, which are then usually encoded as *.m4s files instead of *.mp4. However, is it possible to make fmp4 work over HLS with self-contained segments, similarly to what we can do with MPEGTS? Since playlists with a single entry seem to support that, I would assume there is probably a way to do so.

Also, I know Apple got inspired by MPEG-DASH for this part of the HLS spec, and from what I understand, this is possible in MPEG-DASH.


-
ffmpeg only posting playlist but not segments for HLS
13 October 2020, by Yanick SalzmannI am launching an ffmpeg process that is supposed to send the HLS "encoded" data to a webserver that will distribute it to the clients requesting it. I am using the following command line:


"ffmpeg",
 "-hide_banner",
 "-f", "rawvideo",
 "-pixel_format", "rgb32",
 "-video_size", "800x600",
 "-framerate", "22",
 "-i", "-",
 "-f", "hls",
 "-c:v", "libx264",
 "-crf", "17",
 "-preset", "ultrafast",
 "-hls_time", "1",
 "-flags", "+cgop",
 "-g", "30",
 "-hls_segment_filename", "%d.ts",
 "-method", "POST",
 fmt::format("http://localhost:8082/video/{}/live.m3u8", _uuid)



or specifically
ffmpeg -hide_banner -f rawvideo -pixel_format rgb32 -video_size 800x600 -framerate 22 -i - -f hls -c:v libx264 -crf 17 -preset ultrafast -hls_time 1 -flags +cgop -g 30 -hls_segment_filename %d.ts -method POST http://localhost:8082/video/ee811a74-7a48-4c4e-8c82-371c1cbbff05/live.m3u8


The first few lines of the output look fine:


[hls @ 0x224aeb0] Opening '0.ts' for writing
Output #0, hls, to 'http://localhost:8082/video/ee811a74-7a48-4c4e-8c82-371c1cbbff05/live.m3u8':



The file name was picked up, the URL was also properly recognized. After the first file has been generated I also get a
POST
request to the URL mentioned above with thelive.m3u8
containing the following playlist:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:1
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:1.363667,
0.ts



But I do not get the
0.ts
file posted to my webserver. This continues like that, the playlist keeps getting updated, but no segment files are posted to my server. They are all written to the disk and stay there forever.

Am I missing a flag?