Autor Beitrag
MDX
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 25.05.08 09:04 
Hab mal ne Frage, wie man FFMPEG nutzen kann....

Weiß von PHP mit exec, geht dann mit Delphi mit PCHAR???

Außerdem, was für ne Datei ich bei Delphi ansprechen muss...


Danke

David
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 25.05.08 09:40 
user profile icondavid-kurz hat folgendes geschrieben:
Weiß von PHP mit exec, geht dann mit Delphi mit PCHAR???


Diese Frage zeigt einfach nur, dass du dich bereits dermaßen umfassend mit dem Thema befasst hast, dass du ein wahrer Experte bist, dem man nicht weiter helfen kann. Bezugnehmend auf die etwas spaßigen Bemerkungen in der SB gestern dazu werfe ich einfach nochmal Canvas in den Raum, damit sollte das auch gehen.

_________________
We are, we were and will not be.
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 25.05.08 10:04 
user profile iconGausi hat folgendes geschrieben:
user profile icondavid-kurz hat folgendes geschrieben:
Weiß von PHP mit exec, geht dann mit Delphi mit PCHAR???


Diese Frage zeigt einfach nur, dass du dich bereits dermaßen umfassend mit dem Thema befasst hast, dass du ein wahrer Experte bist, dem man nicht weiter helfen kann. Bezugnehmend auf die etwas spaßigen Bemerkungen in der SB gestern dazu werfe ich einfach nochmal Canvas in den Raum, damit sollte das auch gehen.


Ich weiß aber nicht genau wie man das aufruft (also von FFMPEG her, Syntax)
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: So 25.05.08 10:23 
Du weißt nicht wie mans aufruft .. hmm, das is oft so ein Problem :-/
In der Doc steht wohl das wichtigste drinne: ffmpeg.mplayerhq.hu/documentation.html

_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 25.05.08 10:42 
user profile iconFighter#1 hat folgendes geschrieben:
Du weißt nicht wie mans aufruft .. hmm, das is oft so ein Problem :-/
In der Doc steht wohl das wichtigste drinne: ffmpeg.mplayerhq.hu/documentation.html



Muss ich die ffmpeg.exe aufrufen?

Weil einfach
Zitat:
ffmpeg -i .....


wird ja in Delphi nicht gehen...
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 25.05.08 10:54 
So, ich rufe es jetzt so auf:

ausblenden Delphi-Quelltext
1:
ShellExecute(handle,'open','ffmpeg.exe',PChar('ffmpeg -i datei.avi -ar 22050 -r 12 -s 200x150 -f flv -b 100 datei.flv'),nil,SW_SHOWNORMAL);					


Und bekomme:
Moderiert von user profile iconNarses: Bild als Anhang hochgeladen

Woran liegt das?
Einloggen, um Attachments anzusehen!
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: So 25.05.08 11:07 
das lange, was bei dir im PChar steht, sind nur die Parameter... das davor ist das Programm, was aufgerufen werden soll...
Wenn du das jetzt noch in einem Gedankengang mit der letzten Zeile in der Konsole kombinierst, solltest du rausfinden woran es liegt...

_________________
1405006117752879898543142606244511569936384000000000.
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 25.05.08 11:24 
user profile iconWolle92 hat folgendes geschrieben:
das lange, was bei dir im PChar steht, sind nur die Parameter... das davor ist das Programm, was aufgerufen werden soll...
Wenn du das jetzt noch in einem Gedankengang mit der letzten Zeile in der Konsole kombinierst, solltest du rausfinden woran es liegt...


Okay, danke


Lösung:
ffmpeg entfernt ;)
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: So 25.05.08 13:29 
und jetzt funktionierts auch?

_________________
1405006117752879898543142606244511569936384000000000.
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 25.05.08 22:34 
user profile iconWolle92 hat folgendes geschrieben:
und jetzt funktionierts auch?


Ja ;-)

Wie kann ich jetzt auslesen, wie weit das encodiert ist und das als progressbar anzeigen lassen?
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 26.05.08 17:06 
gar nicht, SUPER lässt den Balken auch einfach durchlaufen...

_________________
1405006117752879898543142606244511569936384000000000.
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: Mo 26.05.08 17:24 
user profile iconWolle92 hat folgendes geschrieben:
gar nicht, SUPER lässt den Balken auch einfach durchlaufen...


Na dann...

THX

*CLOSED
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: Fr 30.05.08 06:45 
Ich habe ein neues Probblem:

Mein Programm lädt das Video von YouTube usw. runter und danach soll das Video (optional) encodiert werden, afür benutze ich folgenden Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm2.Button9Click(Sender: TObject);
begin
ShellExecute(handle,'open','ffmpeg.exe',PChar('-i '+savedialog1.filename+' -ar 30000 -r 12 -s 1024x768 -f mpg -b 100 '+savedialog1.filename+'.MPG'),nil,SW_SHOWNORMAL);

end;

procedure TForm2.YouTubeEncodeInAvi(Sender: TObject);
begin
ShellExecute(handle,'open','ffmpeg.exe',PChar('-i '+savedialog1.filename+' -ar 30000 -r 12 -s 1024x768 -f avi -b 100 '+savedialog1.filename+'.AVI'),nil,SW_SHOWNORMAL);
end;

procedure TForm2.Button10Click(Sender: TObject);
begin
ShellExecute(handle,'open','ffmpeg.exe',PChar('-i '+savedialog1.filename+' -ar 30000 -r 12 -s 1024x768 -f wmv -b 100 '+savedialog1.filename+'.WMV'),nil,SW_SHOWNORMAL);

end;


Und das FFMPEG sagt, das irgendwas nicht stimmt, aber was kann ich nicht lesen, da sich das fenster sofort wieder schließt!?

Habt ihr Hilfe dafür!?

THX
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Fr 30.05.08 07:31 
2 Möglichkeiten:

Entweder du bastelst erstmal auf der Console rum bis du nen passenden befehl hast, oder du verwendest was wie TDosCommand um den Output einzusammeln.

IMHO müsstest du noch den Codec/FOURCC noch irgendwo angeben. Die Formate sind ja alle nur Container.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: Fr 30.05.08 12:38 
Und wie genau fange ich das ab?
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Fr 30.05.08 14:12 
schreib den Befehl, den du mit shell execute aufrufst einfach einmal in die Konsole rein, die schließt sich nicht...

_________________
1405006117752879898543142606244511569936384000000000.
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: Fr 30.05.08 14:24 
Dann kommt das:


Zitat:
C:\**************>C:\*********************\ffmpeg.exe -i 1.flv -ar 30000 -r
12 -s 800x600 -f avi -b 100 1.avi
FFmpeg version SVN-r8599, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-memalign-hack --enable-libfaac --enable-libogg --enabl
e-libtheora --enable-libvorbis --enable-x264 --enable-xvid --enable-amr-nb --ena
ble-amr-wb --enable-amr-if2 --enable-gpl --enable-libmp3lame
libavutil version: 49.4.0
libavcodec version: 51.40.2
libavformat version: 51.11.0
built on Apr 3 2007 11:02:41, gcc: 3.4.2 (mingw-special)
1.flv: I/O error occured
Usually that means that input file is truncated and/or corrupted.



Aber eigentlich kann FFMPEG FLV Encodieren, oder?

Edit:
Die Datei 1.flv hat übrigens 835KB
Einloggen, um Attachments anzusehen!
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: Fr 30.05.08 16:43 
So, habe gelsesen, dass man alles Großschreiben soll, aber das geht auch nicht:

Zitat:
FFmpeg version SVN-r8599, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-memalign-hack --enable-libfaac --enable-libogg --enabl
e-libtheora --enable-libvorbis --enable-x264 --enable-xvid --enable-amr-nb --ena
ble-amr-wb --enable-amr-if2 --enable-gpl --enable-libmp3lame
libavutil version: 49.4.0
libavcodec version: 51.40.2
libavformat version: 51.11.0
built on Apr 3 2007 11:02:41, gcc: 3.4.2 (mingw-special)

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000
/1) -> 25.00 (25/1)
Input #0, flv, from 'C:\**********\1.FLV':
Duration: 00:00:20.6, start: 0.000000, bitrate: 64 kb/s
Stream #0.0: Video: flv, yuv420p, 320x240, 25.00 fps(r)
Stream #0.1: Audio: mp3, 22050 Hz, mono, 64 kb/s
Unknown input or output format: AVI

C:\***********>C:\******************\FFMPEG.exe -i C:\**************\1.FLV -f MPG C:\*********\1.MPG
FFmpeg version SVN-r8599, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-memalign-hack --enable-libfaac --enable-libogg --enabl
e-libtheora --enable-libvorbis --enable-x264 --enable-xvid --enable-amr-nb --ena
ble-amr-wb --enable-amr-if2 --enable-gpl --enable-libmp3lame
libavutil version: 49.4.0
libavcodec version: 51.40.2
libavformat version: 51.11.0
built on Apr 3 2007 11:02:41, gcc: 3.4.2 (mingw-special)

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000
/1) -> 25.00 (25/1)
Input #0, flv, from 'C:\*****\1.FLV':
Duration: 00:00:20.6, start: 0.000000, bitrate: 64 kb/s
Stream #0.0: Video: flv, yuv420p, 320x240, 25.00 fps(r)
Stream #0.1: Audio: mp3, 22050 Hz, mono, 64 kb/s
Unknown input or output format: MPG


Wo liegt hier das Problem??!
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Fr 30.05.08 17:29 
user profile icondavid-kurz hat folgendes geschrieben:
Wo liegt hier das Problem??!


Hier:
user profile iconMartok hat folgendes geschrieben:
IMHO müsstest du noch den Codec/FOURCC noch irgendwo angeben. Die Formate sind ja alle nur Container.

AVI und MPG sind nur Container, keine Formate...

Und nochmal ne Runde Docs lesen: man braucht -f normalerweise nicht.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
MDX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: Fr 30.05.08 18:11 
So, jetzt mache ich es so:

Zitat:
C:\Windows\system32>c:\users\admin\desktop\mmd\ffmpeg.exe -i C:\USERS\ADMIN\DESK
TOP\MMD\1.flv -vcodec mpeg4 -b 22500 C:\USERS\ADMIN\DESKTOP\MMD\1.mpg
FFmpeg version SVN-r8599, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-memalign-hack --enable-libfaac --enable-libogg --enabl
e-libtheora --enable-libvorbis --enable-x264 --enable-xvid --enable-amr-nb --ena
ble-amr-wb --enable-amr-if2 --enable-gpl --enable-libmp3lame
libavutil version: 49.4.0
libavcodec version: 51.40.2
libavformat version: 51.11.0
built on Apr 3 2007 11:02:41, gcc: 3.4.2 (mingw-special)

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000
/1) -> 25.00 (25/1)
Input #0, flv, from 'C:\USERS\ADMIN\DESKTOP\MMD\1.flv':
Duration: 00:00:20.6, start: 0.000000, bitrate: 64 kb/s
Stream #0.0: Video: flv, yuv420p, 320x240, 25.00 fps(r)
Stream #0.1: Audio: mp3, 22050 Hz, mono, 64 kb/s
Output #0, mpeg, to 'C:\USERS\ADMIN\DESKTOP\MMD\1.mpg':
Stream #0.0: Video: mpeg4, yuv420p, 320x240, q=2-31, 22 kb/s, 25.00 fps(c)
Stream #0.1: Audio: mp2, 22050 Hz, mono, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. Do not report crashes to FFmpeg developers.
frame= 515 fps= 0 q=31.0 Lsize= 422kB time=20.6 bitrate= 167.9kbits/s
video:254kB audio:161kB global headers:0kB muxing overhead 1.787586%


Bekomme jetzt die Datei, aber immer ohne Video!?

(Habe keine Lust mehr auf Zensieren :wink: )