
Recherche avancée
Médias (29)
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (22)
-
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 -
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (5979)
-
VLC command line : RTSP to mp4 file (video + audio)
8 février 2016, par Dmitriy GerashenkoWin 7 x64.
When I watch this link in VLC player all is fine :
rtsp ://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov
When I try to capture link to file and to display :
- There is video without sound on display.
- Created file is not playable.
Command :
vlc.exe -vvv "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov" --sout="#transcode{venc=ffmpeg,vcodec=mp4v,vfilter=canvas{width=800,height=600},aenc=ffmpeg{strict=-2},acodec=mp4a}:duplicate{dst=display,dst=standard{access=file,mux=mp4,dst=video.mp4}"
There are some errors in log, for example :
MPEG4GenericRTPSource Warning: Unknown or unsupported "mode": AAC-hbr
. Is it cause of my problems ? How to solve my issue ?Complete log (from VLCJ) :
cd C:\Users\gda\Documents\NetBeansProjects\Video; "JAVA_HOME=C:\\Program Files (x86)\\Java\\jdk1.8.0_71" cmd /c "\"\"C:\\Users\\gda\\AppData\\Roaming\\NetBeans\\8.0.2\\maven\\bin\\mvn.bat\" -Dexec.args=\"-classpath %classpath ru.cherezweb.app.video.Video\" -Dexec.executable=\"C:\\Program Files (x86)\\Java\\jdk1.8.0_71\\bin\\java.exe\" -Dmaven.ext.class.path=C:\\Users\\gda\\AppData\\Roaming\\NetBeans\\8.0.2\\maven-nblib\\netbeans-eventspy.jar -Dfile.encoding=UTF-8 process-classes org.codehaus.mojo:exec-maven-plugin:1.2.1:exec\""
Scanning for projects...
------------------------------------------------------------------------
Building Video 1.0-SNAPSHOT
------------------------------------------------------------------------
--- maven-resources-plugin:2.5:resources (default-resources) @ Video ---
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory C:\Users\gda\Documents\NetBeansProjects\Video\src\main\resources
--- maven-compiler-plugin:2.3.2:compile (default-compile) @ Video ---
Nothing to compile - all classes are up to date
--- exec-maven-plugin:1.2.1:exec (default-cli) @ Video ---
20:37:29.097 [main] INFO uk.co.caprica.vlcj.Info - vlcj: 3.10.1
20:37:29.101 [main] INFO uk.co.caprica.vlcj.Info - java: 1.8.0_71 Oracle Corporation
20:37:29.101 [main] INFO uk.co.caprica.vlcj.Info - java home: C:\Program Files (x86)\Java\jdk1.8.0_71\jre
20:37:29.101 [main] INFO uk.co.caprica.vlcj.Info - os: Windows 10 10.0 x86
20:37:29.103 [main] DEBUG u.c.c.vlcj.discovery.NativeDiscovery - discover()
20:37:29.103 [main] DEBUG u.c.c.vlcj.discovery.NativeDiscovery - jnaLibraryPath=null
20:37:29.103 [main] DEBUG u.c.c.vlcj.discovery.NativeDiscovery - discoveryStrategy=uk.co.caprica.vlcj.discovery.linux.DefaultLinuxNativeDiscoveryStrategy@176c05c
20:37:29.104 [main] DEBUG u.c.c.vlcj.discovery.NativeDiscovery - supported=false
20:37:29.104 [main] DEBUG u.c.c.vlcj.discovery.NativeDiscovery - discoveryStrategy=uk.co.caprica.vlcj.discovery.windows.DefaultWindowsNativeDiscoveryStrategy@1eb6432
20:37:29.104 [main] DEBUG u.c.c.vlcj.discovery.NativeDiscovery - supported=true
20:37:29.104 [main] DEBUG u.c.c.v.d.AbstractNativeDiscoveryStrategy - discover()
20:37:29.105 [main] DEBUG u.c.c.v.r.windows.WindowsRuntimeUtil - getVlcInstallDir()
20:37:29.430 [main] DEBUG u.c.c.v.d.AbstractNativeDiscoveryStrategy - directoryNames=[C:\Program Files (x86)\VideoLAN\VLC, C:\Users\gda\Documents\NetBeansProjects\Video, C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter, C:\Program Files (x86)\Intel\iCLS Client\, C:\Program Files\Intel\iCLS Client\, C:\PROGRAMDATA\ORACLE\JAVA\JAVAPATH, C:\Windows\SYSTEM32, C:\Windows, C:\Windows\SYSTEM32\WBEM, C:\Windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0\, C:\PROGRAM FILES\INTEL\INTEL(R) MANAGEMENT ENGINE COMPONENTS\DAL, C:\PROGRAM FILES\INTEL\INTEL(R) MANAGEMENT ENGINE COMPONENTS\IPT, C:\PROGRAM FILES (X86)\INTEL\INTEL(R) MANAGEMENT ENGINE COMPONENTS\DAL, C:\PROGRAM FILES (X86)\INTEL\INTEL(R) MANAGEMENT ENGINE COMPONENTS\IPT, C:\Program Files\Intel\Intel(R) Management Engine Components\DAL, C:\Program Files\Intel\Intel(R) Management Engine Components\IPT, C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL, C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT, C:\Program Files\WIDCOMM\Bluetooth Software\, C:\Program Files\WIDCOMM\Bluetooth Software\syswow64, C:\Program Files\TortoiseSVN\bin, C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common, C:\Program Files\OpenVPN\bin, C:\WINDOWS\system32, C:\WINDOWS, C:\WINDOWS\System32\Wbem, C:\WINDOWS\System32\WindowsPowerShell\v1.0\, C:\Program Files\TortoiseGit\bin, C:\Program Files (x86)\Skype\Phone\]
20:37:29.430 [main] DEBUG u.c.c.v.d.AbstractNativeDiscoveryStrategy - directoryName=C:\Program Files (x86)\VideoLAN\VLC
20:37:29.430 [main] DEBUG u.c.c.v.d.AbstractNativeDiscoveryStrategy - Matched 'libvlc.dll' in 'C:\Program Files (x86)\VideoLAN\VLC'
20:37:29.430 [main] DEBUG u.c.c.v.d.AbstractNativeDiscoveryStrategy - Matched 'libvlccore.dll' in 'C:\Program Files (x86)\VideoLAN\VLC'
20:37:29.430 [main] DEBUG u.c.c.v.d.AbstractNativeDiscoveryStrategy - Matched all required files
20:37:29.430 [main] DEBUG u.c.c.v.d.AbstractNativeDiscoveryStrategy - result=C:\Program Files (x86)\VideoLAN\VLC
20:37:29.430 [main] DEBUG u.c.c.vlcj.discovery.NativeDiscovery - path=C:\Program Files (x86)\VideoLAN\VLC
20:37:29.431 [main] INFO u.c.c.vlcj.discovery.NativeDiscovery - Discovery found libvlc at 'C:\Program Files (x86)\VideoLAN\VLC'
true
2.2.1 Terry Pratchett (Weatherwax)
20:37:29.490 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - initX=null
20:37:29.494 [main] INFO u.c.c.vlcj.binding.LibVlcFactory - vlc: 2.2.1 Terry Pratchett (Weatherwax), changeset 2.2.1-0-ga425c42
20:37:29.494 [main] INFO u.c.c.vlcj.binding.LibVlcFactory - libvlc: C:\Program Files (x86)\VideoLAN\VLC\libvlc.dll
20:37:29.494 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - MediaPlayerFactory(libvlc=Proxy interface to Native Library ,libvlcArgs=[])
20:37:29.494 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - jna.library.path=null
20:37:29.494 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - VLC_PLUGIN_PATH=null
20:37:29.529 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - instance=native@0x1195650 (uk.co.caprica.vlcj.binding.internal.libvlc_instance_t@1195650)
20:37:29.529 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - equalizerAvailable=true
20:37:29.529 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - createEqualizerBandFrequencies()
20:37:29.529 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - numBands=10
20:37:29.530 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - result=[31.25, 62.5, 125.0, 250.0, 500.0, 1000.0, 2000.0, 4000.0, 8000.0, 16000.0]
20:37:29.530 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - createEqualizerPresetNames()
20:37:29.530 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - numPresets=18
20:37:29.530 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - result=[Flat, Classical, Club, Dance, Full bass, Full bass and treble, Full treble, Headphones, Large Hall, Live, Party, Pop, Reggae, Rock, Ska, Soft, Soft rock, Techno]
20:37:29.530 [main] DEBUG u.c.c.vlcj.player.MediaPlayerFactory - newHeadlessMediaPlayer()
20:37:29.538 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - DefaultMediaPlayer(libvlc=Proxy interface to Native Library , instance=native@0x1195650 (uk.co.caprica.vlcj.binding.internal.libvlc_instance_t@1195650))
20:37:29.538 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - createInstance()
20:37:29.543 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - mediaPlayerInstance=native@0x16853ac4 (uk.co.caprica.vlcj.binding.internal.libvlc_media_player_t@16853ac4)
20:37:29.544 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - mediaPlayerEventManager=native@0x16878818 (uk.co.caprica.vlcj.binding.internal.libvlc_event_manager_t@16878818)
20:37:29.544 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - registerEventListener()
20:37:29.546 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerMediaChanged
20:37:29.567 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.567 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerNothingSpecial
20:37:29.567 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.567 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerOpening
20:37:29.567 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.567 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerBuffering
20:37:29.567 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.567 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerPlaying
20:37:29.567 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.567 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerPaused
20:37:29.568 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.568 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerStopped
20:37:29.568 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.568 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerForward
20:37:29.568 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.568 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerBackward
20:37:29.568 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.568 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerEndReached
20:37:29.568 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerEncounteredError
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerTimeChanged
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerPositionChanged
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerSeekableChanged
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerPausableChanged
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerTitleChanged
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.569 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerSnapshotTaken
20:37:29.570 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.570 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerLengthChanged
20:37:29.570 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.570 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerVout
20:37:29.570 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.570 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerScrambledChanged
20:37:29.570 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.572 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - playMedia(mrl=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov,mediaOptions=[:sout=#transcode{venc=ffmpeg,vcodec=mp4v,vfilter=canvas{width=800,height=600},aenc=ffmpeg{strict=-2},acodec=mp4a}:duplicate{dst=display,dst=standard{access=file,mux=mp4,dst=yahoo.m4v}}])
20:37:29.573 [main] DEBUG u.c.c.v.player.MediaResourceLocator - encodeMrl(mrl=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov)
20:37:29.573 [main] DEBUG u.c.c.v.player.MediaResourceLocator - MRL does not contain any Unicode characters
20:37:29.573 [main] DEBUG u.c.c.v.player.MediaResourceLocator - result=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov
20:37:29.574 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - playMedia(media=SimpleMedia[mrl=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov,mediaOptions=[Ljava.lang.String;@17c74e5])
20:37:29.574 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - prepareMedia(media=SimpleMedia[mrl=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov,mediaOptions=[Ljava.lang.String;@17c74e5])
20:37:29.574 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - setMedia(media=SimpleMedia[mrl=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov,mediaOptions=[Ljava.lang.String;@17c74e5])
20:37:29.574 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - createMediaInstance(media=SimpleMedia[mrl=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov,mediaOptions=[Ljava.lang.String;@17c74e5])
20:37:29.574 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - Treating mrl as a location
20:37:29.574 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - mediaInstance=native@0x16876500 (uk.co.caprica.vlcj.binding.internal.libvlc_media_t@16876500)
20:37:29.574 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - mediaOption=:sout=#transcode{venc=ffmpeg,vcodec=mp4v,vfilter=canvas{width=800,height=600},aenc=ffmpeg{strict=-2},acodec=mp4a}:duplicate{dst=display,dst=standard{access=file,mux=mp4,dst=yahoo.m4v}}
20:37:29.575 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - registerMediaEventListener()
20:37:29.575 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaMetaChanged
20:37:29.575 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.575 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaSubItemAdded
20:37:29.575 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.576 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaDurationChanged
20:37:29.576 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.576 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaParsedChanged
20:37:29.576 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.576 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaFreed
20:37:29.576 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.576 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaStateChanged
20:37:29.576 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.576 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaSubItemTreeAdded
20:37:29.576 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=0
20:37:29.585 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - mrl(mediaInstance=native@0x16876500 (uk.co.caprica.vlcj.binding.internal.libvlc_media_t@16876500))
20:37:29.587 [pool-2-thread-1] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - mediaChanged(mediaPlayer=uk.co.caprica.vlcj.player.headless.DefaultHeadlessMediaPlayer@1727f27,media=native@0x16876500 (uk.co.caprica.vlcj.binding.internal.libvlc_media_t@16876500),mrl=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov)
20:37:29.588 [pool-2-thread-1] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - Raising event for new media
20:37:29.588 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - result=true
20:37:29.588 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - play()
20:37:29.593 [main] DEBUG u.c.c.vlcj.player.DefaultMediaPlayer - after play
MPEG4GenericRTPSource Warning: Unknown or unsupported "mode": AAC-hbr
[1682c9cc] core input error: ES_OUT_RESET_PCR called
[16f79744] core decoder error: cannot continue streaming due to errors
[1682c9cc] core input error: ES_OUT_RESET_PCR called
[h264 @ 1702ba80] decode_slice_header error
[h264 @ 1702ba80] decode_slice_header error
[16828134] stream_out_transcode stream out: input interval 41666 (base 2)
[16828134] stream_out_transcode stream out: output interval 41666 (base 1) -
AWS lambda mp4 thumbnail generator using ffmpeg - incorrect format generated
10 avril 2021, par sam bhanduI am trying to create a thumbnail generator for every mp4 file uploaded to the s3 bucket. I have been following this post published by AWS. The code works fine for the transcoding video file. I changed the code to generate a thumbnail. The code does generate a file but it is an invalid image type.


import json
import os
import subprocess
import shlex
import boto3
import uuid

S3_DESTINATION_BUCKET = "example-bucket"
SIGNED_URL_TIMEOUT = 60

def lambda_handler(event, context):

 # s3_source_bucket = event['Records'][0]['s3']['bucket']['name']
 # s3_source_key = event['Records'][0]['s3']['object']['key']
 # s3_source_basename = os.path.splitext(os.path.basename(s3_source_key))[0]
 # s3_destination_filename = s3_source_basename + "_cfr.ts"
 
 hex_c = uuid.uuid4()
 s3_destination_filename = '/{}/{}.{}'.format('tmp',hex_c, 'jpg')
 s3_client = boto3.client('s3')
 s3_media_url = 'https://s3-us-west-2.amazonaws.com/example-bucket/videos/presentations/testing.mp4'
 ffmpeg_cmd = "/opt/bin/ffmpeg -i \"" + s3_media_url + "\" -ss 00:00:02 -vframes 1 \"" + s3_destination_filename + "\""
 # ffmpeg_cmd = "/opt/bin/ffmpeg -i \"" + s3_source_signed_url + "\" -f mpegts -c:v copy -af aresample=async=1:first_pts=0 -"
 
 command1 = shlex.split(ffmpeg_cmd)
 p1 = subprocess.run(command1, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 
 resp = s3_client.put_object(Body=s3_destination_filename, Bucket=S3_DESTINATION_BUCKET, Key='{}{}'.format(hex_c, '.jpg'))
 return {
 'statusCode': 200,
 'body': json.dumps('Processing complete successfully')
 }



Output is as :


{
 "statusCode": 200,
 "body": "\"Processing complete successfully\""
}

Function Logs
START RequestId: b73aaacc-5da5-417a-9f98-5def438dee96 Version: $LATEST
ffmpeg version 4.1.3-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
 configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzvbi --enable-libzimg
 libavutil 56. 22.100 / 56. 22.100
 libavcodec 58. 35.100 / 58. 35.100
 libavformat 58. 20.100 / 58. 20.100
 libavdevice 58. 5.100 / 58. 5.100
 libavfilter 7. 40.101 / 7. 40.101
 libswscale 5. 3.100 / 5. 3.100
 libswresample 3. 3.100 / 3. 3.100
 libpostproc 55. 3.100 / 55. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://s3-us-west-2.amazonaws.com/example-bucket/videos/presentations/testing.mp4':
 Metadata:
 major_brand : isom
 minor_version : 1
 compatible_brands: isomavc1mp42
 creation_time : 2020-04-17T18:31:33.000000Z
 Duration: 00:00:33.07, start: 0.000000, bitrate: 90 kb/s
 Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 854x480 [SAR 1:1 DAR 427:240], 23 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc (default)
 Metadata:
 creation_time : 2020-04-17T18:31:29.000000Z
 Stream #0:1(eng): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s (default)
 Metadata:
 creation_time : 2020-04-17T18:31:29.000000Z
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x67ddc40] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/tmp/4633bb13-4a15-49b7-a445-d910bebaddf6.jpg':
 Metadata:
 major_brand : isom
 minor_version : 1
 compatible_brands: isomavc1mp42
 encoder : Lavf58.20.100
 Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 854x480 [SAR 1:1 DAR 427:240], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)
 Metadata:
 creation_time : 2020-04-17T18:31:29.000000Z
 encoder : Lavc58.35.100 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x 
frame= 1 fps=0.4 q=6.3 Lsize=N/A time=00:00:00.03 bitrate=N/A speed=0.0149x 
video:14kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
END RequestId: b73aaacc-5da5-417a-9f98-5def438dee96
REPORT RequestId: b73aaacc-5da5-417a-9f98-5def438dee96 Duration: 6349.25 ms Billed Duration: 6350 ms Memory Size: 155 MB Max Memory Used: 123 MB Init Duration: 368.12 ms

Request ID
b73aaacc-5da5-417a-9f98-5def438dee96



An image file is uploaded to the S3 folder, but when I try to open it flags an invalid file format. The file size is only 40.0 Bytes.
S3 bucket image folder
invalid file format


-
AWS Lambda : ffmpeg thumbnails Generator : empty JPG
3 septembre 2020, par MagikeyWhen a video is uploaded on S3 i want to store a JPG screenshot.



On a lambda function with amazon AWS, i do :



...

 let tmpFile = createWriteStream(`/tmp/screenshot.jpg`)

 var ffmpeg = spawn(ffmpegPath, [
 "-ss","00:00:05",
 "-i", target,
 "-vf", "thumbnail,scale=200:200", 
 "-qscale:v" ,"2",
 "-frames:v", "1",
 "-f", "image2",
 "-c:v", "mjpeg",
 "pipe:1"
 ]);

 ffmpeg.stdout.pipe(tmpFile).on("error", err => {
 console.log("Error A: ",err);
 });

 ffmpeg.on('error', err => {
 console.log("Error B", err)
 reject()
 })

 ffmpeg.on('close', code => {
 tmpFile.end();
 console.log('Log A', ffmpeg);

 child_process.exec("echo `ls -l -R /tmp`",
 (error, stdout, stderr) => {
 console.log(stdout)
 });

 resolve()
 })
...




But the result is an empty JPG file in S3.



Logs shows no errors, my "target" is OK, stdout ls show me the empty JPG file.



I have try a lot of things, like use other version of ffmpeg but same.



There is the "console.log('Log A', ffmpeg)" :



ChildProcess {
 _events: [Object: null prototype] { error: [Function], close: [Function] },
 _eventsCount: 2,
 _maxListeners: undefined,
 _closesNeeded: 3,
 _closesGot: 3,
 connected: false,
 signalCode: 'SIGSEGV',
 exitCode: null,
 killed: false,
 spawnfile: '/opt/nodejs/ffmpeg',
 _handle: null,
 spawnargs: [
 '/opt/nodejs/ffmpeg',
 '-ss',
 '00:00:05',
 '-i',
 'https://xxxxxxxxx',
 '-vf',
 'thumbnail,scale=200:200',
 '-qscale:v',
 '2',
 '-frames:v',
 '1',
 '-f',
 'image2',
 '-v',
 '16',
 '-c:v',
 'mjpeg',
 'pipe:1'
 ],
 pid: 24,
 stdin: Socket {
 connecting: false,
 _hadError: false,
 _parent: null,
 _host: null,
 _readableState: ReadableState {
 objectMode: false,
 highWaterMark: 16384,
 buffer: BufferList { head: null, tail: null, length: 0 },
 length: 0,
 pipes: null,
 pipesCount: 0,
 flowing: null,
 ended: false,
 endEmitted: false,
 reading: false,
 sync: true,
 needReadable: false,
 emittedReadable: false,
 readableListening: false,
 resumeScheduled: false,
 paused: true,
 emitClose: false,
 autoDestroy: false,
 destroyed: true,
 defaultEncoding: 'utf8',
 awaitDrain: 0,
 readingMore: false,
 decoder: null,
 encoding: null
 },
 readable: false,
 _events: [Object: null prototype] { end: [Function: onReadableStreamEnd] },
 _eventsCount: 1,
 _maxListeners: undefined,
 _writableState: WritableState {
 objectMode: false,
 highWaterMark: 16384,
 finalCalled: false,
 needDrain: false,
 ending: false,
 ended: false,
 finished: false,
 destroyed: true,
 decodeStrings: false,
 defaultEncoding: 'utf8',
 length: 0,
 writing: false,
 corked: 0,
 sync: true,
 bufferProcessing: false,
 onwrite: [Function: bound onwrite],
 writecb: null,
 writelen: 0,
 bufferedRequest: null,
 lastBufferedRequest: null,
 pendingcb: 0,
 prefinished: false,
 errorEmitted: false,
 emitClose: false,
 autoDestroy: false,
 bufferedRequestCount: 0,
 corkedRequestsFree: [Object]
 },
 writable: false,
 allowHalfOpen: false,
 _sockname: null,
 _pendingData: null,
 _pendingEncoding: '',
 server: null,
 _server: null,
 [Symbol(asyncId)]: 5,
 [Symbol(kHandle)]: null,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]: null,
 [Symbol(kBuffer)]: null,
 [Symbol(kBufferCb)]: null,
 [Symbol(kBufferGen)]: null,
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0
 },
 stdout: Socket {
 connecting: false,
 _hadError: false,
 _parent: null,
 _host: null,
 _readableState: ReadableState {
 objectMode: false,
 highWaterMark: 16384,
 buffer: BufferList { head: null, tail: null, length: 0 },
 length: 0,
 pipes: null,
 pipesCount: 0,
 flowing: false,
 ended: true,
 endEmitted: true,
 reading: false,
 sync: false,
 needReadable: false,
 emittedReadable: false,
 readableListening: false,
 resumeScheduled: false,
 paused: false,
 emitClose: false,
 autoDestroy: false,
 destroyed: true,
 defaultEncoding: 'utf8',
 awaitDrain: 0,
 readingMore: false,
 decoder: null,
 encoding: null
 },
 readable: false,
 _events: [Object: null prototype] {
 end: [Function: onReadableStreamEnd],
 close: [Function]
 },
 _eventsCount: 2,
 _maxListeners: undefined,
 _writableState: WritableState {
 objectMode: false,
 highWaterMark: 16384,
 finalCalled: false,
 needDrain: false,
 ending: false,
 ended: false,
 finished: false,
 destroyed: true,
 decodeStrings: false,
 defaultEncoding: 'utf8',
 length: 0,
 writing: false,
 corked: 0,
 sync: true,
 bufferProcessing: false,
 onwrite: [Function: bound onwrite],
 writecb: null,
 writelen: 0,
 bufferedRequest: null,
 lastBufferedRequest: null,
 pendingcb: 0,
 prefinished: false,
 errorEmitted: false,
 emitClose: false,
 autoDestroy: false,
 bufferedRequestCount: 0,
 corkedRequestsFree: [Object]
 },
 writable: false,
 allowHalfOpen: false,
 _sockname: null,
 _pendingData: null,
 _pendingEncoding: '',
 server: null,
 _server: null,
 write: [Function: writeAfterFIN],
 [Symbol(asyncId)]: 6,
 [Symbol(kHandle)]: null,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]: null,
 [Symbol(kBuffer)]: null,
 [Symbol(kBufferCb)]: null,
 [Symbol(kBufferGen)]: null,
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0
 },
 stderr: Socket {
 connecting: false,
 _hadError: false,
 _parent: null,
 _host: null,
 _readableState: ReadableState {
 objectMode: false,
 highWaterMark: 16384,
 buffer: BufferList { head: null, tail: null, length: 0 },
 length: 0,
 pipes: null,
 pipesCount: 0,
 flowing: null,
 ended: true,
 endEmitted: true,
 reading: false,
 sync: false,
 needReadable: false,
 emittedReadable: false,
 readableListening: false,
 resumeScheduled: false,
 paused: true,
 emitClose: false,
 autoDestroy: false,
 destroyed: true,
 defaultEncoding: 'utf8',
 awaitDrain: 0,
 readingMore: false,
 decoder: null,
 encoding: null
 },
 readable: false,
 _events: [Object: null prototype] {
 end: [Function: onReadableStreamEnd],
 close: [Function]
 },
 _eventsCount: 2,
 _maxListeners: undefined,
 _writableState: WritableState {
 objectMode: false,
 highWaterMark: 16384,
 finalCalled: false,
 needDrain: false,
 ending: false,
 ended: false,
 finished: false,
 destroyed: true,
 decodeStrings: false,
 defaultEncoding: 'utf8',
 length: 0,
 writing: false,
 corked: 0,
 sync: true,
 bufferProcessing: false,
 onwrite: [Function: bound onwrite],
 writecb: null,
 writelen: 0,
 bufferedRequest: null,
 lastBufferedRequest: null,
 pendingcb: 0,
 prefinished: false,
 errorEmitted: false,
 emitClose: false,
 autoDestroy: false,
 bufferedRequestCount: 0,
 corkedRequestsFree: [Object]
 },
 writable: false,
 allowHalfOpen: false,
 _sockname: null,
 _pendingData: null,
 _pendingEncoding: '',
 server: null,
 _server: null,
 write: [Function: writeAfterFIN],
 [Symbol(asyncId)]: 7,
 [Symbol(kHandle)]: null,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]: null,
 [Symbol(kBuffer)]: null,
 [Symbol(kBufferCb)]: null,
 [Symbol(kBufferGen)]: null,
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0
 },
 stdio: [
 Socket {
 connecting: false,
 _hadError: false,
 _parent: null,
 _host: null,
 _readableState: [ReadableState],
 readable: false,
 _events: [Object: null prototype],
 _eventsCount: 1,
 _maxListeners: undefined,
 _writableState: [WritableState],
 writable: false,
 allowHalfOpen: false,
 _sockname: null,
 _pendingData: null,
 _pendingEncoding: '',
 server: null,
 _server: null,
 [Symbol(asyncId)]: 5,
 [Symbol(kHandle)]: null,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]: null,
 [Symbol(kBuffer)]: null,
 [Symbol(kBufferCb)]: null,
 [Symbol(kBufferGen)]: null,
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0
 },
 Socket {
 connecting: false,
 _hadError: false,
 _parent: null,
 _host: null,
 _readableState: [ReadableState],
 readable: false,
 _events: [Object: null prototype],
 _eventsCount: 2,
 _maxListeners: undefined,
 _writableState: [WritableState],
 writable: false,
 allowHalfOpen: false,
 _sockname: null,
 _pendingData: null,
 _pendingEncoding: '',
 server: null,
 _server: null,
 write: [Function: writeAfterFIN],
 [Symbol(asyncId)]: 6,
 [Symbol(kHandle)]: null,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]: null,
 [Symbol(kBuffer)]: null,
 [Symbol(kBufferCb)]: null,
 [Symbol(kBufferGen)]: null,
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0
 },
 Socket {
 connecting: false,
 _hadError: false,
 _parent: null,
 _host: null,
 _readableState: [ReadableState],
 readable: false,
 _events: [Object: null prototype],
 _eventsCount: 2,
 _maxListeners: undefined,
 _writableState: [WritableState],
 writable: false,
 allowHalfOpen: false,
 _sockname: null,
 _pendingData: null,
 _pendingEncoding: '',
 server: null,
 _server: null,
 write: [Function: writeAfterFIN],
 [Symbol(asyncId)]: 7,
 [Symbol(kHandle)]: null,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]: null,
 [Symbol(kBuffer)]: null,
 [Symbol(kBufferCb)]: null,
 [Symbol(kBufferGen)]: null,
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0
 }
 ]
} ```