
Recherche avancée
Autres articles (91)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
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
Sur d’autres sites (15828)
-
Adding prebuild static library to android studio
24 mars 2017, par David BarishevI have build ffmpeg libraries statically for x86 android using a custom configuration.Now i wanted to add them in my android project.
Im using ffmpeg 3.2.git, android studio 2.3.
I created a folder named distribution which had my binaries, located the root of my project.
Here is a file tree :|__distribution
| |__avcodec
| | |__include
| | | |__avcodec.h
| | |__lib
| | | |__x86
| | | | |__libavcodec.a
| |__avfilter
| | |__include
| | | |__avfilter.h
| | |__lib
| | | |__x86
| | | | |__libavfilter.a
| |__avformat
| | |__include
| | | |__avformat.h
| | |__lib
| | | |__x86
| | | | |__libavformat.a
| |__avutil
| | |__include
| | | |__avutil.h
| | |__lib
| | | |__x86
| | | | |__libavutil.a
| |__swresample
| | |__include
| | | |__swresample.h
| | |__lib
| | | |__x86
| | | | |__libswresample.aI edited my cmake to include the libraries :
add_library(
native-lib
SHARED
src/main/cpp/native-lib.cpp )
set(distribution_DIR ${CMAKE_SOURCE_DIR}/../distribution)
add_library(lib_avcodec STATIC IMPORTED)
set_target_properties(lib_avcodec PROPERTIES IMPORTED_LOCATION
${distribution_DIR}/avcodec/lib/${ANDROID_ABI}/libavcodec.a)
add_library(lib_avfilter STATIC IMPORTED)
set_target_properties(lib_avfilter PROPERTIES IMPORTED_LOCATION
${distribution_DIR}/avfilter/lib/${ANDROID_ABI}/libavfilter.a)
add_library(lib_avformat STATIC IMPORTED)
set_target_properties(lib_avformat PROPERTIES IMPORTED_LOCATION
${distribution_DIR}/avformat/lib/${ANDROID_ABI}/libavformat.a)
add_library(lib_avutil STATIC IMPORTED)
set_target_properties(lib_avutil PROPERTIES IMPORTED_LOCATION
${distribution_DIR}/avutil/lib/${ANDROID_ABI}/libavutil.a)
add_library(lib_swresample STATIC IMPORTED)
set_target_properties(lib_swresample PROPERTIES IMPORTED_LOCATION
${distribution_DIR}/swresample/lib/${ANDROID_ABI}/libswresample.a)
include_directories(
${distribution_DIR}/avcodec/include
${distribution_DIR}/avfilter/include
${distribution_DIR}/avformat/include
${distribution_DIR}/avutil/include
${distribution_DIR}/swresample/include)
target_link_libraries(
native-lib
lib_avcodec
lib_avfilter
lib_avformat
lib_avutil
lib_swresample
)I also restricted the build to only x86, in my app build.gradle :
ndk {
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your APK.
abiFilters 'x86'
}The project gradle sync worked successfully.
I edited my cpp file to try to use the libraries, and i noticed something weird,i couldn’t reference the headers with the library beforehand, only the header name itself (eg.#include "libavformat/avformat.h"
doesn’t work,#include "avformat.h"
works).
I suspect this is because of the headers reference, that they are not tied to a library.
How can i fix it ?Also this makes the project build fail, since in the static libraries headers, there is a reference to other part of the library (eg avformat includes avcodec),but they reference it with the library name beforehand, and as i have said earlier, it doesn’t work.
Here is the relevant build log part :
../../../../../distribution/avformat/include\avformat.h:319:10: fatal error: 'libavcodec/avcodec.h' file not found
#include "libavcodec/avcodec.h"
^ -
PowerShell and ffmpeg : No such file or directory
8 juillet 2022, par Matt WilsonI'm trying to use the below command in a Python script, however I'm seeing that it's a PowerShell issue in that it can't seem to find the video file I'm pointing to.


I have a video file on a cloud drive
Z:
at the following location (for reproducibility, change this to whatever path you want with a video file in it) :

Z:\Udemy_And_Misc_Downloads\TensorFlow Developer Certificate in 2021 Zero to Mastery\3. Neural network regression with TensorFlow\18. Setting up TensorFlow modelling experiments part 2 (increasing complexity).mp4


Notice the spaces and special characters in the filename in case that matters.


What I'm trying to do is down-sample that video file to a smaller size with the following command :


ffmpeg -i "Z:\Udemy_And_Misc_Downloads\TensorFlow Developer Certificate in 2021 Zero to Mastery\[TutsNode.com] - TensorFlow Developer Certificate in 2021 Zero to Mastery\3. Neural network regression with TensorFlow\18. Setting up TensorFlow modelling experiments part 2 (increasing complexity).mp4" -y -vcodec libx264 -acodec ac3 -threads 1 "Z:\Udemy_And_Misc_Downloads\TensorFlow Developer Certificate in 2021 Zero to Mastery\[TutsNode.com] - TensorFlow Developer Certificate in 2021 Zero to Mastery\3. Neural network regression with TensorFlow\18. Setting up TensorFlow modelling experiments part 2 (increasing complexity)DOWNSAMPLED.mp4"


I know it's long as it's mostly consumed by the filenames, but the error I'm getting is :


Z:\Udemy_And_Misc_Downloads\TensorFlow Developer Certificate in 2021 Zero to Mastery\[TutsNode.com] - TensorFlow Developer Certificate in 2021 Zero to Mastery\3. Neural network regression with TensorFlow\18. Setting up TensorFlow modelling experiments part 2 (increasing complexity).mp4: No such file or directory


The path IS correct, as it's a direct copy paste from the folder's URL bar.


The things I've tried include :


- 

- using quotes around filename
- not using quotes around filename
- prepending quoted filename with "r" (where I got message saying `did you mean file:r ?)
- prepending quoted filename with "file:r"
- used double slashes \ in filepaths












Is there a powershell pro out there that can tell me why it can't "find" the file ?


UPDATE
The command runs if I find a filename with :


$oldvids = Get-ChildItem *.mp4, *mov, *wmv, *avi -Recurse
foreach ($oldvid in $oldvids) 
{
 $newvid = [io.path]::ChangeExtension($oldvid.FullName, '_.mp4')
 ffmpeg -i $oldvid.FullName -y -vcodec libx264 -acodec ac3 -threads 1 $newvid
}



When I print the
$oldvid.name
and$oldvid.FullName
, the paths/filenames look like this :

Z:\Udemy_And_Misc_Downloads\TensorFlow Developer Certificate in 2021 Zero to Mastery\5. Computer Vision and Convolutional Neu
ral Networks in TensorFlow\35. Multi-class CNN's part 9 Making predictions with our model on custom images.mp4

35. Multi-class CNN's part 9 Making predictions with our model on custom images.mp4



...that first one being an exact copy of what I'm trying to use in my posted code. So what's the difference ??


SECOND UPDATE
I think the issue lies in that the file is located on a drive other than
C:
. Just tested it by moving the file onto my computer and running the command, and it worked. So I guess, is there a way to tell PowerShell to use theZ:
drive to find the file ?

-
MoviePy Create Video that keeps audio on Twitter
26 janvier 2019, par SDSI’m exporting lots of videos and was planning to use them on Twitter.
When I read the documentation the first time I (foolishly) thought I only had to worry about the dimensions and the rest would take care of itself.
I have many files that look and play great on my PC but as soon as I load them into Twitter there is no audio.
Twitter’s Media Best Practices are located here :Recommended Video Codec: H264 High Profile
Recommended Frame Rates: 30 FPS, 60 FPS
Recommended Video Resolution: 1280x720 (landscape), 720x1280 (portrait), 720x720 (square)
Recommended Minimum Video Bitrate: 5,000 kbps
Recommended Minimum Audio Bitrate: 128 kbps
Recommended Audio Codec: AAC LC
Recommended Aspect Ratio: 16:9 (landscape or portrait), 1:1 (square)
Advanced:
Frame rate must be 60 FPS or less
Dimensions must be between 32x32 and 1280x1024
File size must not exceed 512 mb
Duration must be between 0.5 seconds and 140 seconds
Aspect ratio must be between 1:3 and 3:1
Must have 1:1 pixel aspect ratio
Only YUV 4:2:0 pixel format is supported
Audio must be AAC with Low Complexity profile. High-Efficiency AAC is not supported
Audio must be mono or stereo, not 5.1 or greater
Must not have open GOP
Must use progressive scanHere’s the specs on a specific video :
Video ----
Length: 00:00:12
Frame width 1280
Frame height 720
Data rate 238kbps
Total bitrate 368kbps
Frame rate 24.00 frames/second
Audio --
Bit rate 129 kbps
Channels 2 (stereo)
Audio sample rate 44.100 kHz
File --
Size 551 KB
Item type MP4 FileThe code is fairly straightforward. I grab an image and make a short intro frame with it, then add two short clips and put it all together as you can see here :
image_clip = ImageClip(my_image) image_clip.set_duration(seconds).write_videofile('F:/sm_Temp_Files/trash_%s.mp4' % fname,fps=24)
image_video_clip = mpy.VideoFileClip('F:/sm_Temp_Files/trash_%s.mp4' % fname)
video_path = (my_video_path)
video_clip = mpy.VideoFileClip(video_path, target_resolution = (h,w),audio=True)
outro_clip = mpy.VideoFileClip('Logo_Intro_w_Stinger_Large.mp4',target_resolution = (h,w),audio=True)
clips = [image_video_clip,video_clip,image_video_clip,video_clip,image_video_clip,outro_clip]
slided_clips = [CompositeVideoClip([clip.fx( transfx.crossfadein, transition_seconds)]) for clip in clips]
c = concatenate_videoclips(slided_clips)
c.write_videofile('F:/sm_Short_Video/sm_%s.mp4' % fname,fps=24)I’ll admit, I’m out of my league to know what to do next. When Googling it looks like others have had similar issues but show fixes in FFMpeg, like this example.
Yes, I know MoviePy is written on top of FFMpeg but for a novice like me it would be really nice if there was tweaks I could do inside of MoviePy to get the audio to work on Twitter.
Thank you in advance !