
Recherche avancée
Autres articles (112)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
Publier sur MédiaSpip
13 juin 2013Puis-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
Sur d’autres sites (6993)
-
FFMPEG - infinite file video stream to RTMP server
5 août 2022, par samoht9277I'm trying to create an infinite video stream that I can push to a local RTMP server.


I believe it's worth mentioning that I'm not very good with
ffmpeg
, I started using it some weeks ago.

Here is a similat question, but it doesn't fully answer what I need.


What I tried


At my first attempt, I made a bash script that spawned a new
ffmpeg
instance for each video I was trying to stream. I noticed that that the few seconds that takes to spawn the new instance interrupts the stream.

After I noticed this problem, I decided to google some kind of queue system, and I found that
ffmpeg
has a concat function, that reads a file with a custom syntax and queues it.

So I made a script that lists the files in the directory where I store all my videos, modifies the output with
sed
, shuffles it (so the episodes are random), and then it redirects the output to aplaylist.txt


find /mnt/episode/ -print | sed '/**.mp4/!d' | sed "s/^/file '/; s/$/'/" | shuf > playlist.txt



playlist.txt


example :


...
file '/mnt/episode/9/1.mp4'
file '/mnt/episode/8/4.mp4'
file '/mnt/episode/5/11.mp4'
file '/mnt/episode/7/15.mp4'
...



This creates 2 problems :


- 

- For some reason, while using the playlist/queue method, when it finishes a video... it takes like 30 seconds to switch to the next video.




ffmpeg -f concat -safe 0 -i playlist.txt -f v4l2 /dev/video0



(simplified command, using /dev/video0 device for testing purposes)


ffmpeg
does output something after the first video, but i'm not quite sure what it means.

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55c8abc1b900] st: 1 edit list: 1 Missing key frame while searching for timestamp: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55c8abc1b900] st: 1 edit list 1 Cannot find an index entry before timestamp: 0.



- 

- Once the playlist finishes, the stream is over. I could run the script that generates the playlist again, but that would mean that the stream cuts, which I don't want.





What I want


I need a way to pick a random file, stream it normally via RTMP and once it finished, automatically pick another one without interrupting the streaming, and keep doing this until I decide to turn it off.


This is the directory format :


episodes
│
├── 1
│   ├── 1.mp4
│   ├── 2.mp4
│   ├── 3.mp4
│ ...
├── 2
│   ├── 1.mp4
│   ├── 2.mp4
│   ├── 3.mp4
│ ...
├── 3
│   ├── 1.mp4
│   ├── 2.mp4
│   ├── 3.mp4
│ ...
├── 4
│   ├── 1.mp4
│   ├── 2.mp4
│   ├── 3.mp4
│ ...
├── 5
│   ├── 1.mp4
│   ├── 2.mp4
│   ├── 3.mp4
│ ...
├── 6
│   ├── 1.mp4
│   ├── 2.mp4
│   ├── 3.mp4
│ ...
├── 7
│   ├── 1.mp4
│   ├── 2.mp4
│   ├── 3.mp4
│ ...
├── 8
│   ├── 1.mp4
│   ├── 2.mp4
│   ├── 3.mp4
│ ...
└── 9
 ├── 1.mp4
 ├── 2.mp4
 ├── 3.mp4
 ...



Gladly appreciate some help here. I tried to make the problem as clear as possible.


Thanks <3


-
FFMPEG stream video to Youtube Live
13 juin 2022, par BlessedHITI have a mov file and I'm using ffmpeg to stream it to youtube live using the following command,


ffmpeg -re -i "episode.mov" -pix_fmt yuvj420p -x264-params keyint=48:min-keyint=48:scenecut=-1 -b:v 4500k -b:a 128k -ar 44100 -acodec aac -vcodec libx264 -preset medium -crf 28 -threads 4 -f flv "rtmp://a.rtmp.youtube.com/live2/YOUTUBE.LIVESTREAM.KEY"



But im getting the following message on youtube,


YouTube is not receiving enough video to maintain smooth streaming. As such, viewers will experience buffering



My ffmpeg output showed my bitrate being between 800 - 1000 mbps, way lower than what i have specified in my ffmpeg command.


I am using a not so powerful virtual machine, and so i thought this might be why i am not getting the desired bitrate.


To overcome my hardware limitations, I then decided to encode the file for streaming using this command :


ffmpeg -i episode.mov -c:v libx264 -preset medium -b:v 4500k -maxrate 4500k -bufsize 6000k -vf "scale=1280:-1,format=yuv420p" -g 50 -c:a aac -b:a 128k -ac 2 -ar 44100 episode.flv



Then I stream copy the file using :


ffmpeg -re -i episode.flv -c copy -f flv "rtmp://a.rtmp.youtube.com/live2/YOUTUBE.LIVESTREAM.KEY"



And that seems to give me a stream that youtube is happy with.


My question is, is there a way I can rewrite my ffmpeg command to livestream with the desired bitrate without needing to first encode my mov to another file or is adding more memory the only way forward here ?


-
Ffmpeg - How can I create HLS multiple language streams, in multiple qualities ?
28 avril 2022, par Daniel EllisPreface


I'm working on converting videos from 4k to multiple qualities with multiple languages but am having issues with the multiple languages overlaying, sometimes losing quality and sometimes being out of sync. (this is less of a problem in the German audio, as this is voice over anyhow)


We as a team are complete noobs in terms of Video / Audio + HLS — I'm a front end developer who has no experience of this so apologies if my question is poorly phrased



Videos


I have the video in a 4k format and have removed the original sound as I have English and German audio files that need to be overlayed. I am then taking these files and throwing them together into a .ts file like this :


$ ffmpeg -i ep03-ns-4k.mp4 -i nkit-ep3-de-output.m4a -i nkit-ep3-en-output.m4a \
> -thread 0 -muxdelay 0 -y \
> -map 0:v -map 1 -map 2 -movflags +faststart -refs 1 \
> -vcodec libx264 -acodec aac -profile:v baseline -level 30 -ar 44100 -ab 64k -f mpegts out.ts 



This outputs a 4k
out.ts
video, with both audio tracks playing.

The hard part


This is where I'm finding it tricky, I now need to convert this single file into multiple quality levels (480, 720, 1080, 1920) and I attempt this with the following command :


ffmpeg -hide_banner -y -i out.ts \
-crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -ar 48000 \
-map 0:v:0 -map 0:v:0 -map 0:v:0 -map 0:v:0 \
-c:v:0 h264 -profile:v:0 main -filter:v:0 "scale=w=848:h=480:force_original_aspect_ratio=decrease" -b:v:0 1400k -maxrate:v:0 1498k -bufsize:v:0 2100k \
-c:v:1 h264 -profile:v:1 main -filter:v:1 "scale=w=1280:h=720:force_original_aspect_ratio=decrease" -b:v:1 2800k -maxrate:v:1 2996k -bufsize:v:1 4200k \
-c:v:2 h264 -profile:v:2 main -filter:v:2 "scale=w=1920:h=1080:force_original_aspect_ratio=decrease" -b:v:2 5600k -maxrate:v:2 5992k -bufsize:v:2 8400k \
-c:v:3 h264 -profile:v:3 main -filter:v:3 "scale=w=3840:h=1920:force_original_aspect_ratio=decrease" -b:v:3 11200k -maxrate:v:3 11984k -bufsize:v:3 16800k \
-var_stream_map "v:0 v:1 v:2 v:3" \
-master_pl_name master.m3u8 \
-f hls -hls_time 4 -hls_playlist_type vod -hls_list_size 0 \
-hls_segment_filename "%v/episode-%03d.ts" "%v/episode.m3u8"



This creates the required qualities, but I'm now at a loss of how this might work with the audio


Audio


For the audio I run this command :


ffmpeg -i out.ts -threads 0 -muxdelay 0 -y -map 0:a:0 -codec copy -f segment -segment_time 4 -segment_list_size 0 -segment_list audio-de/audio-de.m3u8 -segment_format mpegts audio-de/audio-de_%d.aac
ffmpeg -i out.ts -threads 0 -muxdelay 0 -y -map 0:a:1 -codec copy -f segment -segment_time 4 -segment_list_size 0 -segment_list audio-en/audio-en.m3u8 -segment_format mpegts audio-en/audio-en_%d.aac




This creates the required audio segments.


The question


I realise this is quite an ask, but is there anything wrong with our inputs ? Is there a way that this can be done a bit more streamlined ?


Any answers are greatly appreciated.