FLV fixer scriptI have created a new script for repairing the FLV files based on the flv processing code taken from my another script AdobeHDS. it can help you in following scenarios.
You can use script with following switches: Code:
--help displays this help Code:
https://github.com/K-S-V/Scripts |
Re: FLV fixer scriptWonderful, thanks!
|
Re: FLV fixer scriptChanges:
Code:
1. rebase timestamps to zero + other improvements |
Re: FLV fixer scriptKSV, would it be difficult to write a script or modify the flvFixer script so it can read several chunks/parts from an Flv video and then save them as a single video in one process?
I have quite a few large Flv videos (some are over 2GB) I need to cut first and then join the cut parts together, but I'm having a lot of problems finding a freeware application that can do it properly. Some applications crash with large files, because they want to load the entire video in memory. Other applications can cut only 1 part at once, which takes a lot of time and other applications don't support Nellymoser or Speex audio, even though it's raw file editing. I'd like to edit based on seconds or perhaps milliseconds. I know that every video needs to start on a keyframe, which means it won't always cut exactly on the specified start time, but that's not a problem. For example: --parts 39-249,583-937,1292-1819 cut from second 39 to 249 cut from second 583 to 937 cut from second 1292 to 1819 Save the parts as a single Flv video. |
Re: FLV fixer scriptQuote:
|
Re: FLV fixer scriptQuote:
I'm not a PHP programmer, but I'll play around with the FlvFixer script and maybe I can add it myself. I rather have the PHP script, it gives me more control and I can add little things, like "duration" metadata that some video players require to be able to seek. |
Re: FLV fixer scriptI've been playing around with the FlvFixer script for a while. I know that packet 2021, 4181, 8230 and 10607 are keyframes and I have currently hardcoded them as a test.
The code below works fine, it extracts the parts from keyframe 2021 to 4181 and from keyframe 8230 to 10607. The only problem I don't know how to solve is fixing the timestamps. The timestamps of the first part are fixed correctly, but not the second part. Is there an "easy" fix for that? Code:
while ($filePos < $fileLen) |
Re: FLV fixer scriptQuote:
|
Re: FLV fixer scriptUnfortunately not. AVIDemux is one of those tools that does not support Nellymoser audio, even though it's just raw file editing.
When I load the Flv video it first complains that no audio decoder can be found. When I try to save the video anyway it complains about unsupported audio and that saving the video has failed. |
Re: FLV fixer scriptIMO trying to add editing capabilities (sort of) to this script is out of scope for it's intended purpose though you are free to play around with your copy.
|
Re: FLV fixer scriptKSV do u have any script for fix live stream audio is not sync for video.
|
Re: FLV fixer scriptQuote:
If the first part is one minute long, then the timestamp of the last video frame is 1:00.724, this is correct, but the timestamp of the first video frame of the second part starts with 5:37.141. I don't know if there's a fairly easy fix for that or if a large part of the script needs to be rewritten, which is not worth it. |
Re: FLV fixer scriptQuote:
|
Re: FLV fixer scriptKSV, Can you please add trim option in this script?
|
Re: FLV fixer scriptQuote:
|
Re: FLV fixer scriptTrimming Video! For example, I give it a duration or imputing a value that trim from a time to another time! like start and stop of rtmpdump!
|
Re: FLV fixer scriptKSV is there any way you can modify the script to fix the videos from MyFreeCams.com, Naked.com and Cams.com?
These websites deliberately put a random wrong timestamp in the video after 2/10th of a second, so most video players are not able to play the recorded videos properly. VLC can play them, but most other video players play only those first 2/10th of a second. The only frames with the correct timestamp are the keyframes. ![]() |
Re: FLV fixer scriptQuote:
|
Re: FLV fixer scriptHere's a small sample video.
<sample video deleted> |
Re: FLV fixer scriptI could be wrong but it appears you can fix this by simply remuxing with FFmpeg
Code:
$ ffmpeg -i sample.flv -c copy a.flv |
Re: FLV fixer scriptQuote:
With the sample video I posted above, I need to skip to 7 minutes before it starts to play the video. The first 7 minutes of the video is basically a still image of the first frame. First image is before fixing, second image is after fixing. ![]() ![]() |
Re: FLV fixer script@Elgero
i have made some specific fixes to correct files with such odd timestamps. try it out and post your feedback. http://pastebin.com/2CeNeArd |
Re: FLV fixer scriptKSV, thank you very much. The timestamps are fixed correctly now.
|
Re: FLV fixer scriptYet Another FLV Fixer: C file and compiled binary. Please test and provide your feedback.
|
Re: FLV fixer scriptTubeDigger, that one works fine too.
The only thing I've noticed is that VLC, MPC and WMP play the fixed videos without problems, but for example BSPlayer keeps playing the first 2/10th of a second over and over again (with both FLV Fixers). It must be BSPlayer, but I wonder what the problem might be. BSPlayer has no problems with playing FLV videos that don't have these odd timestamps. |
Re: FLV fixer scriptQuote:
Code:
ffmpeg -ss 1 a.flv -c copy b.flv |
Re: FLV fixer scriptQuote:
|
Re: FLV fixer scriptQuote:
this is a best windows noob tool seen here (in my opinion) just draw/drop your flv f4v to yaflvfix.exe works allmost on every file ------- great1! |
Re: FLV fixer scriptQuote:
|
Re: FLV fixer scripti have pushed the update to repo with a bit of more fine tuning.
@TubeDigger Thanx for your contributions. |
Re: FLV fixer scriptSlightly improved Yet Another FLV Fixer: C file and compiled binary.
|
Re: FLV fixer scriptThanks for the update TubeDigger
Best flvfixer ever made for windows noobs/pros (in my opinion) just drag/drop your flv f4v on yaflvfix.exe |
Re: FLV fixer scriptHi, I have a problem that I suppose most people don't have because I have "broken" the file I need fixed myself.
The problem is I have a series of flv files dumped with rtmpdump that I want to merge, which have identical video/audio streams with overlap so they can't simply be connected one after the other. (That is for example file1 goes from 0-1hr file2 goes 45mins to 2 hours, etc) I have linux so I am unable to try most of the merging tools I found with a google search, but avconv and ffdshow both seem to be unable to do it. The files all have identical video/audio streams and since they overlap I went and found a spot they are the same in a hex editor and simply used dd to trim them then cat to join them together. Once concatenated together the playback is perfect and seamless in the version of mplayer2 I have installed (2.1~git20120828.28228-1) from start to end, however it doesn't show total play time and the OSD time jumps backwards when it hits the join point in the files with the message: Code:
Decreasing video pts: 4.743000 < 50.986000 I was hoping these concatenated files could simply be run through ffmpeg with '-codec copy' but when ffmpeg (most recent compiled from their git) gets to the join it gives a series of errors like this: Code:
[flv @ 0x204cba0] st:0 PTS: 41471 DTS: 41471 < 50991 invalid, clipping So I have been searching around trying to figure out how to fix the timestamps. Presumably they just need to be resequenced so they line up as they should. I looked at the ffmpeg source code where the 'invalid, clipping' message is to see if I could edit it to adjust the timestamps instead of clipping but it is quite a bit over my head. So that is what brings me here. I have tried both the php script and compiled the latest yaflvfix.c which works fine on linux. The php script gives weird artefacting at the join which other attempts to fix haven't and the same large skip/too short video playback. The yaflvfix program gives seemingly identical results to ffmpeg, but the source code is a lot easier to understand so I think it is the closest I have gotten to fixing this problem. Now I am trying to work from the yaflvfix source to see if I can edit it to meet my needs, but I was hoping someone could help me as I am completely clueless about all of this. Maybe someone could do it very easily, whereas for me it is very difficult. I know nothing about video streams or editing them at all. Here is a 12000682 byte sample clip showing my problem. The first 6000000 bytes are from the first video file and contain the unmodified header, the last 6000682 bytes are from the second file which I need to join and of course are taken from the middle of some video/audio data which is identical in both files. This isn't exactly where I need to merge them but is the shortest clip I could make where they overlap. The actual files are much larger. http://www.mediafire.com/?y2h9o6dml11kaz1 Any assistance people could give with fixing this would be greatly appreciated. If the yaflvfix.c program can be modified to handle this type of file I think that seems most promising right now. As I said this file plays flawlessly in a recent mplayer2 build so there is no video or audio corruption at all, it appears to be entirely a problem with timestamps and how various software deals with the timestamps. Thank you for reading, and thank you for any help you can give. |
Re: FLV fixer script |
Re: FLV fixer scriptQuote:
I will try it on a much larger file soon with several "seams" and let you know how it goes, but I anticipate it would work fine. At any rate I could probably just join one file at a time then run the fix after each join if needed. Will these changes eventually be merged into the main script you host on github, or is it something too custom and alters the behaviour in a way that it no longer works for other files it was originally intended for? Thanks again. You fixed it so fast when I had been struggling with it for a long time. Your work is very much appreciated. |
Re: FLV fixer scripti have pushed the update to the repo. hopefully it wouldn't break any previous functionality. before reporting any problem with any of my scripts make sure you are using the latest version of the script from repo.
|
Re: FLV fixer scriptChanges:
Code:
1. improved performance of FlvFixer Code:
@echo off |
Re: FLV fixer scriptHey KSV,
I want to fix a FLV file which rtmpdump (live stream) generated. I get the following error: Code:
FlvFixer.php --debug --nometa --in foo.flv --out bar.flv Code:
KSV FLV Fixer |
Re: FLV fixer script@Mary Chris Smith
Well script isn't lying. rtmpdump actually saved the corrupt file. it's a known bug in official version which i fixed ages ago. you need to use my version of rtmpdump to save the proper file in such cases. if you wanna recover the already saved files you have to fix them first by hand. |
Re: FLV fixer scriptQuote:
|
All times are GMT -6. The time now is 12:59 PM. |