
Recherche avancée
Autres articles (52)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
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 -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (13212)
-
ffmpeg video slides vertically after 'Invalid buffer size, packet size expected frame_size' error (vsync screen tearing glitch) ?
7 juillet 2020, par GlabbichRulzI have a video which i want to cut and crop using opencv and ffmpeg.




I want the output to be H265, so i am using a ffmpeg subprocess (writing frame bytes to stdin) as explained here. This is a minimum version of my code that leads to the error :


import os, shlex, subprocess, cv2, imutils

VIDEO_DIR = '../SoExample' # should contain a file 'in.mpg'
TIMESPAN = (3827, 3927) # cut to this timespan (frame numbers)
CROP = dict(min_x=560, max_x=731, min_y=232, max_y=418) # crop to this area

# calculate output video size
size = (CROP['max_x']-CROP['min_x'], CROP['max_y']-CROP['min_y']) # (w,h)
# ffmpeg throws an error when having odd dimensions that are not dividable by 2,
# so i just add a pixel to the size and stretch the original image by 1 pixel later.
size_rounded = (size[0]+1 if size[0] % 2 != 0 else size[0],
 size[1]+1 if size[1] % 2 != 0 else size[1])

# read input video
vid_path_in = os.path.join(VIDEO_DIR, 'in.mpg')
cap = cv2.VideoCapture(vid_path_in)
fps = int(cap.get(cv2.CAP_PROP_FPS))

# generate and run ffmpeg command
ffmpeg_cmd = (f'/usr/bin/ffmpeg -y -s {size_rounded[0]}x{size_rounded[1]} -pixel_format'
 + f' bgr24 -f rawvideo -r {fps} -re -i pipe: -vcodec libx265 -pix_fmt yuv420p'
 + f' -crf 24 -x265-params "ctu=64" "{os.path.join(VIDEO_DIR, "out.mp4")}"')
print("using cmd", ffmpeg_cmd)
process = subprocess.Popen(shlex.split(ffmpeg_cmd), stdin=subprocess.PIPE)

# seek to the beginning of the cutting timespan and loop through frames of input video
cap.set(cv2.CAP_PROP_POS_FRAMES, TIMESPAN[0])
frame_returned = True
while cap.isOpened() and frame_returned:
 frame_returned, frame = cap.read()
 frame_number = cap.get(cv2.CAP_PROP_POS_FRAMES) - 1

 # check if timespan end is not reached yet
 if frame_number < TIMESPAN[1]:

 # crop to relevant image area
 frame_cropped = frame[CROP['min_y']:CROP['max_y'],
 CROP['min_x']:CROP['max_x']]

 # resize to even frame size if needed:
 if size != size_rounded:
 frame_cropped = imutils.resize(frame_cropped, width=size_rounded[0],
 height=size_rounded[1])

 # Show processed image using opencv: I see no errors here.
 cv2.imshow('Frame', frame_cropped)

 # Write cropped video frame to input stream of ffmpeg sub-process.
 process.stdin.write(frame_cropped.tobytes())
 else:
 break

 # Press Q on keyboard to exit earlier
 if cv2.waitKey(25) & 0xFF == ord('q'):
 break

process.stdin.close() # Close and flush stdin
process.wait() # Wait for sub-process to finish
process.terminate() # Terminate the sub-process

print("Done!")



Unfortunately, my output looks like this :




The output should not include this vertical sliding glitch. Does anyone know how to fix it ?


My console output for aboves script shows :


using cmd /usr/bin/ffmpeg -y -s 172x186 -pixel_format bgr24 -f rawvideo -r 23 -i pipe: -vcodec libx265 -pix_fmt yuv420p -crf 24 -x265-params "ctu=64" "../SoExample/out.mp4"
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
 configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
 WARNING: library configuration mismatch
 avcodec configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
 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
Input #0, rawvideo, from 'pipe:':
 Duration: N/A, start: 0.000000, bitrate: 17659 kb/s
 Stream #0:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24, 172x186, 17659 kb/s, 23 tbr, 23 tbn, 23 tbc
Stream mapping:
 Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (libx265))
x265 [info]: HEVC encoder version 2.6
x265 [info]: build info [Linux][GCC 7.2.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-2 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: Slices : 1
x265 [info]: frame threads / pool features : 2 / wpp(3 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 23 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb : 1 / 1 / 0
x265 [info]: References / ref-limit cu / depth : 3 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress : CRF-24.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 rskip signhide tmvp strong-intra-smoothing
x265 [info]: tools: deblock sao
Output #0, mp4, to '../SoExample/out.mp4':
 Metadata:
 encoder : Lavf57.83.100
 Stream #0:0: Video: hevc (libx265) (hev1 / 0x31766568), yuv420p, 172x186, q=2-31, 23 fps, 11776 tbn, 23 tbc
 Metadata:
 encoder : Lavc57.107.100 libx265
[rawvideo @ 0x564ebd221aa0] Invalid buffer size, packet size 51600 < expected frame_size 95976 
Error while decoding stream #0:0: Invalid argument
frame= 100 fps= 30 q=-0.0 Lsize= 36kB time=00:00:04.21 bitrate= 69.1kbits/s speed=1.25x 
video:32kB audio:0kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 12.141185%
x265 [info]: frame I: 1, Avg QP:22.44 kb/s: 179.77 
x265 [info]: frame P: 29, Avg QP:24.20 kb/s: 130.12 
x265 [info]: frame B: 70, Avg QP:29.99 kb/s: 27.82 
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 20.0% 3.3% 16.7% 43.3% 16.7% 

encoded 100 frames in 3.35s (29.83 fps), 59.01 kb/s, Avg QP:28.23
Done!



As you can see, there is an error :
Invalid buffer size, packet size 51600 < expected frame_size 95976 Error while decoding stream #0:0: Invalid argument
, do you think this could be the cause to the shown problem ? I am not sure, as in the end, it tells me all 100 frames would have been encoded.

In case you want to reproduce this on the exact same video, you can find
actions1.mpg
in the UCF Aerial Action Dataset.

I would greatly appreciate any help as i am really stuck on this error.


-
App Store Submission Fails Due to Unsupported Architectures and Invalid Segment Alignment [closed]
2 juin, par Ahsanur RahmanI’m using ffmpegkit in my iOS app, but when I submit the app to the App Store, I get these errors :




Validation failed

Unsupported Architectures. The executable for MyApp.app/Frameworks/ffmpegkit.framework contains unsupported architectures '[x86_64]'. (ID : 3e35bca7-7b8f-4c2b-bfb2-a27c8ad70c45)

Validation failed

Unsupported Architectures. The executable for MyApp.app/Frameworks/libavcodec.framework contains unsupported architectures '[x86_64]'. (ID : fd864260-dae3-4816-bdf3-ca7389374242)

Validation failed

Unsupported Architectures. The executable for MyApp.app/Frameworks/libavdevice.framework contains unsupported architectures '[x86_64]'. (ID : fd743847-5d46-4679-8193-51db9445fde1)

Validation failed

Unsupported Architectures. The executable for MyApp.app/Frameworks/libavfilter.framework contains unsupported architectures '[x86_64]'. (ID : 54492aff-601e-471a-aef7-25f0549a6364)

Validation failed

Unsupported Architectures. The executable for MyApp.app/Frameworks/libavformat.framework contains unsupported architectures '[x86_64]'. (ID : 37bcd80d-7b17-4f95-a20f-577dbb29fc36)

Validation failed

Unsupported Architectures. The executable for MyApp.app/Frameworks/libavutil.framework contains unsupported architectures '[x86_64]'. (ID : ead0bd08-84e6-475e-9ce3-9e1c012bafa5)

Validation failed

Unsupported Architectures. The executable for MyApp.app/Frameworks/libswresample.framework contains unsupported architectures '[x86_64]'. (ID : fe647420-760c-4404-a039-30c102d7d313)

Validation failed

Unsupported Architectures. The executable for MyApp.app/Frameworks/libswscale.framework contains unsupported architectures '[x86_64]'. (ID : 7c8946d8-d75f-455c-b6fd-1bd555abb99f)

Validation failed

Invalid Segment Alignment. The app binary at 'MyApp.app/Frameworks/ffmpegkit.framework/ffmpegkit' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version. (ID : 8603e3f0-0235-4f3c-a87f-c263945a11d9)

Validation failed

Invalid Segment Alignment. The app binary at 'MyApp.app/Frameworks/libavcodec.framework/libavcodec' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version. (ID : f10b4561-0a9c-4aa6-969a-9d3a892be9ec)

Validation failed

Invalid Segment Alignment. The app binary at 'MyApp.app/Frameworks/libavdevice.framework/libavdevice' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version. (ID : 2e6d495a-9131-43da-b6a8-8c23b8d10415)

Validation failed

Invalid Segment Alignment. The app binary at 'MyApp.app/Frameworks/libavfilter.framework/libavfilter' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version. (ID : 40016424-045d-470f-b40a-fba391de2c98)

Validation failed

Invalid Segment Alignment. The app binary at 'MyApp.app/Frameworks/libavformat.framework/libavformat' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version. (ID : f8cc4367-25bb-4932-bd03-af6729fe7587)

Validation failed

Invalid Segment Alignment. The app binary at 'MyApp.app/Frameworks/libavutil.framework/libavutil' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version. (ID : 495572f9-2dcb-472b-97ea-d16ba6e239a9)

Validation failed

Invalid Segment Alignment. The app binary at 'MyApp.app/Frameworks/libswresample.framework/libswresample' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version. (ID : 5722d5f0-0f81-422f-8389-e744c73cfd67)

Validation failed

Invalid Segment Alignment. The app binary at 'MyApp.app/Frameworks/libswscale.framework/libswscale' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version. (ID : 1e4bf706-5e56-423d-b600-a8298eff698f)

Validation failed

The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker. (ID : 8695bbb6-991f-46cd-9b70-bd86dcef4212)



I add the below code in a runscript :


APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)"

EXTRACT_ARCHS=$(lipo -info "$FRAMEWORK_EXECUTABLE_PATH" | rev | cut -d ':' -f1 | rev)
ARCHS_TO_REMOVE=""

for ARCH in $EXTRACT_ARCHS; do
 if [ "$ARCH" != "arm64" ]; then
 ARCHS_TO_REMOVE="$ARCHS_TO_REMOVE -remove $ARCH"
 fi
done

if [ ! -z "$ARCHS_TO_REMOVE" ]; then
 lipo $ARCHS_TO_REMOVE "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH" || exit 1
fi
done



I have already tried some suggestion from online but nothing worked.


-
Technology used in modern video editors to show the video preview in real time instantly
4 août 2024, par shashwat bajpaiCan anyone tell me about the technology used in modern video editors like : veed.io , canva etc which display the changes applied on the video in realtime , eg : Like applying transitions on a video , adding audio on the video .


Like right now in my video editor I am using FFMPEG AND WASM and it takes a decent amount of time to apply these effects and display the preview.