
Recherche avancée
Autres articles (54)
-
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 (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...) -
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 (...)
Sur d’autres sites (9778)
-
ffmpeg : adding a stream non-muxed stream with correct codec type tagging
13 janvier 2021, par HamishIn common use, I believe ffmpeg requires inputs to be in a specified muxer format which contains one or more data streams which can be decoded with a codec supported by the demuxer associated with the format. I have a data stream (not audio or video) which is already encoded with a codec but is not muxed. How can I get this stream into the ffmpeg pipeline with the correct codec type assigned so that the muxer knows what to do with it ?


I have tried streaming the data over UDP and specifying the
data
demuxer. With some combinations I get get it to say it's streaming, I can never get a player to connect, presumable because the output ofmpegts
is either null or invalid. Command line :

ffmpeg -v verbose ^
-f flv -listen 1 -i rtmp://127.0.0.1:1101 ^
-f data -i udp://127.0.0.1:1300 ^
 -map 0:v -vcodec mpeg2video -map 1:d -f mpegts -mpegts_m2ts_mode 1 udp://localhost:1200



Result (partial) :


Input #0, flv, from 'rtmp://127.0.0.1:1101':
 Metadata:
 encoder : Lavf58.29.100
 Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: h264 (Constrained Baseline), 1 reference frame, yuv420p(progressive, left), 5760x1080 (5760x1088), 30 fps, 30 tbr, 1k tbn, 60 tbc
 Stream #0:1: Audio: mp3, 48000 Hz, stereo, fltp, 128 kb/s
Input #1, data, from 'udp://127.0.0.1:1300':
 Duration: N/A, start: 0.000000, bitrate: N/A
 Stream #1:0: Data: none
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (native))
 Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[h264 @ 00000180d48ae700] Reinit context to 5760x1088, pix_fmt: yuv420p
[graph 0 input from stream 0:0 @ 00000180d489dcc0] w:5760 h:1080 pixfmt:yuv420p tb:1/1000 fr:30/1 sar:0/1
[mpegts @ 00000180d5f64040] Cannot automatically assign PID for stream 1
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
[AVIOContext @ 00000180d48b83c0] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 00000180d4882080] Statistics: 185593 bytes read, 0 seeks
[AVIOContext @ 00000180d5f469c0] Statistics: 204 bytes read, 0 seeks
Conversion failed!



The codec type name is
klv
, which has the tagKLVA
. It is only supported by thempegts
andmxf
(de)muxers. I presume there must be a way of getting into the pipeline without having a validmpegts
ormxf
stream in the first place otherwise we have a kind of paradox.

I've tried specifying the codec on the input, but it fails validation, I guess because the
data
demuxer does not support it.

Somehow
mp4
files can be muxed from elemental streams (h264
andaac
files), but I guess there must be some special case in the code to force the codec type based on the file extension.

I would really love to do this from the command line with a public build but if this is absolutely not possible, I would also welcome some advice about it could be achieved from C++ code.


-
Why does calling ffmpeg from python's popen break screen capture functionality ?
4 mars 2016, par JabbI am trying to create screen captures from mp4 files in python.
Calling ffmpeg on the command line works fine. But as soon, as I issue the same command through python "popen", functionality breaks with an error that ffmpeg cannot find the moov atom. Can anyone explain this to me ?This is how I call ffmpeg from python :
def ffmpegGetScreenshot(self,inputFilename,index,startTime):
my_env = os.environ.copy()
my_env.update({'PATH': '/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'})
filename = inputFilename.split("/")[1]
directory = inputFilename.split("/")[0]
if os.path.isfile('videoscreenshots/'+filename+"_cs"+str(index)+".jpg"):
return 'videoscreenshots/'+filename+"_cs"+str(index)+".jpg"
print "get screenshots for: " + inputFilename
command = [ FFMPEG_BIN,
'-y',
'-i', inputFilename,
'-ss', str(int(startTime)),
'-vframes', '1',
#'-loglevel','quiet',
'videoscreenshots/'+filename+"_cs"+str(index)+".jpg"
]
pipe = sp.Popen(command, env=my_env,stdin = sp.PIPE,stdout = sp.PIPE, stderr=None)
print command
return 'videoscreenshots/'+filename+"_cs"+str(index)+".jpg"Result :
ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (Debian 4.9.2-10)
configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libspeex --enable-shared --enable-pthreads --enable-libopenjpeg --enable-libfaac --enable-nonfree
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / 56. 36.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x652120] moov atom not found
videochunks/test.mp4: Invalid data found when processing input
test.mp4This is the same command called on the console
/usr/local/bin/ffmpeg -y -i videochunks/test.mp4 -ss 9 -vframes 1 videoscreenshots/test.mp4_cs2.jpg
Result :
root@3:/app# /usr/local/bin/ffmpeg -y -i videochunks/test.mp4 -ss 9 -vframes 1 videoscreenshots/test.mp4_cs2.jpg
ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (Debian 4.9.2-10)
configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-libspeex --enable-shared --enable-pthreads --enable-libopenjpeg --enable-libfaac --enable-nonfree
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / 56. 36.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'videochunks/test.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : Test
composer : Test
album : Test
encoder : Lavf56.36.100
Duration: 00:00:10.01, start: 0.000000, bitrate: 520 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 4:3 DAR 16:9], 436 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 97 kb/s (default)
Metadata:
handler_name : SoundHandler
[swscaler @ 0x648260] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'videoscreenshots/test_cs2.jpg':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : Test
composer : Test
album : Test
encoder : Lavf56.36.100
Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 320x240 [SAR 4:3 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc56.41.100 mjpeg
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
frame= 1 fps=0.0 q=3.9 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:11kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown -
ffmpeg detects a videofile path when it does not exist
17 novembre 2020, par Nejc Kejzarthis is boggling my mind. I am using ffmpeg to compress videos within the following python script :


import re
import os

kage = 'MH5'
year = '2020'
month = '11'
day = '10'

# Set output dir; create it if it doesn't exist yet
downsampled_video_dir = home_data_dir + f'piCamera/downsampled_videos/{kage}/{year}/{month}/{day}/'
Path(downsampled_video_dir).mkdir(parents=True, exist_ok=True)
 
for i, video in enumerate(videos):
 # Set ffmpeg video compression terminal command and output directory for downsampled videos
 video_name = re.findall('\d+_\d+.mp4', video)[0]
 ds_output = downsampled_video_dir + video_name
 compress_command = f"ffmpeg -i {video} -vf scale={video_res[0]}:-2 {ds_output}"
 
 # Run ffmpeg video compression
 os.system(compress_command)



videos
is a list of full video paths of the videos that I wish to compress, andds_output
is a full path of where to write the compressed video.video_res[0]
contains the desired height of the video with the following-2
automatically calculating the width so that the aspect ratio is preserved.

For some reason when running this, ffmpeg detects some of the videos in the output directory as already existing and asks if I wish to overwrite them. The videos of course aren't there yet, so when I pass
y
, ffmpeg complains that no such file exists. Here is an example output for one of the problematic videos :

ffmpeg -y -i '/home/piCamera/MH4/2020/11/10/20201110_085451.mp4' -vf scale=400:300 '/home/piCamera/downsampled_videos/MH4/2020/11/10/20201110_085451.mp4'
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
 configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/piCamera/MH4/2020/11/10/20201110_085451.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.20.100
 Duration: 00:03:58.84, start: 0.000000, bitrate: 1190 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x720, 1190 kb/s, 5 fps, 5 tbr, 10240 tbn, 20480 tbc (default)
 Metadata:
 handler_name : VideoHandler
/home/piCamera/downsampled_videos/MH4/2020/11/10/20201110_085451.mp4: No such file or directory



This happens with about 3 videos out of 53, the rest run normally. I've tried restarting the terminal, deleted the whole created
downsampled_video_dir
and run again, but no matter how many times I restart, the same videos are the problem. The only thing that appears to help is if I change the output directory name. Any ideas of why this strange error is happening ?

This is being run on Ubuntu20 with python3.7.9 in a Jupyter Notebook.


Many, many thanks for all the insights !