Jump to content
Tuts 4 You
LCF-AT

Looking for a small Timestamp fixer

Rate this topic

Recommended Posts

LCF-AT

Hi guys,

I have a new question.Since I do work / play around with rtmp online streams I found that some streams having wrong timestamp problems and you cant seek a video if you play it.Earlier I found a solution to fix such flv files using ffmpeg tool using just the copy paramters...

ffmpeg -i VIDEO -vcodec copy -acodec copy VIDEO_OUTPUT

...to fix the problem.So the ffmpeg staic tool is large with almost 40 MB and I only looking for that timestamp fix part I would like to have in a custom small size file where I can drag a file onto.So is there a way to compile such file only with that fixing part from ffmpeg source?So I dont what this whole ffmpeg package for this case.

greetz

Share this post


Link to post
Share on other sites
icarusdc

I usually use Delphi ffmpeg plugin to convert movie/song files. it has small size. search on Google by typing delphi ffmpeg. it should be the top search. unfortunately, it's paid version. it has trial version with some limits like a watermark in your file, converting times only for 5 minutes.

 

Salam

  • Like 1

Share this post


Link to post
Share on other sites
LCF-AT

Hi,

so I am just looking for a small size ffmpeg commandline tool which only has that fixing function but I cant compile any own version of that or wrapper or how its called etc.At the moment I just put the large ffmpeg file into same app folder and for fixing any file I just drag the file into my app what then does output the fixed file.Its ok so far for my use but just would like to have a smaller ffmpeg file and not that large 30 MB +/- one you know.

greetz

Share this post


Link to post
Share on other sites
icarusdc

yeah, this plugin has same commandline like ffmpeg. you can use ffmpeg commandline with this plugin. it doesnt need 30MB+ ffmpeg.exe anymore. because I dont have paid version, my tool is a Delphi app from its demo (size lower than 100KB) and its BPL plugin (size lower than 1MB) so the tool is only lower than 2MB. 

 

Salam

  • Like 1

Share this post


Link to post
Share on other sites
LCF-AT

Hi,

hmmm so I am not sure how I could use that (for not delphi coding).The filesizes of all these downloads on that site of ffmpeg xy are starting from 7,2 MB - 49 MB.

So as I said before,I only need that timestamp flv fixing function and thats all.Somehow it should be possible to compile any ffmpeg custom light static version but for that I have no plan how to compile that etc.

greetz

Share this post


Link to post
Share on other sites
kao

There is no small "timestamp fixer function" in ffmpeg.

Your ffmpeg command actually processes the entire flv/mp4/whatever file, breaks it down into audio and video streams, breaks each stream into frames/samples and then puts it all together again but with proper timestamps and indexes. So, you need support for all the file formats but don't need any codec, except "copy", no filters or parsers.

It's a highly unusual use-case.

If you can build your own ffmpeg lib, here's a link to get you started: https://stackoverflow.com/questions/24849129/compile-ffmpeg-without-most-codec If not, just use the ready-made binaries and spend your energy on something more productive.

  • Like 1

Share this post


Link to post
Share on other sites
LCF-AT

Hi again,

so I found a example video how to build a ffmpeg version using MinGW on windows.The video is already a old one and not sure whether its still working on that way with any latest version.

https://www.youtube.com/watch?v=3yhkX0uaQGk

Next problem I have is which ffmpeg version I should download which I can also use for that.On the DL page I only find dev / shared / static builds but in none of these are the files like install like in the video.

https://ffmpeg.zeranoe.com/builds/win32/

Next problem I dont know what options I have to enable / disable only to get at the end this timestamp +/- function into the build and to get a small ffmpeg file out.

On the other hand I tried to find any ready static win32 builds by anyone which has the lowest size with just minimum or basic features but didnt found any other custom ffmpeg builds yet.

Some hints about that are welcome.

greetz

 

Share this post


Link to post
Share on other sites
evlncrn8

might just be easier to use video to video (http://www.videotovideo.org/) to do a conversion on it, making it smaller (x264) which should also fix things.. worth a shot, its free too

  • Like 1

Share this post


Link to post
Share on other sites
LCF-AT

Hi,

I dont wanna convert the files or something,just wanna have that quick timestamp fixing what ffmpeg can do you know.I am just looking for a very tiny static ffmppeg x86 build I can put into my app folder instead to put whole +/- 40 MB ffmpeg into.If my app did created a timestamp broken file then I just drag it into my app GUI and it does execute ffmpeg with the copy commands (I did post above) and a new fixed file will created I can use and seek.Its all working already so far as I wanted and I am just looking for a way to get any small light ffmpeg file and not that big one in this case.

I didnt checked yet whether it brings something to pack the ffmpeg with UPX or so to get it a lot smaller maybe.This other custom compiling stuff I dont understand yet.I think if I try this anyhow then happens for sure any other new errors I cant handle then without to goog endless.

greetz

Share this post


Link to post
Share on other sites
LCF-AT

Hi,

today I used UPX packer for ffmpeg 37 MB statuc build and get a packed size of 14 MB with best ratio option. :) Better than nothing.Or I use ffmpeg 1.0.1 and get size of 7 MB.This version works too.Maybe I try to play around with compiling again to get any very small file.

greetz

Share this post


Link to post
Share on other sites
LCF-AT

Hi again,

ok I did check out the MinGW + ffmpeg source (ffmpeg-3.4.1.tar.bz2) and the video I did post above.Now I did the steps so far I could and it does create tons of files and take a long time (40 minutes) and at the end I got also a new ffmpeg file out with a size of 16 MB and the whole folder is messed up.I created a ffmpeg folder inside of ffmpeg source and used command...

configure --prefix=ffmpeg/ --disable-network --disable-network --disable-debug --disable-yasm  // same as in video

and after longer time I got message that --disable-yasm is removed and should use --disable-x86asm

Then I did enter make command and did wait a long time again and thats all.Note sure whether the command install make is needed or not so I didnt execute this.

The question now is what I could disable more.I have test a little around...

configure --prefix=ffmpeg/ --disable-everything --disable-network --disable-debug --disable-x86asm --enable-encoders --enable-decoders --enable-muxers --enable-parsers

etc but seems I have to enable protocols too.In the cofig.h file are tons of entrys but not sure what I need to enable for my thing.

greetz

Share this post


Link to post
Share on other sites
LCF-AT

Hi again,

ok I did some more tests with disabled / enable commands.I tried to enable some encoders / decoders / muxers / demuxers...

Quote

configure --prefix=ffmpeg/ --disable-everything --disable-network --disable-debug --disable-x86asm --enable-protocol=file --enable-static --enable-small --enable-decoder=flv --enable-decoder=h261 --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=hevc --enable-demuxer=flv --enable-demuxer=h261 --enable-demuxer=h263 --enable-demuxer=h264 --enable-demuxer=hevc --enable-demuxer=mp4 --enable-demuxer=avi --enable-muxer=flv --enable-muxer=h261 --enable-muxer=h263 --enable-muxer=h264 --enable-muxer=hevc --enable-muxer=mp4 --enable-muxer=avi --enable-encoder=flv --enable-encoder=h261 --enable-encoder=h263 --enable-encoder=h264 --enable-encoder=hevc

...not sure whether I do need them but just added all with flv / h26x.Some are not supported so I get infos about it...

Quote

WARNING: Option --enable-demuxer=mp4 did not match anything
WARNING: Option --enable-encoder=h264 did not match anything
WARNING: Option --enable-encoder=hevc did not match anything

...just found these on internet of others who did post it but I think I can remove these next time.So with the command above I get a working ffmpeg file out which has a size of 2.6 MB and with UPX packing I get 886 KB what is already much better. :)

So kao,you said I dont need to use any filter / codec / parsers just the copy one and file formats.In the config file I only find that about copy...

Quote

#define CONFIG_ACOPY_FILTER 0

...so what I have to enable all?I tried this for example...

Quote

configure --prefix=ffmpeg/ --disable-everything --disable-network --disable-debug --disable-x86asm --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --enable-protocol=file --enable-static --enable-small --enable-filter=acopy --enable-filter=copy --enable-filter=format

...but in the created file I get error about invalid data found when processing input 123.flv.Then I tried just to add one more command --enable-demuxer=flv but also got error about h264.Now I addedd more demuxers --enable-demuxer=flv --enable-demuxer=h261 --enable-demuxer=h263 --enable-demuxer=h264 --enable-demuxer=hevc but also didnt work and I get the erros...

Quote

[flv @ 005b65e0] Could not find codec parameters for stream 1 (Video: h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, flv, from '123.flv':

[NULL @ 01e6d9c0] Unable to find a suitable output format for '123_fix.flv'
123_fix.flv: Invalid argument

greetz

Share this post


Link to post
Share on other sites
LCF-AT

Hi again,

after many tests I used this whole commands now...

Quote

configure --prefix=ffmpeg/ --disable-everything --disable-autodetect --disable-shared --disable-runtime-cpudetect --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-network --disable-debug --disable-x86asm --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --enable-protocol=file --enable-static --enable-small --enable-decoder=flv --enable-decoder=h261 --enable-decoder=h263 --enable-decoder=h264 --enable-demuxer=flv --enable-demuxer=h261 --enable-demuxer=h263 --enable-demuxer=h264 --enable-muxer=flv --enable-muxer=h261 --enable-muxer=h263 --enable-muxer=h264 --enable-muxer=mp4 --enable-encoder=flv --enable-encoder=h261 --enable-encoder=h263

...I also had to use --disable-autodetect to prevent creating libiconv-2.dll imports in the build.The dll is only to find in MinGW bin folder.With the options above its working with my flv / h26* files and after using UPX packer I get a ffmpeg size of 775 KB only. :) Maybe I could it make more smaller (not sure what I could disable more) but compiling does take always few minutes to check single command out.

greetz

  • Like 1

Share this post


Link to post
Share on other sites
kao

EDIT: oh, you've figured it out. Congrats! :)

Edited by kao (see edit history)
  • Like 2

Share this post


Link to post
Share on other sites
LCF-AT

Hi again,

yes it seems I got it kao. :) I made a tiny example app using my compiled tiny ffmpeg version what does fix flv files (just for testing and fun).Maybe anyone would like to test it etc.I just attach the files below.Just only need to drag one or more flv files into and to get new files out.

FLV Stream Fixer 1.0.rar

greetz

  • Like 1

Share this post


Link to post
Share on other sites
antrobs

Congratulation on your flv stream fixer...:thumbs:

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...