Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
musica_listas_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
musica_listas_backend
Commits
d5edc16a
Commit
d5edc16a
authored
Aug 19, 2019
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prueba command conversion 3
parent
fc6c9b6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
src/Command/BackendPrepararVideoCommand.php
src/Command/BackendPrepararVideoCommand.php
+6
-9
No files found.
src/Command/BackendPrepararVideoCommand.php
View file @
d5edc16a
...
...
@@ -32,7 +32,10 @@ class BackendPrepararVideoCommand extends Command {
->
setDescription
(
'Comando de ejemplo que sirve para generar los archivos de un video'
)
;
}
//Se debe considerar agregar la definicion de .m3u8 y .ts en apache o nginx, para que el content type de estos sea el correcto.
// m3u8 ---> mime type : application/x-mpegURL
// ts ---> mime type : video/MP2T
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
{
$log
=
Utiles
::
setLog
(
'App\Command::BackendPrepararVideoCommand'
,
'command/prepararVideo'
);
$io
=
new
SymfonyStyle
(
$input
,
$output
);
...
...
@@ -45,22 +48,17 @@ class BackendPrepararVideoCommand extends Command {
$rutaPublica
=
Utiles
::
getPublicRoot
()
.
"/videos"
;
$inicio
=
time
();
$fin
=
$inicio
+
(
$executionTime
*
60
)
-
(
$executionClientTimeout
*
60
);
//$io->warning('El comando inicio en la fecha y hora: ' . date('d/m/Y H:i:s', $inicio));
//$io->warning('El comando debe terminar antes de la fecha y hora: ' . date('d/m/Y H:i:s', $fin));
//$log->debug('El comando inicio en la fecha y hora: ' . date('d/m/Y H:i:s', $inicio));
//$log->debug('El comando debe terminar antes de la fecha y hora: ' . date('d/m/Y H:i:s', $fin));
// while ($inicio < $fin) {
//ruta de prueba con archivo mp4
$servidor
=
"/opt/sdp/hitsahora/www/web/uploads/contenidos/6/video/2016/42/video_92040.mp4"
;
$io
->
success
(
"Procesando Video...."
);
$rutaArchivoVideoOriginal
=
"
$servidor
"
;
//ruta donde quedara el archivo m3u8, debe ser accesible.
$rutaArchivoVideoM3u8
=
"
$rutaPublica
/0/video.m3u8"
;
if
(
!
file_exists
(
"
$rutaPublica
/0"
))
{
mkdir
(
"
$rutaPublica
/0"
,
0777
,
true
);
}
//argumentos del comando a ejecutar para convertir de mp4 a m3u8 hls
$argumentMp4ToM3u8
=
"-y -i
$rutaArchivoVideoOriginal
-profile:v baseline -level 3.0 -s 1920x1080 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls
$rutaArchivoVideoM3u8
"
;
//ejecucion programa con ruta del padre
...
...
@@ -75,7 +73,6 @@ class BackendPrepararVideoCommand extends Command {
}
$inicio
=
time
();
//}
$log
->
debug
(
"Finalizando ejecucion de command BackendPrepararVideoCommand ... "
);
$io
->
success
(
'COMANDO PREPARACION VIDEOS EJECUTADO'
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment