Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 22nd February 2020, 02:27   #1  |  Link
shae
Registered User
 
Join Date: Jun 2006
Posts: 347
Can ffmpeg remux h264 while skipping bad frames?

Whether the problem is the raw h264 or the container frames, and ideally recovering as much as possible.

I thought maybe -err_detect can help, but it just allows everything through.

Last edited by shae; 22nd February 2020 at 02:31.
shae is offline   Reply With Quote
Old 22nd February 2020, 15:40   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,187
in short: no
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 22nd February 2020, 16:13   #3  |  Link
shae
Registered User
 
Join Date: Jun 2006
Posts: 347
Any other tool that can help?

I have a video that mostly plays fine, but with a few bad spots that cause a freeze for a few seconds each. I'm hoping to cut out these, without reencoding.

Last edited by shae; 22nd February 2020 at 17:24.
shae is offline   Reply With Quote
Old 22nd February 2020, 16:28   #4  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,187
If you don't cut out whole groups of pictures (gops) you won't get around reencoding and depending on the source gops are usually not that short that cutting would not go unnoticed.
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 22nd February 2020, 18:05   #5  |  Link
shae
Registered User
 
Join Date: Jun 2006
Posts: 347
It will surely be noticed, but after a broken segment I want to keep everything starting from the next semi-valid delta frame.

Anyway, turns out it can be done with Avidemux (though manually).
For each good segment I set markers and direct-copied to a new file, then finally joined them all.
Apparently copying raw frame data as-is is possible even when the range markers are on non-I frames.

And a correction: it actually wasn't H264, it's MPEG4 part 2, maybe ASP.
shae is offline   Reply With Quote
Old 22nd February 2020, 19:43   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 8,539
I believe that Avidemux will re-encode just the partial decoded gops [also same for old MPeg2Cut2 and mpg2 files, long time since I used either one].
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 23rd February 2020, 21:08   #7  |  Link
shae
Registered User
 
Join Date: Jun 2006
Posts: 347
I used "Copy" mode, so no reencoding. It seems to have copied also delta frames in the starts and ends, according to the set range markers.
shae is offline   Reply With Quote
Old 25th February 2020, 11:03   #8  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 2,910
Quote:
Originally Posted by StainlessS View Post
I believe that Avidemux will re-encode just the partial decoded gops [also same for old MPeg2Cut2 and mpg2 files, long time since I used either one].
Sorry, no, this is not true in both cases...

Neither AviDemux nor Mpeg2Cut2 can perform "Smart Rendering", i.e. just reencode the GOP where a cut point is requested.

For MPEG2 the only free smart render solution is still Cuttermaran. And for H264 clips I am not aware of any free tools which can do this.

A lot of commercial video editors like the offerings by Magix, Cyberlink, Pinnacle, Pegasys and others claim that they can do smart rendering for H.264 and even H.265, but several test reports revealed that this is not really true.

For cutting H.264 clips at key frames there are several free solutions, but the only half way working solution for cutting at random frames is VidCutter. Looks like it has been abandoned, but I find it very useful. It works better with MP4 containers than with MKV, and it really helps to replace the included FFmpeg version with a current version.
manolito is offline   Reply With Quote
Old 25th February 2020, 11:52   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 8,539
Quote:
For MPEG2 the only free smart render solution is still Cuttermaran.
Yep, thats right, I confused it with Mpeg2Cut2, (Cuttermaran, although I thought it was CutterMan, I even have it in a directory called CUTTERMAN).

Thanx Mani.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.