
Recherche avancée
Autres articles (50)
-
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 -
Soumettre améliorations et plugins supplémentaires
10 avril 2011Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...) -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)
Sur d’autres sites (6560)
-
Why does the PyAV-encoded video have a different total time in seconds than the original file
13 octobre 2023, par Diego MedeirosI'm taking a mp4 file, decoding it frame by frame and reencoding it. I'm using PyAV and the reencoding is running on h265.
When the code is running, it seems that all frames are passed from the decoder to the encoder, but at the end I have a file with 3 seconds less. For longer videos I'll have bigger differences.


I have already checked the fps, it comes out with a very small variation, even if I use the Fraction type to avoid decimal differences.


I'd like to know if it's some parametrization error, or if this is something to do with the encoder itself like keyframes and all those sort of things. Is there a way to fix it ?


import av


container = av.open('input.mp4')

# create an output container to receive the transcoded video packets
output_container = av.open('output.mp4', 'w', format='mp4')
# add a stream to output container with same fps as input and h265 codec
output_stream = output_container.add_stream(
 'libx265', rate=container.streams.video[0].average_rate)
# set the output stream size
output_stream.width = 640
output_stream.height = 480

print('Starting transcoding...')

actual_frame = 0
container_total_frames = container.streams.video[0].frames

# start decoding packets and reading frames from the container
try:
 for packet_input in container.demux():
 if packet_input.dts is None:
 break
 for frame in packet_input.decode():

 try:
 actual_frame += 1
 # convert the frame to a numpy array
 img = frame.to_ndarray(format='bgr24')

 # prepare the ndarray frame and encode it
 frame_nd = av.VideoFrame.from_ndarray(img, format='bgr24')
 packet_output = output_stream.encode(frame_nd)
 output_container.mux(packet_output)
 print('Frame: {}/{}'.format(actual_frame, container_total_frames))
 except Exception as e:
 print("Error writing frame: ", e)
 break
except Exception as e:
 print('Finished transcoding')

output_container.close()

print('Finished transcoding')




-
Batch encode then compare file size vs original and delete larger
6 novembre 2019, par PolarBearCurrently running a batch script to mass convert media clips to save some storage space. I’d like to also add automation to the script that after the conversion will delete which ever ends up being the larger file. Not entirely sure how to best set that up at the end of each conversion.
pushd "%2"
::Default variables
SET paths=paths.txt
::paths lets you put a bunch of folder paths in a text file and run this across those, instead of individually. I use this to run overnight on a LOT of footage folders at once. Thanks to Aayla for a lot of these upgrades
::Fun tip - select your folders (15 max at a time) and shift+rig-!click and click "copy as paths"
SET /A ffmpeg_qv=24
::change CQP value here so you only have to type it once. 22 is lossless for HEVC.
::for /R %%A in (*.mp4, *.avi, *.mov, *.wmv, *.ts, *.m2ts, *.mkv, *.mts) do (
:: echo Processing %%A
:: ffmpeg -hwaccel auto -i "%%A" -pix_fmt p010le -map 0:v -map 0:a -c:v hevc_nvenc -rc constqp -qp 21 -b:v 0K -c:a libfdk_aac -vbr 5 -movflags +faststart "%%A~dnpA_CRF%ffmpeg_qv%_HEVC.mp4"
:: echo Processed %%A
::)
::pause
::Test if the paths file exists and iterate through it
if EXIST %paths% (
for /f "tokens=*" %%a in (%paths%) do (
echo Changing to directory %%a
pushd "%%a"
CALL :ffmpeg
)
) else (
::It doesn't exist
CALL :ffmpeg
)
pause
EXIT /B %ERRORLEVEL%
::Don't run the function when they're first defined because that's a thing Batch does for some reason???
:ffmpeg
for /R %%A in (*.mp4, *.avi, *.mov, *.wmv, *.ts, *.m2ts, *.mkv, *.mts) do (
echo Processing "%%A"
ffmpeg -hwaccel auto -i "%%A" -pix_fmt yuv420p -map 0:v -map 0:a -map_metadata 0 -c:v hevc_nvenc -rc constqp -qp %ffmpeg_qv% -b:v 0K -c:a aac -b:a 128k -movflags +faststart -movflags use_metadata_tags "%%A~dnpA_CRF%ffmpeg_qv%_HEVC.mp4"
:: "-map_metadata 0" copies all metadata from source file
:: "-movflags +faststart" helps with audio streaming
echo Processed %%A
:: echo inFile %%A outFile %%A~dnpA_CRF%ffmpeg_qv%_HEVC.mp4
:: code here to check if A>B or B<a then="then" delete="delete" the="the" larger="larger" of="of" two="two" goto="goto"></a>code> -
Black screen when recording specific screen / window using ffmpeg [closed]
16 mai, par Mark BrinIssue :
I'm trying to capture the specific window using
ffmpeg
& i've tried these below command for that :

ffmpeg -f gdigrab -framerate 30 -i title="Window Title" -b:v 3M -pix_fmt yuv420p output_FILENAME.webm



And also try changing output format to
.mp4


ffmpeg -f gdigrab -framerate 30 -i title="Window Title" -b:v 3M -pix_fmt yuv420p output_FILENAME.mp4



but the output video just shows the black screen with cursor.


What i've tried :


- 

-
Tried online solutions like Recording Screen with FFmpeg, How to record a specific window using ffmpeg ?, Record specific window using ffmpeg, but none of them worked.


-
even tried some of the tweaks like removing flags like
-pix_fmt yuv420p
also tried-f d3d11grab
but didn't work.

-
When i try desktop capture it works completely fine.


-
I'm using this command to confirm that i'm using correct window title












Get-Process |
 Where-Object { $_.MainWindowTitle -ne "" } |
 Select-Object -Unique MainWindowTitle



System I'm using :


Windows 11


-