
Recherche avancée
Médias (3)
-
Elephants Dream - Cover of the soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (63)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
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 -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...)
Sur d’autres sites (6709)
-
FFMPEG - how to identify a bottleneck in hardware transcoding ?
26 août 2021, par HenryIn the provided example I was trying to transcode a 4K h264 source to a 1080p h264 output using Nvidia's Hardware acceleration.


Relevant information :


ffmpeg version git-2017-12-25-613f789 Copyright (c) 2000-2017 the FFmpeg developers
 built with gcc 7.2.0 (GCC)
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-amf --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
 libavutil 56. 7.100 / 56. 7.100
 libavcodec 58. 9.100 / 58. 9.100
 libavformat 58. 3.100 / 58. 3.100
 libavdevice 58. 0.100 / 58. 0.100
 libavfilter 7. 7.100 / 7. 7.100
 libswscale 5. 0.101 / 5. 0.101
 libswresample 3. 0.101 / 3. 0.101
 libpostproc 55. 0.100 / 55. 0.100



Command used :


ffmpeg -c:v h264_cuvid -i "4K_input.mp4" -c:v h264_nvenc -preset slow -s 1920x1080 -c:a copy output.mkv



Relevant PC Specs :


GPU: (Gigabyte) GeForce GTX 1070 Ti
CPU: Intel Core i7 7700K
Memory: 8GB DDR4 2400MHz Single Channel.
SSD: Crucial CT525MX3



While the Nvidia Desktop recording has absolutely no issues to record live h264 video in up to 50Mbps bitrates, this encoding at below 2600kbps was extremely slow utilizing barely 35% GPU.
I was unable to utilize 100% of the GPU on any video parameters.


This is why I could use some advice concerning how to identify a (suspected) bottleneck.


-
Set input frame rate in pygame.Camera
14 mai 2018, par Thomas HubregtsenI am trying to get an input stream from a webcam on OS X
self.capture = pygame.camera('/dev/video{}'.format(camera),
(640, 480), 'RGB')I get an error (see below), but there are 2 pieces of information that I can not really stitch together. On first sight, it looks like I do not have the correct camera (not video4linux). However, when running
ffmpeg -f avfoundation -list_devices true -i ""
I get it listed
[AVFoundation input device @ 0x7fbb45700340] [1] FULL HD 1080P Webcam
The next part of the error talks about frame rate. It appears that the frame-rate is slightly off, and that I just next to select a different frame rate. Would this be possible with pygcam ? Would this solve my problem ?
Error :
Traceback (most recent call last):
File "webcam2.py", line 129, in <module>
VideoStreaming("52.191.118.156", 5558, 1)()
File "webcam2.py", line 22, in __call__
with self.get_camera_context(self.camera_id) as frames:
File "webcam2.py", line 89, in __enter__
size=(640, 480))
File "/Users/q433100/temp/brew-master/lib/python3.6/site-packages/imageio/core/functions.py", line 129, in get_reader
return format.get_reader(request)
File "/Users/q433100/temp/brew-master/lib/python3.6/site-packages/imageio/core/format.py", line 169, in get_reader
return self.Reader(self, request)
File "/Users/q433100/temp/brew-master/lib/python3.6/site-packages/imageio/core/format.py", line 218, in __init__
self._open(**self.request.kwargs.copy())
File "/Users/q433100/temp/brew-master/lib/python3.6/site-packages/imageio/plugins/ffmpeg.py", line 327, in _open
self._load_infos()
File "/Users/q433100/temp/brew-master/lib/python3.6/site-packages/imageio/plugins/ffmpeg.py", line 476, in _load_infos
(self.request._video, ffmpeg_err))
IndexError: No video4linux camera at <video1>.
FFMPEG STDERR OUTPUT:
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --prefix=/Users/q433100/temp/brew-master/Cellar/ffmpeg/3.4.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
[avfoundation @ 0x7fbb9e000a00] Selected framerate (29.970030) is not supported by the device
[avfoundation @ 0x7fbb9e000a00] Supported modes:
[avfoundation @ 0x7fbb9e000a00] 160x120@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 176x144@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 320x240@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 352x288@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 640x360@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 640x480@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 800x600@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 1024x576@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 960x720@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 1280x720@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 1392x768@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 1280x960@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 1600x896@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 1920x1080@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 160x120@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 176x144@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 320x240@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 352x288@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 640x360@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 640x480@[30.000030 30.000030]fps
[avfoundation @ 0x7fbb9e000a00] 800x600@[20.000000 20.000000]fps
[avfoundation @ 0x7fbb9e000a00] 1024x576@[8.000000 8.000000]fps
[avfoundation @ 0x7fbb9e000a00] 960x720@[15.000015 15.000015]fps
1: Input/output error
</video1></module>Update :
If I try to force one of the mentioned supported frame rates with ffmped, I get a new error$ffmpeg -f avfoundation -r 30.000030 -i "1" out.mpg
ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --prefix=/Users/q433100/temp/brew-master/Cellar/ffmpeg/3.4.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
[avfoundation @ 0x7fb3c8802600] An error occurred: The activeVideoMinFrameDuration passed is not supported by the device. Use -activeFormat.videoSupportedFrameRateRanges to discover valid ranges.1: Input/output errorUpdate 2 :
Setting the input frame rate to 15 directly in ffmpeg works. Now I just need to figure out how to do this in python with pygame.camera$ ffmpeg -f avfoundation -r 15.000015 -i "1" out.avi
-
Bash script : automate ffmpeg encoding for mpeg-dash
13 février 2018, par Massimo VantaggioI’m writing a bash file to create video encoding and concatenation for dash live streaming use,
Basically it read an input video folder, encodes all videos into three resolution formats, after that it concatening them to create three adaption sets.DIAGRAM :
This script checks for fps conformance,
force/scaling resolution if the input is not 1920 x 1080p,
Insert the channel logo png,
Cut the end of all videos input in order to make them finish with closed gop, this to ensure that there are not videos with audio and video track with different lenght.
ISSUE :
Actually I’m not sure that the concatenation process respects the closed GOP alignment as it after the encoding..
I try to cut also the end of the concatenation result in order to make it finish without decimals on a closed gop too, but im unable to erase all decimals from the total duration :total duration in seconds: 826.795000
total duration corrected in seconds: 826But the real duration measured by ffprobe is
824.044000
I try to check keyframes alignment with mp4box has they teach without any result :
MP4Box -info TRACK_ID source1.mp4 2>&1 | grep GOP
This is the first time that i work with "video scripts" and probably i don’t know what input to give for TRACK_ID
BASH SCRIPT :
#!/bin/bash
#CANCAT 0.2
cd input
times=()
fps=()
for f in *.mp4; do
_t=$(ffprobe -i "$f" -show_entries format=duration -v quiet -of csv="p=0")
times+=("$_t")
_f=$(ffmpeg -i "$f" 2>&1 | sed -n "s/.*, \\(.*\\) fp.*/\\1/p")
fps+=("$_f")
done
#SUM ALL DURATIONS
TOTALDURATION=$( echo "${times[@]}" | sed 's/ /+/g' | bc )
#DELETE DECIMAL
DURROUND=$(echo "$TOTALDURATION" | cut -d'.' -f1)
#GET REST OF DIVISION BY 2 AS GOP
TOTDELTA="$((DURROUND%2))"
#SUBTRACT DELTA FROM TOTAL DURATION
TOTDUR="$(($DURROUND-$TOTDELTA))"
#GET NUMBER OF ELEMENTS IN FPS ARRAY
tLen=${#fps[@]}
#CHECK FPS EQUALITY
for tLen in "${fps[@]:1}"; do
if [[ $tLen != ${fps[0]} ]]; then
printf "WARNING: VIDEO’S FRAME-RATE ARE NOT EQUALS, THE PROCESS CAN’T START."
printf "%s\\0" "${fps[@]}" |
sort -zu |
xargs -0 printf " %s"
printf "\\n"
exit 1
fi
done
for f in *.mp4; do
#GET DURATION OF EACH VIDEO
DUR="$(ffprobe -i "$f" -show_entries format=duration -v quiet -of csv="p=0")"
DUR=$(echo "$DUR" | cut -d'.' -f1) # DELETE DECIMAL
#GET FPS OF EACH VIDEO
FPS="$(ffmpeg -i "$f" 2>&1 | sed -n "s/.*, \(.*\) fp.*/\1/p")"
#ROUND FPS OF EACH VIDEO
FPSC=$( echo "($FPS+0.5)/1" | bc )
#REMOVE EXTENSION FROM VIDEO FILE NAME
NAME=$(echo "$f" | cut -d'.' -f1)
#GET GOP
GOP="$((FPSC*2))"
DELTADUR="$((DUR%2))"
DUR="$(($DUR-$DELTADUR))"
#ENCODE 1080p
ffmpeg -y -i "$f" -i ../logo/logo.png -c:a aac -b:a 384k -ar 48000 -ac 2 -async 1 -c:v libx264 -x264opts keyint=$GOP:min-keyint=$GOP:no-scenecut -bf 0 -r $FPSC -b:v 4800k -maxrate 4800k -bufsize 3000k -profile:v main -crf 22 -t $DUR -filter_complex "[0:v][1:v]overlay=main_w-overlay_w-10:10,scale=1920:1080,setsar=1" ../buffer/${NAME}-1080.mp4
#ENCODE 720p
ffmpeg -y -i ../buffer/${NAME}-1080.mp4 -c:a aac -b:a 256k -ar 48000 -ac 2 -async 1 -c:v libx264 -x264opts keyint=$GOP:min-keyint=$GOP:no-scenecut -bf 0 -s 1280x720 -r $FPSC -b:v 2400k -maxrate 2400k -bufsize 1500k -profile:v main -crf 22 -t $DUR ../buffer/${NAME}-720.mp4
#ENCODE 360p
ffmpeg -y -i ../buffer/${NAME}-720.mp4 -c:a aac -b:a 128k -ar 48000 -ac 2 -async 1 -c:v libx264 -x264opts keyint=$GOP:min-keyint=$GOP:no-scenecut -bf 0 -s 640x360 -r $FPSC -b:v 800k -maxrate 800k -bufsize 500k -profile:v main -crf 22 -t $DUR ../buffer/${NAME}-360.mp4
done
#enter in buffer
cd ..
cd buffer
#CONCAT 1080 SET
# with a bash for loop
for f in ./*1080.mp4; do echo "file '$f'" >> 1080list.txt; done
ffmpeg -f concat -safe 0 -i 1080list.txt -t $TOTDUR -c copy ../output/1080set.mp4
#CONCAT 720 SET
# with a bash for loop
for f in ./*720.mp4; do echo "file '$f'" >> 720list.txt; done
ffmpeg -f concat -safe 0 -i 720list.txt -t $TOTDUR -c copy ../output/720set.mp4
#CONCAT 360 SET
# with a bash for loop
for f in ./*360.mp4; do echo "file '$f'" >> 360list.txt; done
ffmpeg -f concat -safe 0 -i 360list.txt -t $TOTDUR -c copy ../output/360set.mp4
#CLEAN BUFFER
rm *.mp4
rm *.txt
echo "CONCAT COMPLETED:"
echo "frame-rate: $fps"
echo "total duration in seconds: $TOTALDURATION"
echo "total duration corrected in seconds: $TOTDUR"The full file with relative folders :
There is someone who can help me to understand why I can not eliminate the decimals of the total duration during concat ?
And how to check overall keyframes allignment ?
Also any impovement that i ignore is welcome !Thanks a lot !
Massimo