
Recherche avancée
Autres articles (21)
-
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 -
L’agrémenter visuellement
10 avril 2011MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté. -
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)
Sur d’autres sites (3293)
-
FFMPEG - Accurately cutting video/audio and merging multiple videos together
8 février 2023, par 3EKThis post has been updated since the original post


thanks in advance for any help I get with this...


I am working with 4 video assets....all stereo audio, same a/v spec.


intro -
mainvideo -
midroll_video (advert) -
endboard


I need to add an audio only cross fade between the 2 video elements part2.mp4 and pip.mp4. These 2 videos are made by the code (rather than being 2 of the 4 videos listed above). I have added in the code as kindly instructed by @Баяр Гончикжапов but unfortunately it is still not working. See conversation below for more info/ the part i need help with.


Thanks in advance !


This is the code I am using.



# Input parameters
mainvideo=mezzfile.mp4
endboard=endboard.mp4
intro=sting.mp4
midroll_video=midroll.mp4

tailtime=20
fadelength=0.2
midroll_edit_value=00:11:31.600

# Time calculations to define cut point
duration=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $mainvideo)
endboard_cut_point=$(echo "scale=2;$duration-$tailtime" | bc)

duration=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $mainvideo)
midroll_cut_point=$(echo "scale=2;$duration-$midroll_edit_value" | bc)

# Safety check
tbn_main=$(ffprobe -v error -select_streams v -show_entries stream=time_base -of default=noprint_wrappers=1:nokey=1 $mainvideo)
tbn_main=${tbn_main#*/}
tbn_intro=$(ffprobe -v error -select_streams v -show_entries stream=time_base -of default=noprint_wrappers=1:nokey=1 $intro)
tbn_intro=${tbn_intro#*/}
tbn_end=$(ffprobe -v error -select_streams v -show_entries stream=time_base -of default=noprint_wrappers=1:nokey=1 $endboard)
tbn_end=${tbn_end#*/}

if [[ $(( ($tbn_intro+$tbn_main+$tbn_end)/3 )) -ne $tbn_main ]]; then
 echo "WARNING: source video files have the different timebase."
 echo "The use of the concat demuxer will produce incorrect output."
 echo "Re-encoding is highly recommended."
 read -s -k $'?Press any key to exit.\n'
 exit 1
fi

# Trim the main part of mainvideo
ffmpeg -hide_banner -y -i $mainvideo -to $midroll_edit_value -c copy part1.mp4

ffmpeg -hide_banner -y -i $mainvideo -ss $midroll_edit_value -to $endboard_cut_point -c copy part2.mp4

ffmpeg -hide_banner -y -i $mainvideo -ss $midroll_edit_value -to $duration -c copy part2av.mp4


# Trim the tail of mainvideo and overlay it onto endboard
ffmpeg -hide_banner -y \
 -i $mainvideo \
 -i $endboard \
 -filter_complex \
 "[0:v]select='gt(t,$duration-$tailtime)',scale=w=iw/2.03:h=ih/2.03,setpts=PTS-STARTPTS[v_tail]; \
 [0:a]aselect='gt(t,$duration-$tailtime)',asetpts=PTS-STARTPTS[a_out]; \
 [1:v][v_tail]overlay=format=auto[v_out]" \
 -map "[v_out]" \
 -map "[a_out]" \
 -video_track_timescale $tbn_main \
 pip.mp4

ffmpeg -hide_banner -y -i "part2.mp4" -i "part2av.mp4" -i "pip.mp4" \
 -filter_complex \
 -map "[0:v];" 
 -map "[1:a];" 
 -map "[2:v]" 
 -c copy "part2pip.mp4" \

# Pass all parts through the concat demuxer
[ -f filelist.txt ] && rm filelist.txt
for f in $intro part1.mp4 $midroll_video part2pip.mp4; do echo "file '$PWD/$f'" >> filelist.txt; done
ffmpeg -hide_banner -y -f concat -safe 0 -i filelist.txt -c copy TEST_FILE.mp4

# Sweep the table
rm pip.mp4 part1.mp4 part2.mp4 filelist.txt```



-
How to convert any format to H264 (html5) video using ffmpeg ? [on hold]
14 juillet 2013, par kheyaI am trying to use a single command to convert avi, mov, wmv etc to H264 (HTML5 playback)
I have command that converted the avi correctly to H264 (created .mp4 file)
But the same command fails to convert a quicktime mov file.I am using the 64bit static built on windows.
Here is the command I used to convert AVI to H264. This one works.
for %%a in ("*.avi") do (
ffmpeg -i "%%a" -c:v libx264 -preset slow -crf 20 -c:a libvo_aacenc -b:a 128k "%%~na.mp4"
)I am trying this to convert mov to H264 :
for %%a in ("*.mov") do (
ffmpeg -i "%%a" -vcodec mpeg4 -acodec libvo_aacenc "%%~na.mp4" //fails
ffmpeg -i "%%a" -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k "%%~na.mp4" //fails with error )Appreciate if you kindly help me.
EDIT :
Here is the error :
[graph 1 input from stream 0:1 @ 0000000002689260] Invalid sample format (null)
Error opening filters !Output of the command :
ffmpeg -i "file2.mov" -vcodec libx264 -vprofile high -preset slow -b:v 500k -ma
xrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a
128k "file2.mp4"
The system cannot find the drive specified.
ffmpeg version N-54691-g7f4a1fd Copyright (c) 2000-2013 the FFmpeg developers
built on Jul 12 2013 16:31:48 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
enable-libxvid --enable-zlib
libavutil 52. 39.100 / 52. 39.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.102 / 55. 12.102
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 80.101 / 3. 80.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file2.mov':
Metadata:
creation_time : 1998-11-12 18:28:20
Duration: 00:00:28.60, start: 0.000000, bitrate: 111 kb/s
Stream #0:0(eng): Video: svq1 (SVQ1 / 0x31515653), yuv410p, 160x120, 90 kb/s
, 7.52 fps, 7.50 tbr, 600 tbn, 600 tbc
Metadata:
creation_time : 1998-11-12 18:28:20
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Audio: qdmc (QDMC / 0x434D4451), 44100 Hz, mono
Metadata:
creation_time : 1998-11-12 18:28:20
handler_name : Apple Alias Data Handler
[graph 1 input from stream 0:1 @ 000000000251a080] Invalid sample format (null)
Error opening filters! -
FFmpeg - PCM audio direct copy error
24 décembre 2013, par YehudiI try to use FFmpeg to redirect a rtp/rtsp streaming from one server to another. But it seems has some problem on my audio copy of PCM. My usage is
ffmpeg -re -max_delay 500000 -i rtsp://admin:password@192.168.2.2/h264 -vcodec copy -acodec copy -f rtsp -muxdelay 0.1 rtsp://192.168.2.6/livetest/live.sdp
and got the result :
ffmpeg version N-59275-g9b195dd Copyright (c) 2000-2013 the FFmpeg developers
built on Dec 21 2013 22:01:05 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 58.101 / 52. 58.101
libavcodec 55. 45.103 / 55. 45.103
libavformat 55. 22.100 / 55. 22.100
libavdevice 55. 5.102 / 55. 5.102
libavfilter 4. 0.100 / 4. 0.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
[h264 @ 02869300] sps_id out of range
Last message repeated 1 times
[h264 @ 02869300] non-existing PPS referenced
[h264 @ 02869300] non-existing PPS 0 referenced
[h264 @ 02869300] decode_slice_header error
[h264 @ 02869300] no frame!
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://admin:password@192.168.2.2/h264':
Metadata:
title : Network Camera Live Session
Duration: N/A, start: 0.000000, bitrate: 64 kb/s
Stream #0:0: Video: h264 (Main), yuv420p, 1280x720, 29.97 tbr, 90k tbn, 180k
tbc
Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
[rtp @ 04ae1020] Cannot respect max delay: frame size = 0
Output #0, rtsp, to 'rtsp://192.168.2.6/livetest/live.sdp':
Metadata:
title : Network Camera Live Session
encoder : Lavf55.22.100
Stream #0:0: Video: h264, yuv420p, 1280x720, q=2-31, 90k tbn, 90k tbc
Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, 64 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[rtp @ 04ae1020] Application provided invalid, non monotonically increasing dts
to muxer in stream 0: 1605 >= 1605
av_interleaved_write_frame(): Invalid argumentThe major errors are
....
[rtp @ 04ae1020] Cannot respect max delay: frame size = 0
...
[rtp @ 04ae1020] Application provided invalid, non monotonically increasing dts
to muxer in stream 0: 1605 >= 1605
av_interleaved_write_frame(): Invalid argumentDo not understand why the direct audio copy would cause this error, could someone kindly prompt how to fix it ?
Thanks