
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (55)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...) -
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
Sur d’autres sites (8443)
-
Compress video with ffmpeg4android library
30 mars 2015, par Huy TowerI tried to follow ffmpeg4android library, and I get the problem when compressing the video, as the Log image below.
I use intent to transfer to Compressing Media class,
Intent intent = new Intent(this, CompressingMedia.class);
intent.putExtra("file_path", mLlItems.get(0).getPath());
startActivity(intent);This is the class was transfered to :
public class CompressingMedia extends BaseWizard {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
Log.d(Prefs.TAG, "path " + intent.getExtras().getString("file_path"));
// /storage/emulated/0/DCIM/Camera/VID_20140312_090612.mp4
String command = "ffmpeg -y -i " + intent.getExtras().getString("file_path") +
" -strict experimental -s 320x240 -r 15 -aspect 3:4 -ab 12288 -vcodec mpeg4 -b 2097152 -sample_fmt s16 /sdcard/out.mp4";
// if you want to change the default work location (/sdcard/videokit/) use the uncomment the below method.
// It must be defined before calling the copyLicenseAndDemoFilesFromAssetsToSDIfNeeded method,
// in order for this method to copy the assets to the correct location.
// setWorkingFolder("/sdcard/videokit/");
// this will copy the license file and the demo video file.
// to the videokit work folder location.
// without the license file the library will not work.
copyLicenseAndDemoFilesFromAssetsToSDIfNeeded();
commandStr = command;
setCommand(commandStr);
runTranscoing();
}
}Although I received the notification Transcoding Successfully, but it looks like the capacity of file after compressing is always be 0. (the log in the bottom of images)
I don’t know the result as image below is good or not, I can not get the expected result - The video was compressed totally successfully.
Someone know why after compressing the file is always be 0, please tell me. Thanks.
This is the Log Cat :
03-13 14:49:45.655 : I/ActivityManager(6065) : Timeline :
Activity_launch_request id:app.cloudstringers time:3821235903-13 14:49:45.665 : V/Home(6065) : Global ID is 000400010007 ;Sell is 3
03-13 14:49:45.770 : D/ffmpeg4android(6065) : path
/storage/emulated/0/videokit/out.mp403-13 14:49:45.770 : I/ffmpeg4android(6065) : workingFolderPath :
/sdcard/videokit/03-13 14:49:45.775 : D/ffmpeg4android(6065) : Working directory exists,
not coping assests (license file and demo videos)03-13 14:49:45.785 : D/ffmpeg4android(6065) : output directory exists.
03-13 14:49:45.785 : I/ffmpeg4android(6065) : Command is set
03-13 14:49:45.785 : I/ffmpeg4android(6065) : set
remoteNotificationIconId : 003-13 14:49:45.785 : D/ffmpeg4android(6065) : Client Cannot unbind -
service not bound03-13 14:49:45.785 : D/ffmpeg4android(6065) : Client stopService()
03-13 14:49:45.790 : W/ContextImpl(6065) : Implicit intents with
startService are not safe : Intent
act=com.netcompss.ffmpeg4android.FFMpegRemoteServiceBridge
android.content.ContextWrapper.stopService:499
com.netcompss.ffmpeg4android_client.BaseWizard.stopService:451
com.netcompss.ffmpeg4android_client.BaseWizard.runTranscoing:28503-13 14:49:45.795 : I/ffmpeg4android(6065) :
!!!!!!!!!!!!!!!!!!services.size() : 103-13 14:49:45.795 : I/ffmpeg4android(6065) : putting Base categoty
03-13 14:49:45.810 : D/ffmpeg4android(6065) : started :
com.netcompss.ffmpeg4android.FFMpegRemoteServiceBridge03-13 14:49:45.810 : D/ffmpeg4android(6065) : Client startService()
03-13 14:49:45.810 : D/ffmpeg4android(6065) : bindService() called
03-13 14:49:45.815 : W/ContextImpl(6065) : Implicit intents with
startService are not safe : Intent
act=com.netcompss.ffmpeg4android.FFMpegRemoteServiceBridge
android.content.ContextWrapper.bindService:517
com.netcompss.ffmpeg4android_client.BaseWizard.bindService:462
com.netcompss.ffmpeg4android_client.BaseWizard.runTranscoing:28803-13 14:49:45.820 : D/ffmpeg4android(6065) : Client bindService()
03-13 14:49:45.935 : I/ffmpeg4android(6616) : =======service onCreate() :
Stopping forground (to overcome 2.3.x bug)03-13 14:49:45.935 : I/ffmpeg4android(6616) : =======service
onBind()=======03-13 14:49:45.940 : I/ffmpeg4android(6616) : ===onStartCommand called
03-13 14:49:45.940 : I/ffmpeg4android(6616) : ===onStartCommand cat :
Base03-13 14:49:45.940 : D/ffmpeg4android(6616) : onStartCommand,
START_STICKY, base Command03-13 14:49:45.955 : I/ffmpeg4android(6616) : get
remoteNotificationIconId : 003-13 14:49:45.955 : I/ffmpeg4android(6616) : notifIcon is set
03-13 14:49:45.955 : I/ffmpeg4android(6616) : Start RemoteService with
notification id : 532603-13 14:49:45.965 : I/ffmpeg4android(6616) : Run called.
03-13 14:49:45.965 : D/ffmpeg4android(6616) : Sleeping, waiting for
command03-13 14:49:45.970 : D/ffmpeg4android(6065) : Client
onServiceConnected()03-13 14:49:45.970 : I/ffmpeg4android(6065) : invokeService called
03-13 14:49:45.970 : I/Videokit(6065) : licenseCheck in path :
/sdcard/videokit03-13 14:49:45.970 : I/Videokit(6065) : isLicExistsComplex...
03-13 14:49:45.970 : I/Videokit(6065) : trying to open
/sdcard/videokit/ffmpeglicense.lic03-13 14:49:45.970 : I/Videokit(6065) : license file found...
03-13 14:49:45.970 : I/Videokit(6065) : time decoded : 1394535283
03-13 14:49:45.970 : I/Videokit(6065) : timeStrDec 1394535283 is a valid
number.03-13 14:49:45.970 : I/Videokit(6065) : time diff : 161702
03-13 14:49:45.970 : I/Videokit(6065) : You used 1 of your 15 trial
days.03-13 14:49:45.970 : I/ffmpeg4android(6065) : setting remote
notification info03-13 14:49:45.970 : D/ffmpeg4android(6616) : command items num : 21
03-13 14:49:45.970 : D/ffmpeg4android(6616) : command : ffmpeg -y -i
/storage/emulated/0/videokit/out.mp4 -strict experimental -s 320x240
-r 15 -aspect 3:4 -ab 12288 -vcodec mpeg4 -b 2097152 -sample_fmt s16 /sdcard/out.mp403-13 14:49:45.970 : D/ffmpeg4android(6616) : workingFolder from remote :
/sdcard/videokit03-13 14:49:45.970 : D/ffmpeg4android(6065) : deleteing :
/sdcard/videokit/vk.log isdeleted : true03-13 14:49:45.975 : D/ffmpeg4android(6065) : deleteing :
/sdcard/videokit/ffmpeg4android.log isdeleted : false03-13 14:49:45.975 : D/ffmpeg4android(6065) : deleteing :
/sdcard/videokit/videokit.log isdeleted : true03-13 14:49:45.980 : D/ffmpeg4android(6065) : Client invokeService()
03-13 14:49:45.980 : D/ffmpeg4android(6065) : Acquire wake lock
03-13 14:49:46.265 : D/ffmpeg4android(6616) : Sleeping, waiting for
command03-13 14:49:46.295 : D/ffmpeg4android(6065) : TranscodeBackground
doInBackground started03-13 14:49:46.295 : I/ffmpeg4android(6616) : =======remote service
runTranscoding ======03-13 14:49:46.340 : V/HomeAsync(6065) : TOTAL_SPACE is
1 ;AVAILABLE_SPACE is 0.45103-13 14:49:46.345 : I/ActivityManager(6065) : Timeline : Activity_idle
id : android.os.BinderProxy@423deed8 time:3821304503-13 14:49:46.345 : I/ActivityManager(6065) : Timeline : Activity_idle
id : android.os.BinderProxy@420323a0 time:3821304503-13 14:49:46.565 : D/dalvikvm(6616) : Trying to load lib
/data/app-lib/app.cloudstringers-2/libvideokit.so 0x41b285f003-13 14:49:46.570 : D/dalvikvm(6616) : Added shared lib
/data/app-lib/app.cloudstringers-2/libvideokit.so 0x41b285f003-13 14:49:46.570 : I/Videokit(6616) : Loading native library compiled
at 21:59:53 Oct 23 201303-13 14:49:46.575 : I/ffmpeg4android(6616) : ===============Running
command from thread path : /sdcard/videokit03-13 14:49:46.575 : I/Videokit(6616) : vk ffmpeg sdcardPath :
/sdcard/videokit03-13 14:49:46.575 : I/Videokit(6616) : licenseCheck in path :
/sdcard/videokit03-13 14:49:46.575 : I/Videokit(6616) : isLicExistsComplex...
03-13 14:49:46.575 : I/Videokit(6616) : trying to open
/sdcard/videokit/ffmpeglicense.lic03-13 14:49:46.575 : I/Videokit(6616) : license file found...
03-13 14:49:46.575 : I/ffmpeg4android(6616) :
=======ProgressBackgroundRemote doInBackground=========03-13 14:49:46.575 : I/Videokit(6616) : time decoded : 1394535283
03-13 14:49:46.575 : I/Videokit(6616) : timeStrDec 1394535283 is a valid
number.03-13 14:49:46.575 : I/Videokit(6616) : time diff : 161703
03-13 14:49:46.575 : I/Videokit(6616) : You used 1 of your 15 trial
days.03-13 14:49:46.575 : D/Videokit(6616) : license check rc : 0
03-13 14:49:46.575 : D/Videokit(6616) : run() called verion 2.0
03-13 14:49:46.575 : D/Videokit(6616) : run passing off to main()
03-13 14:49:46.800 : D/ffmpeg4android(6065) : onServiceDisconnected
03-13 14:49:48.640 : I/ffmpeg4android(6065) : Got real duration :
00:00:07.7803-13 14:49:48.640 : I/ffmpeg4android(6065) : ==== getting
currentVkLogSize from VK03-13 14:49:48.640 : D/ffmpeg4android(6065) : currentVkLogSize : 5751
03-13 14:49:48.645 : I/ffmpeg4android(6065) : No ffmpeg4android_log
file, using vk log03-13 14:49:48.645 : I/line(6065) : _rate, rate, width or height
03-13 14:49:48.650 : I/line(6065) : Statistics : 0 seeks, 0 writeouts
03-13 14:49:48.650 : I/line(6065) : Statistics : 72873 bytes read, 2
seeks03-13 14:49:48.650 : D/ffmpeg4android(6065) : currentTimeStr : exit
03-13 14:49:48.650 : D/ffmpeg4android(6065) : ============Found one of
the exit tokens in the log============03-13 14:49:48.650 : I/ffmpeg4android(6065) : onProgressUpdate : 100
03-13 14:49:48.650 : D/ffmpeg4android(6065) : Releasing wake lock
03-13 14:49:48.650 : D/ffmpeg4android(6065) : TranscodeBackground
onPostExecute03-13 14:49:48.700 : D/ffmpeg4android(6065) : /sdcard/videokit/null
length in bytes : 003-13 14:49:48.700 : D/ffmpeg4android(6065) : showNotifications
03-13 14:49:48.700 : W/ffmpeg4android(6065) : output file is not set use
the setOutputFilePath method to set the full output file path03-13 14:49:48.705 : I/ffmpeg4android(6065) : FFMPEG finished.
03-13 14:49:48.710 : D/ffmpeg4android(6065) : releaseService()
03-13 14:49:48.710 : D/ffmpeg4android(6065) : Client stopService()
03-13 14:49:48.710 : W/ContextImpl(6065) : Implicit intents with
startService are not safe : Intent
act=com.netcompss.ffmpeg4android.FFMpegRemoteServiceBridge
android.content.ContextWrapper.stopService:499
com.netcompss.ffmpeg4android_client.BaseWizard.stopService:451
com.netcompss.ffmpeg4android_client.BaseWizard.handleServiceFinished:513 -
ffmpeg : failed to convert m3u8 to mp4
4 mars 2016, par MrSmile07I want to convert a .m3u8 file into .mp4, for that I am using ffmpeg.
The only Thing that disturbs is, that one file work with the Command and the other not.Here the command :
ffmpeg -i http://91.250.77.10:8134/hls-vod/jp/523.mp4.m3u8 -acodec copy -vcodec copy -y -loglevel info -f mp4 Namezurspeicherrung.mp4
that file works, but by the other file :
ffmpeg -i http://91.250.77.10:8134/hls-vod/mk/01.mp4.m3u8 -acodec copy -vcodec copy -y -loglevel info -f mp4 Namezurspeicherrung2.mp4
doesn’t work.
_
_OK : Here the Output from file 2 :
ffmpeg -i http://91.250.77.10:8134/hls-vod/mkmp4.m3u8 -acodec copy -vcodec copy -y -loglevel info -f mp4 Wasichsiewirklichgernefragenwuerde.mp4 ffmpeg version 0.8.10-4:0.8.10-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers built on Feb 6 2014 20:56:59 with gcc 4.6.3 *** THIS PROGRAM IS DEPRECATED *** This program is only provided for compatibility and will be removed in a future release. Please use avconv instead. [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [NULL @ 0x16b5120] non-existing PPS referenced [h264 @ 0x1825a60] non-existing PPS 0 referenced [h264 @ 0x1825a60] decode_slice_header error [h264 @ 0x1825a60] no frame ! [applehttp @ 0x16ab9a0] max_analyze_duration reached [applehttp @ 0x16ab9a0] Estimating duration from bitrate, this may be inaccurate
Seems stream 0 codec frame rate differs from container frame rate : 180000.00 (180000/1) -> 1000.00 (1000/1)
Input #0, applehttp, from ’http://91.250.77.10:8134/hls-vod/mk/01.mp4.m3u8’ :
Duration : 00:23:30.00, start : 8.700000, bitrate : N/A
Stream #0.0 : Video : h264, 1k tbr, 90k tbn, 180k tbc
Stream #0.1 : Audio : aac, 48000 Hz, stereo, s16
[mp4 @ 0x1826640] dimensions not set
Output #0, mp4, to ’Wasichsiewirklichgernefragenwuerde.mp4’ :
Stream #0.0 : Video : libx264, q=2-31, 90k tbn, 90k tbc
Stream #0.1 : Audio : libvo_aacenc, 48000 Hz, stereo
Stream mapping :
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Could not write header for output file #0 (incorrect codec parameters ?)Last Edit : 23.03.2014 20:08
-
Using ffmpeg with Python 2.7
1er juillet 2015, par suffaI have been trying to install pyffmpeg in Python 2.7 unsuccessfully. I found a package for Python 2.6, but I can’t get it to work. So, I have been mulling around with 2.7. I’ve seen previous post from others on this site, but they have not helped. Does anyone have experience with this. Ultimately, I want to develop an wxPython app that converts video formats. Thanks
Code that I ultimately wrote that worked for me (very rudimentary, but it works ....) :
import wx
import os
import sys
import time
import datetime
from wx.lib.delayedresult import startWorker
class dConvert(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'd-Converter', size=(500, 310))
panel = wx.Panel(self, wx.ID_ANY)#Creates a panel over the widget
toolbar = self.CreateToolBar()
toolbar.Realize()
#Setup Menu
#Setting up Menu
menuFile = wx.Menu()
menuFile.Append(1, "&About...")
menuFile.AppendSeparator()
menuFile.Append(2, "E&xit")
menuBar = wx.MenuBar()
menuBar.Append(menuFile, "&File")
panel.SetBackgroundColour('WHITE')
menu2 = wx.Menu()
menu2.Append(5, "&.mpg to dvd", ".mpg to dvd")
menu2.AppendSeparator()
menu2.Append(wx.NewId(), "&Options...", "Options...")
menuBar.Append(menu2, "&DVD")
menu3 = wx.Menu()
menu3.Append(7, "&Audio/Video Trim")
#menu3.AppendSeparator()
menuBar.Append(menu3, "Media")
self.SetMenuBar(menuBar)
self.Bind(wx.EVT_MENU, self.OnAbout, id=1)
self.Bind(wx.EVT_MENU, self.OnQuit, id=2)
self.Bind(wx.EVT_MENU, self.OnDVD, id=5)
self.Bind(wx.EVT_MENU, self.OnMedia, id=7)
#Add icon to frame
iconFile = "dconverter_image.jpg"
icon1 = wx.Icon(iconFile, wx.BITMAP_TYPE_JPEG)
self.SetIcon(icon1)
self.statusbar = self.CreateStatusBar()
self.statusbar.SetStatusText("Convert Audio & Video")
self.statusbar.SetFieldsCount(3)
self.statusbar.SetStatusWidths([200, -2, -2])
#Panel Text
font = wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD)
font2 = wx.Font(7, wx.DEFAULT, wx.NORMAL, wx.BOLD)
directory = wx.StaticText(panel, -1, 'Path: c:\\ffmpeg\\bin', (300, 13))
directory.SetFont(font2)
convertfile = wx.StaticText(panel, -1, 'File:', (270, 53))
convertfile.SetFont(font)
convertfile2 = wx.StaticText(panel, -1, 'Format:', (245, 83))
convertfile2.SetFont(font)
convertfile3 = wx.StaticText(panel, -1, 'Quality:', (244, 113))
convertfile3.SetFont(font)
convertfile4 = wx.StaticText(panel, -1, 'Presets:', (239, 143))
convertfile4.SetFont(font)
image_file = 'cd_rom.gif'
bmp1 = wx.Image(image_file, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
panel.bitmap1 = wx.StaticBitmap(panel, -1, bmp1, (50, 30))
self.formats1 = []
#Select Media path
os.chdir("c:\\ffmpeg\\bin")
wrkdir = os.getcwd()
filelist = os.listdir(wrkdir)
#self.formats1 = []
for filename in filelist:
(head, filename) = os.path.split(filename)
if filename.endswith(".avi") or filename.endswith(".mp4") or filename.endswith(".mpg") or filename.endswith(".m4A") or filename.endswith(".MTS") or filename.endswith(".flv") or filename.endswith(".mov") or filename.endswith(".mpeg4") or filename.endswith(".mpeg") or filename.endswith(".mpg2") or filename.endswith(".mkv") or filename.endswith(".m4v") or filename.endswith(".wav") or filename.endswith(".mp3"):
self.formats1.append(filename)
self.format_combo1=wx.ComboBox(panel, size=(140, -1),value='Select Media', choices=self.formats1, style=wx.CB_DROPDOWN, pos=(300,50))
self.Bind(wx.EVT_COMBOBOX, self.fileFormats, self.format_combo1)
#Media Formats
self.formats2 = ['Select Format', '.avi','.mpeg','.mp4','.flv','.mov','.m4a','.m4v','.mkv','.mpeg4','.mpg','.mpg2','.mp3','.ogg','.wav','.wma']
self.format_combo2=wx.ComboBox(panel, size=(100, -1),value='Select Format', choices=self.formats2, style=wx.CB_SORT, pos=(300,81))
#Media Quality
self.formats3 = ['-sameq','-qmax']
self.format_combo3=wx.ComboBox(panel, size=(100, -1),value='Select Quality', choices=self.formats3, style=wx.CB_DROPDOWN, pos=(300,111))
#-qmax settings
self.formats4 = ['1','2','3','4','5','6','7','8']
self.format_combo4=wx.ComboBox(panel, size=(30, -1),value='0', choices=self.formats4, style=wx.CB_DROPDOWN, pos=(405,111))
self.format_combo4.Disable()
#Media Quality
self.formats5 = ['Select Preset','video to mp3']
self.format_combo5=wx.ComboBox(panel, size=(100, -1),value='Select Preset', choices=self.formats5, style=wx.CB_DROPDOWN, pos=(300,141))
#Bit rate
self.formats6 = ['128000', '160000', '180000', '192000']
self.format_combo6=wx.ComboBox(panel, size=(47, -1),value='k/bs', choices=self.formats6, style=wx.CB_DROPDOWN, pos=(405,141))
self.format_combo6.Disable()
#Convert Button
self.button = wx.Button(panel, label="Convert", pos=(300, 171), size=(80, 20))
self.Bind(wx.EVT_BUTTON, self.convertButton, self.button)
#Abort Button
self.button2 = wx.Button(panel, label="Abort", pos=(385, 171), size=(80, 20))
self.Bind(wx.EVT_BUTTON, self.OnAbortButton, self.button2)
self.button2.Disable()
#Refresh Button
self.button3 = wx.Button(panel, label="Refresh", pos=(215, 171), size=(80, 20))
self.Bind(wx.EVT_BUTTON, self.file_refresh, self.button3)
#ComboBox Event
self.Bind(wx.EVT_COMBOBOX, self.OncomboBox, self.format_combo3)
self.Bind(wx.EVT_COMBOBOX, self.OncomboBox2, self.format_combo5)
self.Bind(wx.EVT_COMBOBOX, self.OncomboBox3, self.format_combo2)
def file_refresh(self, e):
self.format_combo1.Clear()
os.chdir("c:\\ffmpeg\\bin")
wrkdir = os.getcwd()
filelist = os.listdir(wrkdir)
for m_files in filelist:
if m_files.endswith(".avi") or m_files.endswith(".mp4") or m_files.endswith(".mpg") or m_files.endswith(".m4A") or m_files.endswith(".MTS") or m_files.endswith(".flv") or m_files.endswith(".mov") or m_files.endswith(".mpeg4") or m_files.endswith(".mpeg") or m_files.endswith(".mpg2") or m_files.endswith(".mkv") or m_files.endswith(".m4v") or m_files.endswith(".wav") or m_files.endswith(".mp3"):
self.format_combo1.Append(m_files)
def file_rename(self, f_name):
ts = time.time()
#Capture readable timestamp
st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d_%H-%M-%S')
os.chdir("c:\\ffmpeg\\bin")
wrkdir = os.getcwd()
#get file extenstion from original file
#fileName, fileExtension = os.path.splitext(wrkdir + '\\' + f_name)
#add file extension to timestamp
new_file = st
return new_file
def fileFormats(self, e):
myFormats = {'audio': ('Select Format', '.m4a', '.mp3', '.ogg', '.wav', '.wma'), 'video': ('Select Format', '.avi', '.flv', '.mkv', '.m4v', '.mov', '.mpg', '.mpg2', '.mpeg4', '.mp4', '.mpeg')}
bad_file = ['Media not supported']
myFile = self.format_combo1.GetValue()
f_exten = (x for x in myFormats['audio'] + myFormats['video'] if myFile.endswith(x))
extension = f_exten.next()
if extension in myFormats['audio']:
self.format_combo2.SetItems(myFormats['audio'])
elif extension in myFormats['video']:
self.format_combo2.SetItems(myFormats['video'])
else:
self.format_combo2.SetItems(bad_file)
def OnQuit(self, event):
self.Close(True)
def OnAbout(self, event):
wx.MessageBox("d-Converter 1.0\n\n Developer: D.Monroe\n\nCopyright 2012",
"About d-Converter", wx.OK | wx.ICON_INFORMATION, self)
def OncomboBox(self, e):
quality=self.format_combo3.GetValue()
if quality == '-qmax':
self.format_combo4.Enable()
else:
self.format_combo4.Disable()
def OncomboBox2(self, e):
quality=self.format_combo5.GetValue()
if quality != 'Select Preset':
self.format_combo1.Enable()
self.format_combo2.Disable()
self.format_combo3.Disable()
self.format_combo4.Disable()
self.format_combo6.Enable()
elif quality == 'Select Preset':
self.format_combo1.Enable()
self.format_combo2.Enable()
self.format_combo3.Enable()
self.format_combo4.Disable()
self.format_combo5.Enable()
self.format_combo6.Disable()
elif quality == 'video to mp3':
self.format_combo6.Enable()
self.format_combo2.Disable()
self.format_combo3.Disable()
self.format_combo4.Disable()
def OncomboBox3(self, e):
v_format=self.format_combo2.GetValue()
if v_format != 'Select Format':
self.format_combo1.Enable()
self.format_combo2.Enable()
self.format_combo3.Enable()
self.format_combo4.Enable()
self.format_combo5.Disable()
self.format_combo6.Disable()
elif v_format == 'Select Format':
self.format_combo1.Enable()
self.format_combo2.Enable()
self.format_combo3.Enable()
self.format_combo4.Disable()
self.format_combo5.Enable()
self.format_combo6.Disable()
def OnMedia(self, e):
pass
def OnDVD(self, e):
""" Select a directory to search"""
os.chdir("c:\\ffmpeg\\bin")
wrkdir = os.getcwd()
filelist = os.listdir(wrkdir)
progdir = 'c:\\ffmpeg\\bin\\ffmpeg.exe' + ' -i '
prog_dir = ' -target '
progdir3 = '-dvd -ac 2 '
vid_format = '.mpg'
sampleList = []
for filename in filelist:
(head, filename) = os.path.split(filename)
if filename.endswith(".avi") or filename.endswith(".flv") or filename.endswith(".mpeg") or filename.endswith(".mp4") or filename.endswith(".mov") or filename.endswith(".mpg2"):
sampleList.append(filename)
dlg = wx.SingleChoiceDialog(
self, "Files in c:\\ffmpeg\\bin", 'Select video to convert',
sampleList,
wx.CHOICEDLG_STYLE
)
if dlg.ShowModal() == wx.ID_OK:
cur_item = dlg.GetStringSelection()
s_string = cur_item
#f_string = self.file_rename(s_string)
f_string = s_string.replace(' ', '')
dlg.Destroy()
dlg2 = wx.SingleChoiceDialog(
self, "Files in c:\\ffmpeg\\bin", 'Select video standard ',
["pal", "ntsc"],
wx.CHOICEDLG_STYLE
)
if dlg2.ShowModal() == wx.ID_OK:
cur_item2 = dlg2.GetStringSelection()
s_string2 = cur_item2
self.button.Disable()
self.button2.Enable()
self.format_combo1.Disable()
self.format_combo2.Disable()
self.format_combo3.Disable()
self.format_combo4.Disable()
self.format_combo5.Disable()
self.format_combo6.Disable()
startWorker(self.LongTaskDone, self.LongTask4, wargs=(progdir, wrkdir, prog_dir, progdir3, f_string, s_string2, vid_format))
dlg2.Destroy()
def convertButton(self, e):
unit1 = self.format_combo1.GetValue()
unit2 = self.format_combo2.GetValue()
unit3 = self.format_combo3.GetValue()
unit4 = None
unit5 = self.format_combo5.GetValue()
bitRate = self.format_combo6.GetValue()
unit6 = bitRate
if unit3 == '-qmax':
unit4 = self.format_combo4.GetValue()
else:
pass
os.chdir("c:\\ffmpeg\\bin")
wrkdir = os.getcwd()
newfile = unit1
#stripped = os.path.splitext(newfile)[0] # Updated 9/26/2013 to strip extension.
#stripped = newfile.strip('mpeg3kaviovfl4w2c.') #Strips the extension from the original file name
stripped = self.file_rename(newfile)
#os.rename(newfile, newfile_f)
progname='c:\\ffmpeg\\bin\\ffmpeg.exe' + ' -i '
preset1_a='-vn -ar 44100 -ac 2 -ab'
preset1_b='-f mp3 '
preset_mp3='.mp3'
if (unit1 == 'Select Media' or unit1 == ''):
amsg = wx.MessageDialog(None, 'You must select a media file!', 'Media Converter', wx.ICON_INFORMATION)
amsg.ShowModal()
amsg.Destroy()
elif (unit1 != 'Select Media' or unit1 != '') and (unit5 == 'Select Preset'):
if (unit2 == 'Select Format' or unit2 == ''):
amsg = wx.MessageDialog(None, 'You must select a format', 'Media Converter', wx.ICON_INFORMATION)
amsg.ShowModal()
amsg.Destroy()
self.format_combo3.Enable()
self.format_combo4.Enable()
self.format_combo5.Enable()
else:
pass
if (unit3 == 'Select Quality' or unit3 == ''):
amsg = wx.MessageDialog(None, 'You must select quality', 'Media Converter', wx.ICON_INFORMATION)
amsg.ShowModal()
amsg.Destroy()
elif (unit3 == '-qmax'):
if (unit4 == '0' or unit4 == ''):
amsg = wx.MessageDialog(None, 'You must select number between 1-8.', 'Media Converter', wx.ICON_INFORMATION)
amsg.ShowModal()
amsg.Destroy()
else:
self.button.Disable()
self.button2.Enable()
pass
else:
self.button.Disable()
self.button2.Enable()
self.format_combo1.Disable()
self.format_combo2.Disable()
self.format_combo3.Disable()
self.format_combo4.Disable()
startWorker(self.LongTaskDone, self.LongTask, wargs=(progname,wrkdir,unit1,unit3,stripped,unit2))
elif (unit1 != 'Select Media' or unit1 != '') and (unit5 == 'video to mp3'):
if unit6 == 'k/bs' or unit6 == None:
amsg = wx.MessageDialog(None, 'You must select a bit rate.', 'Media Converter', wx.ICON_INFORMATION)
amsg.ShowModal()
amsg.Destroy()
else:
self.button.Disable()
self.button2.Enable()
self.format_combo1.Disable()
self.format_combo2.Disable()
self.format_combo3.Disable()
self.format_combo4.Disable()
self.format_combo5.Disable()
self.format_combo6.Disable()
startWorker(self.LongTaskDone, self.LongTask3, wargs=(progname, wrkdir, unit1, preset1_a, unit6, preset1_b, stripped, preset_mp3))
def LongTask(self, progname, wrkdir, unit1, unit3, stripped, unit2):
convert_file1 = progname + wrkdir + '\\' + unit1 + ' ' + unit3 + ' ' + stripped + unit2
self.statusbar.SetStatusText("Converting: " + unit1 + "...")
os.system(convert_file1)
print convert_file1
def LongTask2(self, progname, wrkdir, unit1, unit3, unit4, stripped, unit2):
convert_file2 = progname + wrkdir + '\\' + unit1 + ' ' + unit3 + ' ' + unit4 + ' ' + stripped + unit2
self.statusbar.SetStatusText("Converting: " + unit1 + "...")
os.system(convert_file2)
def LongTask3(self, progname, wrkdir, unit1, preset1_a, unit6, preset1_b, stripped, preset_mp3):
convert_file3 = progname + wrkdir + '\\' + unit1 + ' ' + preset1_a + ' ' + unit6 + ' ' + preset1_b + stripped + preset_mp3
self.statusbar.SetStatusText("Converting: " + unit1 + "...")
os.system(convert_file3)
def LongTask4(self, progdir, wrkdir, prog_dir, progdir3, f_string, s_string2, vid_format):
#convert_file4 = progdir + wrkdir + '\\' + s_string + prog_dir + s_string2 + progdir3 + s_string.strip('mpegaviw24ofl.') + vid_format
convert_file4 = progdir + f_string + prog_dir + s_string2 + progdir3 + f_string.strip('mpegaviw24ofl.') + vid_format
self.statusbar.SetStatusText("Converting: " + f_string + "...")
os.system(convert_file4)
print convert_file4
def LongTaskDone(self, result):
r = result.get()
if r:
amsg = wx.MessageDialog(None, 'Aborted!', 'Media Converter', wx.ICON_INFORMATION)
self.statusbar.SetStatusText("Convert Aborted ...")
amsg.ShowModal()
amsg.Destroy()
self.LongTask.terminate()
else:
self.statusbar.SetStatusText("Done ...")
emsg = wx.MessageDialog(None, 'Finished Converting!', 'Media Converter', wx.ICON_INFORMATION)
emsg.ShowModal()
emsg.Destroy()
self.format_combo1.Enable()
self.format_combo2.Enable()
self.format_combo3.Enable()
self.format_combo5.Enable()
self.format_combo4.Disable()
self.format_combo6.Disable()
self.button.Enable()
self.button2.Disable()
self.shouldAbort = False
"""self.progress_bar.SetValue(0)
self.progress_bar.Hide()"""
def OnAbortButton(self, e):
endprogram = 'c:\\Windows\\System32\\taskkill /IM cmd.exe'
os.system(endprogram)
self.format_combo1.Enable()
self.format_combo2.Enable()
self.format_combo3.Enable()
self.format_combo5.Enable()
self.button.Enable()
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = dConvert()
frame.SetSizeHints(500,310,500,310)
frame.Show()
app.MainLoop()