Recent

Author Topic: NON(!)-EXE FFPlay4Laz  (Read 62250 times)

metis

  • Full Member
  • ***
  • Posts: 206
Re: NON(!)-EXE FFPlay4Laz
« Reply #60 on: December 04, 2015, 04:46:08 pm »
@aradeonas

Quote
I checked it and I cant feel any changes
Differences in Sound, like SDL/Portaudio, ASIO/not ASIO, fine Clicks, etc. may be only audible with
according Equipment - with PC-Speakers or low Quality AudioAmps for sure not.
For not spending too much Money for a HiEnd-PA-Amp+LoudSpeakers (and not killing my Neighbours), I use: 
SoundCard: SoundBlaster Audigy 24bit -> Headphone-Amp -> AKG-Headphone (-> good Ears).
-> THEN You really get Differences in Sound ! :o It's like looking through a dirty/clean Window.

Quote
it still has suddenly close problem
= Known Issue - I'm on it. The current File ran max. 2,5h on my PC with MPG.
My Impression is, that it plays Movies longer than MusicClips (don't ask me why). %)   
The Seek as well seems to work better with Movies than with MusicClips.
I got Files, where the Seek works perfectly, whilst it fails totally with others. %)

Thanks for Your Mail. I really appreciate, that You try to help an Internet-Dinosaur, like me. :)
Life could be so easy, if there weren't those f*** Details.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: NON(!)-EXE FFPlay4Laz
« Reply #61 on: December 05, 2015, 09:25:38 am »
Quote
= Known Issue - I'm on it. The current File ran max. 2,5h on my PC with MPG.
My Impression is, that it plays Movies longer than MusicClips (don't ask me why). %)   
The Seek as well seems to work better with Movies than with MusicClips.
I got Files, where the Seek works perfectly, whilst it fails totally with others. %)
It just randomly crash in small or large files and Im sure you will solve it soon.
Quote
Thanks for Your Mail. I really appreciate, that You try to help an Internet-Dinosaur, like me.
My pleasure to help  :D

metis

  • Full Member
  • ***
  • Posts: 206
Re: NON(!)-EXE FFPlay4Laz
« Reply #62 on: December 07, 2015, 03:53:27 pm »
@aradeonas

Here is the next Release: see FFPlay4Laz_07.12.15 - 12.16, Changes:
- Some CodeCleaning and -Restructuring done
   -> Now, it should run stable (went all through a 13GB MPG-File, 3h45Min., until EOF). :)
- VideoImage pauses a bit faster.
- EOF-Handling started.
> Known Bugs: - AV-Sync gets lost, after Seeking to EOF.
                         - Seek is still weak: with some Files it works, with others it's erroneous. :-X
                         - Slight Clicks when Seeking, and when UnPausing.
Life could be so easy, if there weren't those f*** Details.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: NON(!)-EXE FFPlay4Laz
« Reply #63 on: December 07, 2015, 04:01:26 pm »
Yes you are right it now play very good and easy.Well done.
If you add a key down seeking it can be very good so when you push key down and keep it in that way it forward fastly .

Looking forward for the next version ;)

metis

  • Full Member
  • ***
  • Posts: 206
Re: NON(!)-EXE FFPlay4Laz
« Reply #64 on: December 21, 2015, 12:46:16 pm »
@aradeonas

Quote
when you push key down and keep it
Putting a 'SDL_EnableKeyRepeat()' would be the easiest Way to achieve this, but
without additional Code, ALL KeyDowns (e.g. <Space> to Pause/Unpause) are affected, as well.

At the Moment, I try to work out a GENERAL FFmpeg-Core, or -Engine for FPC;
Stuff like 'KeyRepeat' is better done outside of it.

In the Meantime, I've ported the updated C-File from DrangerTutorial (= 'tutorial07.c') to FPC.
It opens even faster, runs more stable, and first of all: it works with much more recent FFmpeg-DDLs.
I still got some minor Problems to be solved, but X-Mas is coming, so be patient with the first Release. :)


Speaking of X-Mas: Here is my X-Mas-Present for aradeonas & mercury:

In the Attachement You'll find my Port of the Dranger-C-File 'tutorial08.c' (= BEFORE being "up to date as of February 2015").
-> Any Suggestion, Correction, Improvement, BugNotice, etc. on this Code is appreciated.
But, keep in Mind:
it's NOT a complete AV-Player;
it's only the MINIMUM of Code You need to open, sync and output the Video-, and AudioStream (and to do a Seek), and
it's kept "as near as possible" to the original C-File, so that everyone can easily compare the two Languages.

-> Everyone may feel free to build up his own FFmpeg-MediaPlayer out of it.


Merry X-Mas to all.  O:-)
« Last Edit: January 05, 2016, 01:21:47 pm by metis »
Life could be so easy, if there weren't those f*** Details.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: NON(!)-EXE FFPlay4Laz
« Reply #65 on: December 22, 2015, 01:47:57 pm »
@metis thank you and very good.
Have a good XMas.

metis

  • Full Member
  • ***
  • Posts: 206
Re: NON(!)-EXE FFPlay4Laz
« Reply #66 on: December 29, 2015, 04:58:54 pm »
@aradeonas

see my Dropbox -> 'FFPlay4Laz\FFPlay4Laz_01_29.12.15 - 15.42'
to get the next Release of my FFPlay4Laz-ConsoleVersion #1
-> No big Differences; only some minor Changes done.

AND:

see my Dropbox -> 'FFPlay4Laz\FFPlay4Laz_02_29.12.15 - 15.44'
to get the FIRST Release of my FFPlay4Laz-ConsoleVersion #2 with UPDATED FFmpeg-DLLs,

Note: ALL Files and DLLs have changed (except of the the PortAudio-DLL),
      therefore You'll only find a ZIP-File in the Directory to get started with the new Version.

ConsoleVersion #2 of FFPlay4Laz is based(!) on the tutorial07.c-File from Dranger Tutorial
(http://dranger.com/ffmpeg/). It's using up to Date FFmpeg-Functions, like
'avformat_open_input()', 'avcodec_decode_video2()' and 'avcodec_decode_audio4()';
the FFmpeg-Wrapper are taken from 'FFVLC' (http://www.delphiffmpeg.com/headers/).

@Brian_ch
Finally I took the FFmpeg-Wrapper from 'FFVLC' to get started with updated FFmpegs, because
one FFmpeg-Funktion, that is essential for this Kind of Player, is missing in the newer
'USDX'-Wrapper (or, I didn't find it): 'av_gettime()'.

ConsoleVersion #2 should do quite the same like the first one, only with much more Codecs.

One tiny, but grave Problem left:
AudioDecoding does not always work well yet; in this Case, You'll get a nice Video with some noisy Sound.

-> ToDo in 2016.  :D
« Last Edit: January 05, 2016, 01:23:59 pm by metis »
Life could be so easy, if there weren't those f*** Details.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: NON(!)-EXE FFPlay4Laz
« Reply #67 on: January 02, 2016, 09:58:43 am »
Hi metis and happy new year.
I checked the new version and : Oh a lot of noise! noisssse :D
But no crash or problem in video just as before.
I hope in this year we make a good Player.

metis

  • Full Member
  • ***
  • Posts: 206
Re: NON(!)-EXE FFPlay4Laz
« Reply #68 on: January 21, 2016, 03:41:36 pm »
@aradeonas

Quote
I hope in this year we make a good Player.
First Step done: FFmpeg-AudioResampler added -> 'avcodec_decode_audio4()' works !  :D
-> Check my DropBox: FFPlay4Laz_02_21.01.16 - 14.22

Have a Look at the current State of the UltraStar-Project
https://github.com/skerit/ultrastardx/, and go to:
'src\media\UAudioDecoder_FFmpeg.pas' -> 'TFFmpegDecodeStream.DecodeFrame()'
  -> "{$IF LIBAVCODEC_VERSION >= 53025000}" ...
You'll see, that You'll see nothing: No 'avcodec_decode_audio4()' implemented yet.  :D :D :D

Notes:
- 'FFPlay4Laz_Console_01' is depreciated; use 'FFPlay4Laz_Console_02' instead.
- Pausing for a longer Time still causes AV-Sync-Problems.
- The Seek is faster and more stable with PortAudio (= 'FFPlay4Laz_Console_02_Pa.exe').
- All README-Files revised, and moved to 'FFPlay4Laz - DOCS'.
Life could be so easy, if there weren't those f*** Details.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: NON(!)-EXE FFPlay4Laz
« Reply #69 on: January 26, 2016, 03:44:53 pm »
@metis!
Excellent.
 Sound is very good and I got no problem in my tests. Still problem in forwading and moving in video but changes you amde for audio make it very good.

Waiting for next one ;)

metis

  • Full Member
  • ***
  • Posts: 206
Re: NON(!)-EXE FFPlay4Laz
« Reply #70 on: January 28, 2016, 05:34:57 pm »
@aradeonas

Quote
Still problem in forwading and moving in video
Please, describe this "problem" more detailed.
In my Tests, the Version with SDL-AudioOutput crashes quite often on the FIRST Seek after Opening; once it got over this, it works. The Version with Pa-AudioOutput opens&seeks fine.
-> I'm on it, to get this fixed, but finally I'm more interested in Portaudio.

Quote
changes you amde for audio make it very good
These Changes have to be done, when using 'avcodec_decode_audio4()'.
(BTW: Decoding AudioFrames was much more simple with 'avcodec_decode_audio2()'.)

The AudioResampler still needs some more WorkOut, but obviously it already runs quite well.
For those, who are interested in, how it's done, have a Look here:
https://github.com/FFmpeg/FFmpeg/blob/release/0.10/ffplay.c
-> go to "static int audio_decode_frame(VideoState *is, double *pts_ptr)"
    -> What's still to be worked out, is: "swr_set_compensation(".
This is (mainly), what I translated to FPC, to make 'avcodec_decode_audio4()' work.

Quote
Waiting for next one
Coming soon.  :)
Life could be so easy, if there weren't those f*** Details.

aradeonas

  • Hero Member
  • *****
  • Posts: 824
Re: NON(!)-EXE FFPlay4Laz
« Reply #71 on: January 28, 2016, 08:11:05 pm »
Quote
Please, describe this "problem" more detailed.
It doesnt support fast forward so I can keep key down and it goes fast, it actually write logs and reach to the end of the file and keep saying its the end of the file ;)

Frank

  • Jr. Member
  • **
  • Posts: 67
Re: NON(!)-EXE FFPlay4Laz
« Reply #72 on: January 30, 2016, 10:46:05 pm »
@metis
  Hi ! It appears we have been working on similar projects. Currently I have been working at implementing MP4/AAC for uos for my own Delphi converted to Lazarus projects. I also have projects (Delphi Win32) that use ffmpeg.exe that I want to convert to Lazarus/Fpc3.0. If it would be possible to assist/build on your efforts, I would be glad to assist. My goal is code for both Win/Linux. It makes more sense to work on unified result than several going in different directions...
  Let me know if I can help...

metis

  • Full Member
  • ***
  • Posts: 206
Re: NON(!)-EXE FFPlay4Laz
« Reply #73 on: February 15, 2016, 03:21:58 pm »
Sorry for answering so late, but last Week my really hard working HDD deceased (-> R.I.P.). O:-)
Before going on with this Project, I have to recover, restore and reinstall my entire System. :'(
One and only Benefit: I took the Opportunity to update to Lazarus v1.4.4. :D

Anyway, get the last Version before my Disk failed from my DropBox: FFPlay4Laz_02_15.02.16 - 13.51:
> Seek revised
  -> Now, the Seek is stable with SDL-Audio, too; Audio is slightly muted, when Seeking.

@aradeonas
Quote
It doesnt support fast forward so I can keep key down and it goes fast
I see, You really insist on the KeyRepeat-Feature. Though it is not projected at the Moment, I'll implement it for You - or maybe, Frank does...


@Frank
Quote
I have been working at implementing MP4/AAC for uos for my own Delphi converted to Lazarus
Initially, I intended to do the same, but then I decided to do something different.

Quote
I also have projects (Delphi Win32) that use ffmpeg.exe
For PascalCode to Transcode & Play via FFmpeg-EXEs, see e.g. 'WinFF':
http://www.winff.org

Quote
If it would be possible to assist/build on your efforts + Let me know if I can help...
Any Assistance is appreciated -> Take the Code, I published in the Attachment of my Thread, Dec. 21, 2015.
Though the current 'FFPlay4Laz' suffered some "slight Modifications" by me, the basic Structure, specially the Way, how the AV-Synchronization is done, did not change - Here some Ideas for You:
- Add KeyRepeat
- Add Pause/Unpause
  I already did (or better started) that, but up to now, it's not really satisfying, because:
  when Unpausing after a longer Period, the Audio-Sync gets lost - may be, You'll find a better Solution.
- Write a FFmpeg-Wrapper for 'FFPlay4Laz', like 'OvoPlayer' did for Audio only, see:
  https://github.com/varianus/ovoplayer/tree/master/src/import-engines, and
  open 'src\import-engines\ffmpeg.pas'.

And last, but not least:
'FFPlay4Laz' works quite fine, but in Order to turn it to a real "FFPlay for Lazarus",
the SDL-Threads, -Timers, and -Events could/should be replaced by Lazarus-Components.

Looking forward to Your Reply.

« Last Edit: February 15, 2016, 03:48:36 pm by metis »
Life could be so easy, if there weren't those f*** Details.

Frank

  • Jr. Member
  • **
  • Posts: 67
Re: NON(!)-EXE FFPlay4Laz
« Reply #74 on: February 16, 2016, 07:53:42 pm »
@metis  Thank you for your reply.

I used "DrangerTutorial08.c2FPC.lpr.zip" and with header files from "ultrastardx-1.1-src.tar.gz" the program compiled.
It, however, required the use of your version 1 dll's (avcodec-52.dll, etc).
I took a look at your source & found it interesting (I always enjoy studying/learning from others).
I would be glad to assist (as soon as I'm finished with Uos).

  1/ I agree, that Dynamic Lib Header files are needed,
  2/ then "FFPlay4Laz" becoming a thread(/file) to be used in program with,
  3/ the ability to pass THandle of window to thread, & video being displayed on that window.
  4/ "Pause/UnPause", I''ll attempt to make it just part of my learning curve  ;)

  If you are in agreement, I could start the above modifications, albeit after my work with Uos.


 

TinyPortal © 2005-2018