ffmpeg完成后退出cmd(或关闭)

时间:2019-01-07 23:25:35

标签: batch-file cmd ffmpeg shutdown

执行ffmpeg命令后是否有命令自动关闭cmd(或关闭计算机)?

我正在使用以下命令下载视频:

ffmpeg -i link.m3u8 -c copy video.mkv

下载后,我希望cmd关闭或PC关闭。

2 个答案:

答案 0 :(得分:2)

您要批处理文件还是cmd行?

批处理文件(ffmpeg完成后将关闭):

@echo off

ffmpeg -i link.m3u8 -c copy video.mkv
shutdown /p

或者,如果您想退出:

@echo off

ffmpeg -i link.m3u8 -c copy video.mkv
exit /b

对于cmd(ffmpeg完成后退出):

ffmpeg -i link.m3u8 -c copy video.mkv & exit /b

或者,如果要关闭:

ffmpeg -i link.m3u8 -c copy video.mkv & shutdown /p

答案 1 :(得分:1)

您可以编写一个小的批处理文件来完成此操作:

getIntent().getExtras()

很明显,@Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); Intent intent = new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT); String channelId = "Default"; NotificationCompat.Builder builder = new NotificationCompat.Builder(this, channelId) .setSmallIcon(R.mipmap.ic_launcher) .setBadgeIconType(NotificationCompat.BADGE_ICON_SMALL) .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)) .setContentTitle(remoteMessage.getNotification().getTitle()).setAutoCancel(true).setContentIntent(pendingIntent) .setContentText(remoteMessage.getNotification().getBody()).setAutoCancel(true).setContentIntent(pendingIntent); NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { NotificationChannel channel = new NotificationChannel(channelId, "Default channel", NotificationManager.IMPORTANCE_DEFAULT); manager.createNotificationChannel(channel); } manager.notify(0, builder.build()); if(remoteMessage.getData().size() > 0){ String url = remoteMessage.getData().get("url"); intent.putExtra("url",url); LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(this); localBroadcastManager.sendBroadcast(intent); } } 是用于退出ValueError: Shape mismatch: The shape of labels (received (1280,)) should equal the shape of logits except for the last dimension (received (128, 20000)). 的,start path\to\ffmpeg.exe -i link.m3u8 -c copy video.mkv exit shutdown /s /f /t 0 的序列及其相关标志将是turn off your PC immediately(如果您这样做的话,实际上需要麻烦退出exit,因为无论如何都会这样做)。将上面的内容另存为cmd,然后在命令提示符下键入shutdown