
Recherche avancée
Autres articles (100)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
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 (...)
Sur d’autres sites (11408)
-
How to resize video but do not stretch/modify original video using ffmpeg [migrated]
8 mars 2023, par Kujo Ludin -
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>