si, di suo ffmpeg in un terminale funziona benissimo, se io prendo quello che scrive debug e lo butto in un terminale, da qualunque parte del filesystem io sia, ffmpeg inizia a leggere il file mpg e butta re fuori il file mkv codificato x265 ....
Public Sub RunEncoder()
Dim Encoded As String[] 'la lista delle path di tutti i file dalla sorgente da codificare
Dim I As Integer
Dim OutputFileName As String
Dim comando As String
Encoded = FileChooser_Sorgente.SelectedPaths
Do While Not ((bChiudo = True) Or (Encoded.count = 0)) 'fino a che non ho codificato tutti i file, oppure fino a quando non si preme "cancel"
'codifica 'ffmpeg -i "$f" -c:v libx265 -preset medium -crf 28 -c:a aac -b:a 128k -strict -2 "$( sed -e's/\.mpg/.mkv/g' <<< $f )"
OutputFileName = File.BaseName(Encoded[0])
OutputFileName = Replace(OutputFileName, " ", "_")
OutputFileName = FileChooser_Destinazione.Dir & "/" & OutputFileName & ".mkv"
comando = "ffmpeg -i " & Encoded[0] & " -c:v libx265 -preset medium -crf 28 -c:a aac -b:a 128k -strict -2 " & OutputFileName
Debug comando
Shell comando
'$hProcess = Exec ["ffmpeg", "-i", Encoded[0], "-c:v", "libx265", "-preset", "medium", "-crf", "28", "-c:a", "aac", "-b:a", "128k", "-strict -2" & user.Home & "/Scrivania/test" & ".mkv"]
'$hProcess = Exec ["ffmpeg", "-i", Encoded[0], "-c:v libx265 -preset medium -crf 28 -c:a aac -b:a 128k -strict -2 ", OutputFileName] Wait
'$hProcess = Exec ["ffmpeg", "-i", Encoded[0], "-c:v libx265 -preset medium -crf 28 -c:a aac -b:a 128k -strict -2", FileChooser_Destinazione.Dir & "/" & "test.mkv"] Wait
'Shell "ffmpeg -i " & Encoded[0] & " -c:v libx265 -preset medium -crf 28 -c:a aac -b:a 128k -strict -2 " & FileChooser_Destinazione.Dir & "/" & OutputFileName & ".mkv" wait
'$hProcess = Shell "ffmpeg -i " & Encoded[0] & " -c:v libx265 -preset medium -crf 28 -c:a aac -b:a 128k -strict -2 " & FileChooser_Destinazione.Dir & "/" & OutputFileName & ".mkv"
'se la codifica e' andata bene allora lo rimuovo
Encoded.Remove(0)
Loop
ToggleButton_encode.Value = 0
End
per esempio comando mi da':
FMain.RunEncoder.119: ffmpeg -i /home/v1p3r/TG/2014/tg_01102014.mpg -c:v libx265 -preset medium -crf 28 -c:a aac -b:a 128k -strict -2 /home/v1p3r/TG/tg_01102014.mkv
e se io prendo il comando di ffmpeg e lo butto in un terminale, l'encoder parte senza problemi:
ffmpeg -i /home/v1p3r/TG/2014/tg_01102014.mpg -c:v libx265 -preset medium -crf 28 -c:a aac -b:a 128k -strict -2 /home/v1p3r/TG/tg_01102014.mkvffmpeg version 2.8.6-1ubuntu2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.1 (Ubuntu 5.3.1-11ubuntu1) 20160311
configuration: --prefix=/usr --extra-version=1ubuntu2 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, mpeg, from '/home/v1p3r/TG/2014/tg_01102014.mpg':
Duration: 00:20:57.00, start: 0.270000, bitrate: 6281 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 16:15 DAR 4:3], max. 9500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 224 kb/s
x265 [info]: HEVC encoder version 1.9
x265 [info]: build info [Linux][GCC 5.3.1][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x265 [info]: Main profile, Level-3 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: frame threads / pool features : 3 / wpp(9 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut : 25 / 250 / 40
x265 [info]: Lookahead / bframes / badapt : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb : 1 / 1 / 0
x265 [info]: References / ref-limit cu / depth : 3 / 1 / 1
x265 [info]: AQ: mode / str / qg-size / cu-tree : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 signhide tmvp strong-intra-smoothing
x265 [info]: tools: deblock sao
Output #0, matroska, to '/home/v1p3r/TG/tg_01102014.mkv':
Metadata:
encoder : Lavf56.40.101
Stream #0:0: Video: hevc (libx265), yuv420p, 720x576 [SAR 16:15 DAR 4:3], q=2-31, 25 fps, 1k tbn, 25 tbc
Metadata:
encoder : Lavc56.60.100 libx265
Stream #0:1: Audio: aac ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc56.60.100 aac
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video (native) -> hevc (libx265))
Stream #0:1 -> #0:1 (mp2 (native) -> aac (native))
Press [q] to stop, [?] for help
mentre dentro a gambas si ferma (la codifica, l'applicazione risponde in modo fluido) dopo aver invocato ffmpeg. Sembra come se ffmpeg facesse partire un processo separato che pero' non va a buon fine
ps: nella consolle i gambas l'output di shell comando e' tipo questo:
FMain.RunEncoder.122: ffmpeg version 2.8.6-1ubuntu2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.1 (Ubuntu 5.3.1-11ubuntu1) 20160311
configuration: --prefix=/usr --extra-version=1ubuntu2 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
.... e non va oltre.
Ho anche provato ad inserire la creazione di un file di statistiche con l'opzione
-vstats_file " & User.Home & "/MFRfile.txt "
nel comando di ffmpeg (che da terminale genera perfettamente tale file di statistica), ma dopo l'avvio del comando da "shell comando" (nell'applicativo gambas), del file di statistiche non c'e' ne e' traccia ...