
Recherche avancée
Autres articles (91)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
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 -
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)
Sur d’autres sites (4340)
-
Files dissapearing with ffmpeg recursive conversion
13 août 2014, par CaRoXoI started in askubuntu, asking for a way to convert recursively more than 14K of wma to mp3 extracting the wma files path from a txt file.
There was an answer that could cover my needs, but a bug appears. The first run with some hundreds worked ok. The second, some wma albums got converted, others entirely deleted. There were some modifications. And last time completely, deleted all wma without converting.this was the original script
#!/usr/bin/env bash
readarray -t files < wma-files.txt
for file in "${files[@]}"; do
out=`echo $file | sed "s:wma:mp3:"`
probe=`avprobe -show_streams "$file" 2>/dev/null`
rate=`echo "$probe" | grep "bit_rate" | sed "s:.*=\(.*\)[0-9][0-9][0-9][.].*:\1:"`
avconv -i "$file" -ab "$rate"k "$out"
rm "$file"
doneThen the adaptation with ffmpeg
#!/usr/bin/env bash
readarray -t files < wma-files.txt
for file in "${files[@]}"; do
out=`echo $file | sed "s:wma:mp3:"`
probe=`avprobe -show_streams "$file" 2>/dev/null`
rate=`echo "$probe" | grep "bit_rate" | sed "s:.*=\(.*\)[0-9][0-9][0-9][.].*:\1:"`
ffmpeg -i "$file" -ab "$rate"k "$out" && rm "$file"
doneWith the first one I converted many files. Other just get deleted. The ones deleted were always the same release (so, all tracks from a release). I can listen, and even convert them with Soundkonverter.
Both of them produces "no such file of directory" and when this happens, everything get deleted.
The partition where files are stored is a usb HDD ntfs, but also happens in my ext4 internal HD.
Im under Xubuntu 14.04Here the script running with avconv (wich what i managed to convert some, but other get dissapeared) http://pastebin.com/w5weqEws and with ffmpeg (that didn’t convert any) http://pastebin.com/3QkaPzvW
I can’t find differences between successfully and deleted original wma’s. But for example, while other progs like beets read and write the tags, puddletag and mp3tag (under wine) don’t, until I converted them with soundkonverter.
As the person trying to help me there redirect me here on the original post http://askubuntu.com/questions/508278/how-to-use-ffmpeg-to-convert-wma-to-mp3-recursively-importing-from-txt-file/508304#508304
Im here asking for any help to make run an script like this. Or any to use ffmpeg to convert recursively the audio files. My capacity of understanding is short for being able to make something working just reading the docs.So I ask a help to run this. If I miss any relevant information, just tell me.
NOTE : I want to add that doing the conversion with
for file in "${files[@]}"; do
out=`echo "$file" | sed s:wma:mp3:`
avconv -i "$file" -ab 192k "$out"
rm "$file"
doneIt works in the same files (the ones that are deleted with the other). Only that it makes everything to 192k, so not good if Im converting lower bitrate ones. And get this error "Application provided invalid, non monotonically increasing dts to muxer in stream 0" that seems something typical from avconv in 14.04. With ffmpeg I cant try becouse I don’t find the way how to use it, even out of the script. I really don’t understand the docs seems
.NOTE2 : This is a mediainfo exit from :
1- A typical wma that get dissapeared always with the script
Audio
ID : 1
Format : WMA
Format version : Version 2
Codec ID : 161
Codec ID/Info : Windows Media Audio
Description of the codec : Windows Media Audio 9 - 128 kbps, 44 kHz, stereo 1-pass CBR
Duration : 2mn 25s
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Bit depth : 16 bits
Stream size : 2.21 MiB (99%)
Language : English (US)2- A Wma that got succesfully converted (yes Im using copies now, I cant risk specially some rares audios that I got on the road)
Audio
ID : 1
Format : WMA
Format version : Version 2
Codec ID : 161
Codec ID/Info : Windows Media Audio
Description of the codec : Windows Media Audio 9 - 128 kbps, 44 kHz, stereo 1-pass CBR
Duration : 4mn 35s
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Bit depth : 16 bits
Stream size : 4.21 MiB (99%)
Language : English (US)So, as I don’t see difference, but maybe, I’m losing any data to look into ?
-
FFMPEG : Recurring onMetaData for RTMP ? [on hold]
30 novembre 2017, par stevendesuFor whatever reason this was put on hold as "too broad", although I felt I was quite specific. So I’ll try rephrasing here :
My former understanding :
The RTMP Protocol involves sending several parallel streams of data as a series of packets, with an ID correlating to which stream they are a part of. For instance :
[VIDEO] <data>
[AUDIO] <data>
[VIDEO] <data>
[VIDEO] <data>
[SERVER] <metadata about="about" bandwidth="bandwidth">
[VIDEO] <data>
[AUDIO] <data>
...
</data></data></metadata></data></data></data></data>Then on the player side these packets are split up into separate buffers based on type (all video data is concatenated, all audio data is concatenated, etc)
One of the packet types is called
onMetaData
(ID : 0x12)An
onMetaData
packet includes a timestamp for when to trigger the metadata (this way it can be synchronized with the video) as well as the contents of the metadata (a text string)My setup :
I’m using Red5Pro as my ingest server to take in an RTMP stream and then watch this stream via WebRTC. When an
onMetaData
packet is received by Red5, it sends out a JSON object to all subscribers of the stream over WebSockets with the contents of the stream.What I want :
I want to take advantage of this
onMetaData
channel to embed the server’s system clock into a stream. This way anyone viewing the stream can determine when (according to the server) a stream was encoded and, if they synchronize their clock with the server, they can then compute the end-to-end latency of the stream. Due to Red5’s use of WebSockets to send metadata this isn’t a perfect solution (you may receive the metadata before or after you actually receive the video information), however I have some plans to work around this.In other words, I want my stream to look like this :
[VIDEO] <data>
[AUDIO] <data>
[ONMETADATA] time: 2:05:77.382
[VIDEO] <data>
[VIDEO] <data>
[SERVER] <metadata about="about" bandwidth="bandwidth">
[VIDEO] <data>
[ONMETADATA] time: 2:05:77.423
[AUDIO] <data>
...
</data></data></metadata></data></data></data></data>What I would like is to generate this stream (with the server’s current time periodically embedded into the
onMetaData
channel) using FFMPEGSimpler problem :
FFMPEG offers a
-metadata
command-line parameter.In my experiments, using this parameter caused a single
onMetaData
event to be fired including things like "title", "author", etc. I could not inject additionalonMetaData
packets periodically as the stream progressed.Even if the metadata packets do not contain the system clock, if I could send any metadata packets periodically using FFMPEG then I could include something static like "the server’s clock at the time the broadcast started". I can then compare this to the current timestamp of the video and calculate the latency.
My confusion :
Continuing to look into this after creating my post, there are a couple things that I don’t fully understand or which don’t quite make sense to me. For one, if FFMPEG is only injecting a single
onMetaData
packet into the stream, then I would expect anyone joining the stream late to miss it. However when I join the stream 8 hours later I see Red5 send me the metadata packet complete with title, author, etc. So it’s almost like the metadata packet doesn’t have a timestamp associated with it but instead is just generic metadata about the videoFurthermore, there’s something called "AMF" which I’m not familiar with, but it may be important ?
Original Post
I spent today playing around with methods to embed the system clock at time of encode into a stream, so that I could compare this value to the same system clock at time of decode to get a rough estimate of RTMP latency. Unfortunately the majority of techniques I used ended up failing.
One thing I wanted to try next was taking advantage of RTMP’s
onMetaData
to send the current system clock periodically (maybe every 5 seconds) as part of the stream for any clients to listen for.Unfortunately FFMPEG’s
-metadata
option seems to only be for one-time metadata when the stream first loads. I can’t figure out how to add continuous (and generated) values to a stream.Is there a way to do this ?
-
Workflow for creating animated hand-drawn videos - encoding difficulties
8 décembre 2017, par MircodeI want to create YouTube videos, kind of in the style of a white-board animation.
Tldr question : How can I encode into a lossless rgb video format with ffmpeg, including alpha channel ?
More detailed :
My current workflow looks like this :I draw the slides in Inkscape, I group all paths that are to be drawn in one go (one scene so to say) and store the slide as svg. Then I run a custom python script over that. It animates the slides as described here https://codepen.io/MyXoToD/post/howto-self-drawing-svg-animation. Each frame is exported as svg, converted to png and fed to ffmpeg for making a video from it.
For every scene (a couple of paths being drawn, there are several scenes per slide) I create an own video file and then I also store a png file that contains the last frame of that video.
I then use kdenlive to join it all together : A video containing the drawing of the first scene, then a png which holds the last image of the video while I talk about the drawing, then the next animated drawing, then the next still image where I continue talking and so on. I use these intermediate images because freezing the last frame is tedious in kdenlive and I have around 600 scenes. Here I do the editing, adjust the duration of the still images and render the final video.
The background of the video is a photo of a blackboard which never changes, the strokes are paths with a filter to make it look like chalk.
So far so good, everything almost works.
My problem is : Whenever there is a transition between an animation and a still image, it is visible in the final result. I have tried several approaches to make this work but nothing is without flaws.
My first approach was to encode the animations as mp4 like this :
p = Popen(['ffmpeg', '-y', '-f', 'image2pipe', '-vcodec', 'png', '-r', str(fps), '-i', '-', '-vcodec', 'libx264', '-crf', '21', '-bf', '2', '-flags', '+cgop', '-pix_fmt', 'yuv420p', '-movflags', 'faststart', '-r', str(fps), videofile], stdin=PIPE)
which is recommended for YouTube. But then there is a little brightness difference between video and still image.
Then I tried mov with png codec :
p = Popen(['ffmpeg', '-y', '-f', 'image2pipe', '-vcodec', 'png', '-r', str(fps), '-i', '-', '-vcodec', 'png', '-r', str(fps), videofile], stdin=PIPE)
I think this encodes every frame as png in the video. It creates way bigger files since every frame is encoded separately. But it’s ok since I can use transparency for the background and just store the chalk strokes. However, sometimes I want to swipe parts of the chalk on a slide away, which I do by drawing background over it. Which would work if those overlaid, animated background chunks which are stored in the video looked exactly like the underlying png in the background. But it doesn’t. It’s slightly more blurry and I believe the color changes a tiny bit as well. Which I don’t understand since I thought the video just stores a sequence of pngs... Is there some quality setting that I miss here ?
Then I read about ProRes4444 and tried that :
p = Popen(['ffmpeg', '-y', '-f', 'image2pipe', '-vcodec', 'png', '-r', str(fps), '-i', '-', '-c:v', 'prores_ks', '-pix_fmt', 'yuva444p10le', '-alpha_bits', '8', '-profile:v', '4444', '-r', str(fps), videofile], stdin=PIPE)
and this actually seems to work. However, the animation files become larger than the bunch of png files they contain, probably because this format stores 12 bit per channel. This is not thaat horrible since only intermediate videos grow big, the final result is still ok.
But ideally there would be a lossless codec which stores in rgb colorspace with 8 bit per channel, 8 bit for alpha and considers only the difference to the previous frame (because all that changes from frame to frame is a tiny bit of chalk drawing). Is there such a thing ? Alternatively, I’d also be ok without transparency but then I have to store the background in every scene. But if only changes are stored from frame to frame within one scene, that should be manageable.
Or should I make some fundamental changes in my workflow altogether ?
Sorry that this is rather lengthy, I appreciate any help.
Cheers !