
Recherche avancée
Autres articles (38)
-
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 (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, 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
Sur d’autres sites (4476)
-
ffmpeg : concat and encode with one command
15 mars 2018, par Massimo VantaggioI have a script that automates encode and concat a series of input video files.
I’m trying to get encode and concat in a single command.At the moment it does not work causing immense empty pauses in the final video output.
I would like to get the result with concat demux instead of concat protocol because it is much harder to automate in a script
Do you know if it is possible to archive this result with concat demux ?
Thanks a lot !Massimo
ENCODE / CONCAT 1080p
for f in ./*.mp4; do echo "file '$f'" >> list.txt; done
ffmpeg -f concat -safe 0 -y -i list.txt -i ../logo/logo.png -c:a aac -b:a 384k -ar 48000 -ac 2 -af aresample=async=1000 -c:v libx264 -x264opts keyint=50:min-keyint=50:no-scenecut -bf 0 -r 25 -b:v 4800k -maxrate 4800k -bufsize 3000k -profile:v main -crf 22 -filter_complex "[0:v][1:v]overlay=main_w-overlay_w-10:10,scale=1920:1080,setsar=1" ../buffer/1080set.mp4It seems to add long pause at low frame-rate :
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb03f05e600] Auto-inserting h264_mp4toannexb bitstream filter
frame= 9745 fps= 13 q=27.0 size= 186368kB time=00:18:52.56 bitrate=1348.0kbits
frame= 9745 fps= 13 q=27.0 size= 186368kB time=00:18:56.57 bitrate=1343.3kbits/
frame= 9745 fps= 13 q=27.0 size= 186368kB time=00:19:00.65 bitrate=1338.5kbits/
frame= 9745 fps= 13 q=27.0 size= 186368kB time=00:19:02.29 bitrate=1336.5kbits/
More than 1000 frames duplicated
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
Metadata:
major_brand : mp42
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 2016-02-27T22:25:49.000000Z
encoder : HandBrake 0.10.5 2016021100
Duration: 00:06:29.87, start: 0.000000, bitrate: 3447 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 768x432, 3282 kb/s, 25 fps, 25 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2016-02-27T22:25:49.000000Z
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s (default)
Metadata:
creation_time : 2016-02-27T22:25:49.000000Z
handler_name : Stereo
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
Metadata:
major_brand : M4V
minor_version : 1
compatible_brands: M4V mp42isom
creation_time : 2016-02-27T18:52:37.000000Z
Duration: 00:07:16.93, start: 0.000000, bitrate: 1184 kb/s
Stream #1:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 768x432, 991 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
Metadata:
creation_time : 2016-02-27T18:52:37.000000Z
handler_name : Mainconcept MP4 Video Media Handler
encoder : AVC Coding
Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
Metadata:
creation_time : 2016-02-27T18:52:37.000000Z
handler_name : Mainconcept MP4 Sound Media Handler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '3.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
creation_time : 2017-06-27T17:58:17.000000Z
Duration: 00:05:05.05, start: 0.000000, bitrate: 2622 kb/s
Stream #2:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 768x432, 2301 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
Metadata:
creation_time : 2017-06-27T17:58:17.000000Z
handler_name : Alias Data Handler
encoder : AVC Coding
Stream #2:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
Metadata:
creation_time : 2017-06-27T17:58:17.000000Z
handler_name : Alias Data Handler
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from '4.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
creation_time : 2017-06-27T17:53:32.000000Z
Duration: 00:06:47.36, start: 0.000000, bitrate: 3144 kb/s
Stream #3:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 768x432, 2819 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
Metadata:
creation_time : 2017-06-27T17:53:32.000000Z
handler_name : Alias Data Handler
encoder : AVC Coding
Stream #3:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
Metadata:
creation_time : 2017-06-27T17:53:32.000000Z
handler_name : Alias Data Handler -
Video from images in Python
26 février 2018, par R. PattersonI can draw a series of images using plt.draw() and plt.pause() so it produces something similar to an animation in the python window. I have modified each of the images with various labels, drawings etc.
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import math
def display(Intensity):
l = plt.Line2D(Intensity[0],Intensity[1],color='yellow') #draw ROI/IAL
ax = plt.gca()
ax.add_line(l)
plt.axis('off')
plt.pause(0.05)
plt.draw()
plt.clf()
#rotate region of interest
def rotate(origin,Intensity,increment):
ox, oy = origin #coordinates of centre or rotation
x_points=[]
y_points=[]
angle=math.radians(increment)#change in angle between each image
for i in range(0,len(Intensity[0])):
px, py = Intensity[0][i], Intensity[1][i]
qx = ox+math.cos(angle)*(px-ox)-math.sin(angle)*(py-oy)
x_points.append(qx)
qy = oy+math.sin(angle)*(px-ox)+math.cos(angle)*(py-oy)
y_points.append(qy)
rotatecoordinates=[]
rotatecoordinates.append(x_points)
rotatecoordinates.append(y_points)
return rotatecoordinates
def animation(list, Intensity):
inc=0
for value in list:
item = np.array(value)
rotated=rotate([128,128],Intensity,inc)
im=plt.imshow(item, interpolation='nearest')
display(rotated)
inc+=1
Image_list=[]
for i in range(0,50):
array=np.linspace(0,1,256*256)
mat=np.reshape(array,(256,256))
img=Image.fromarray(np.uint8(mat*255),'L') #create images
Image_list.append(img)
myROI=([100,150,150,100,100],[100,100,150,150,100]) #region of interest on image
animation(Image_list,myROI)I would like to produce a video file using the images produced. I can’t use the module imageio, imagemagick, opencv, cv2 etc. I think ffmpeg would work, I have the following code.
def save():
os.system("ffmpeg -r 1 -i img%01d.png -vcodec mpeg4 -y movie.mp4")I don’t understand how to use it in relation to the code I already have. It doesn’t take any arguments, how would I relate it to the images I have ? I know how to use imagej/fiji to produce videos from images but I would like to do this in python and also it runs out of memory (I have a lot of images, over 2000). Any help would be appreciated, thank you.
-
Convert mp4 video to avi video using imageio package
3 février 2018, par Li.ChenyangI use the python
imageio
package to convert a.mp4
video to a.avi
video, keeping the fps and size same. The following is my code :import imageio
src_dir = "my/source/video.mp4"
dst_dir = "my/dst/video.avi"
reader = imageio.get_reader(src_dir)
fps = reader.get_meta_data()['fps']
writer = imageio.get_writer(dst_dir, fps=fps)
for im in reader:
writer.append_data(im[:, :, :])
writer.close()I successfully make it.
However, I find that thevideo.mp4
is 27.1 MB, while thevideo.avi
is only 3.70 MB.
Then I usecv2
to do the same thing :import cv2
src_dir = "my/source/video.mp4"
dst_dir = "my/dst/video_1.avi"
video_cap = cv2.VideoCapture(src_dir)
fps = video_cap.get(cv2.cv.CV_CAP_PROP_FPS)
size = (int(video_cap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)),
int(video_cap.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)))
video_writer = cv2.VideoWriter(dst_dir, cv2.cv.CV_FOURCC('M', 'J', 'P', 'G'), fps, size)
success, frame = video_cap.read()
while success:
video_writer.write(frame)
success, frame = video_cap.read()This time I get a
video_1.avi
, which is 65.6 MB.
My questions :- What is the different between these two method, why the
video.avi
(usingimageio
method) is so small ; - Is there any problem to use the
video.avi
(usingimageio
method) to train a 3D-CNN instead of usingvideo_1.avi
(usingcv2
method) ?
supplement
Here is the information of my video file :lichenyang@lichenyang-All-Series:~/chalearn2014/script$ file video.mp4
video.mp4: ISO Media, MPEG v4 system, version 2
lichenyang@lichenyang-All-Series:~/chalearn2014/script$ file video.avi
video.avi: RIFF (little-endian) data, AVI, 640 x 480, 20.00 fps, video: H.264 X.264 or H.264
lichenyang@lichenyang-All-Series:~/chalearn2014/script$ file video_1.avi
video_1.avi: RIFF (little-endian) data, AVI, 640 x 480, 20.00 fps, video: Motion JPEG - What is the different between these two method, why the