[FFmpeg-user] Packet corrupt on cut, notice on concat
I found the problem. FFmpeg is corrupting the last B-frame at the end of cuts. It shows up during subsequent concatenation. Why it's happening is unknown of course. There is no workaround that I can conceive of. --Mark. 000 PTS video 1 video 2 < 504197456 504204963 N=133560 _B[P]B_B_P_B_I_ _I_B_P_ <== 3 < 504201210 504201210 N=133559 [B]P_B_B_P_B_I_ _I_B_P_ < 504204963 504216225 N=133563 _B_P_B_B[P]B_I_ _I_B_P_ <== 2 < 504208717 504208717 N=133561 _B_P[B]B_P_B_I_ _I_B_P_ < 504212471 504212471 N=133562 _B_P_B[B]P_B_I_ _I_B_P_ < 504216225 504223732 N=133565 _B_P_B_B_P_B[I] _I_B_P_ <== 1 < 504219978 504219978 N=133564 _B_P_B_B_P[B]I_ _I_B_P_ join here > 504219979 504227486 N=133566 _B_P_B_B_P_B_I_ [I]B_P_ > 504227486 504234994 N=133568 _B_P_B_B_P_B_I_ _I_B[P] > 504231240 504231240 N=133567 _B_P_B_B_P_B_I_ _I[B]P_ 1 - If I trim the end of video 1 at the I-frame at N=133565 ffmpeg -copyts -i this.m2ts -map 0 -bsf:v noise=drop='lt(pts\,2854113)+gt(pts\,504223732)' -bsf:a noise=drop='lt(pts\,2854113)+gt(pts\,504223732)' -bsf:s noise=drop='lt(pts\,2854113)+gt(pts\,504223732)' %CODE% -muxdelay 0 "%TARGET%" I get "Packet corrupt (stream = 0, dts = 504219978)" and there's a glitch during play. 2 - If I back up and trim the end of video 1 at the P-frame at N=133563 ffmpeg -copyts -i this.m2ts -map 0 -bsf:v noise=drop='lt(pts\,2854113)+gt(pts\,504216225)' -bsf:a noise=drop='lt(pts\,2854113)+gt(pts\,504216225)' -bsf:s noise=drop='lt(pts\,2854113)+gt(pts\,504216225)' %CODE% -muxdelay 0 "%TARGET%" I get "Packet corrupt (stream = 0, dts = 504208717)" and there's a glitch during play. 3 - If I back up again and trim the end of video 1 at the P-frame at N=133560 ffmpeg -copyts -i this.m2ts -map 0 -bsf:v noise=drop='lt(pts\,2854113)+gt(pts\,504204963)' -bsf:a noise=drop='lt(pts\,2854113)+gt(pts\,504204963)' -bsf:s noise=drop='lt(pts\,2854113)+gt(pts\,504204963)' %CODE% -muxdelay 0 "%TARGET%" I get "Packet corrupt (stream = 0, dts = 504201210)" and there's a glitch during play. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Packet corrupt on cut, notice on concat
I don't know how "DTS" became "000". Sorry. It's 3AM and I'm a little punchy. I found the problem. FFmpeg is corrupting the last B-frame at the end of cuts. It shows up during subsequent concatenation. Why it's happening is unknown of course. There is no workaround that I can conceive of. --Mark. DTS PTS video 1 video 2 < 504197456 504204963 N=133560 _B[P]B_B_P_B_I_ _I_B_P_ <== 3 < 504201210 504201210 N=133559 [B]P_B_B_P_B_I_ _I_B_P_ < 504204963 504216225 N=133563 _B_P_B_B[P]B_I_ _I_B_P_ <== 2 < 504208717 504208717 N=133561 _B_P[B]B_P_B_I_ _I_B_P_ < 504212471 504212471 N=133562 _B_P_B[B]P_B_I_ _I_B_P_ < 504216225 504223732 N=133565 _B_P_B_B_P_B[I] _I_B_P_ <== 1 < 504219978 504219978 N=133564 _B_P_B_B_P[B]I_ _I_B_P_ join here > 504219979 504227486 N=133566 _B_P_B_B_P_B_I_ [I]B_P_ > 504227486 504234994 N=133568 _B_P_B_B_P_B_I_ _I_B[P] > 504231240 504231240 N=133567 _B_P_B_B_P_B_I_ _I[B]P_ 1 - If I trim the end of video 1 at the I-frame at N=133565 ffmpeg -copyts -i this.m2ts -map 0 -bsf:v noise=drop='lt(pts\,2854113)+gt(pts\,504223732)' -bsf:a noise=drop='lt(pts\,2854113)+gt(pts\,504223732)' -bsf:s noise=drop='lt(pts\,2854113)+gt(pts\,504223732)' %CODE% -muxdelay 0 "%TARGET%" I get "Packet corrupt (stream = 0, dts = 504219978)" and there's a glitch during play. 2 - If I back up and trim the end of video 1 at the P-frame at N=133563 ffmpeg -copyts -i this.m2ts -map 0 -bsf:v noise=drop='lt(pts\,2854113)+gt(pts\,504216225)' -bsf:a noise=drop='lt(pts\,2854113)+gt(pts\,504216225)' -bsf:s noise=drop='lt(pts\,2854113)+gt(pts\,504216225)' %CODE% -muxdelay 0 "%TARGET%" I get "Packet corrupt (stream = 0, dts = 504208717)" and there's a glitch during play. 3 - If I back up again and trim the end of video 1 at the P-frame at N=133560 ffmpeg -copyts -i this.m2ts -map 0 -bsf:v noise=drop='lt(pts\,2854113)+gt(pts\,504204963)' -bsf:a noise=drop='lt(pts\,2854113)+gt(pts\,504204963)' -bsf:s noise=drop='lt(pts\,2854113)+gt(pts\,504204963)' %CODE% -muxdelay 0 "%TARGET%" I get "Packet corrupt (stream = 0, dts = 504201210)" and there's a glitch during play. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Packet corrupt on cut, notice on concat
On 2024-02-18 01:52 pm, Mark Filipak wrote: I don't know how "DTS" became "000". Sorry. It's 3AM and I'm a little punchy. I found the problem. FFmpeg is corrupting the last B-frame at the end of cuts. It shows up during subsequent concatenation. Why it's happening is unknown of course. There is no workaround that I can conceive of. --Mark. DTS PTS video 1 video 2 < 504197456 504204963 N=133560 _B[P]B_B_P_B_I_ _I_B_P_ <== 3 < 504201210 504201210 N=133559 [B]P_B_B_P_B_I_ _I_B_P_ < 504204963 504216225 N=133563 _B_P_B_B[P]B_I_ _I_B_P_ <== 2 < 504208717 504208717 N=133561 _B_P[B]B_P_B_I_ _I_B_P_ < 504212471 504212471 N=133562 _B_P_B[B]P_B_I_ _I_B_P_ < 504216225 504223732 N=133565 _B_P_B_B_P_B[I] _I_B_P_ <== 1 < 504219978 504219978 N=133564 _B_P_B_B_P[B]I_ _I_B_P_ join here > 504219979 504227486 N=133566 _B_P_B_B_P_B_I_ [I]B_P_ > 504227486 504234994 N=133568 _B_P_B_B_P_B_I_ _I_B[P] > 504231240 504231240 N=133567 _B_P_B_B_P_B_I_ _I[B]P_ 1 - If I trim the end of video 1 at the I-frame at N=133565 ffmpeg -copyts -i this.m2ts -map 0 -bsf:v noise=drop='lt(pts\,2854113)+gt(pts\,504223732)' -bsf:a noise=drop='lt(pts\,2854113)+gt(pts\,504223732)' -bsf:s noise=drop='lt(pts\,2854113)+gt(pts\,504223732)' %CODE% -muxdelay 0 "%TARGET%" I get "Packet corrupt (stream = 0, dts = 504219978)" and there's a glitch during play. 2 - If I back up and trim the end of video 1 at the P-frame at N=133563 ffmpeg -copyts -i this.m2ts -map 0 -bsf:v noise=drop='lt(pts\,2854113)+gt(pts\,504216225)' -bsf:a noise=drop='lt(pts\,2854113)+gt(pts\,504216225)' -bsf:s noise=drop='lt(pts\,2854113)+gt(pts\,504216225)' %CODE% -muxdelay 0 "%TARGET%" I get "Packet corrupt (stream = 0, dts = 504208717)" and there's a glitch during play. 3 - If I back up again and trim the end of video 1 at the P-frame at N=133560 ffmpeg -copyts -i this.m2ts -map 0 -bsf:v noise=drop='lt(pts\,2854113)+gt(pts\,504204963)' -bsf:a noise=drop='lt(pts\,2854113)+gt(pts\,504204963)' -bsf:s noise=drop='lt(pts\,2854113)+gt(pts\,504204963)' %CODE% -muxdelay 0 "%TARGET%" I get "Packet corrupt (stream = 0, dts = 504201210)" and there's a glitch during play. Add -mpegts_flags +initial_discontinuity to get rid of the corrupt packet messages. This may or may not get rid of the glitches. Regards, Gyan ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Packet corrupt on cut, notice on concat
On 2024-02-18 09:59 pm, Mark Filipak wrote: On 18/02/2024 05.09, Gyan Doshi wrote: Add -mpegts_flags +initial_discontinuity to get rid of the corrupt packet messages. This may or may not get rid of the glitches. Regards, Gyan Hey, Gyan, No effect whatsoever. Same message, same glitches. I forgot to mention, it has to be added to the trim commands. Regards, Gyan ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] How to have dynamic FPS to only capture changes in i-frame
Hi, I have to record lectures to preserve quality (i.e. legibility of letters) and reduce file size, both to maximum possible extent. In our lectures, only 2 things happen - either tutor is full screen or the slides are fullscreen. Obviously, there is no time pattern when slides come and when teacher comes. Having read that some video format have I-frames that are used when scene changes significantly, so what commands can I pass to ffmpeg to have kind-of dynamic framerate - record only 1 frame when teacher is speaking and then capture another frame when slide (significant change in scene) comes or (more challenging) slide changes. It is okay to have video that looks choppy. I have kept audio at highest quality (untouched), but I am not sure how to achieve the above for video part of the file. Regards, ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Packet corrupt on cut, notice on concat
On Sun, Feb 18, 2024, 11:04 AM Mark Filipak wrote: > On 18/02/2024 11.53, Gyan Doshi via ffmpeg-user wrote: > > On 2024-02-18 09:59 pm, Mark Filipak wrote: > >> On 18/02/2024 05.09, Gyan Doshi wrote: > >>> > >>> Add -mpegts_flags +initial_discontinuity to get rid of the corrupt > packet messages. This may or > >>> may not get rid of the glitches. > >>> > >>> Regards, > >>> Gyan > >> > >> Hey, Gyan, > >> > >> No effect whatsoever. Same message, same glitches. > > > > I forgot to mention, it has to be added to the trim commands. > > Do you mean to '-ss' & '-to'? > > Oh, no, no. Even if it worked, what would I do with all the bad PTSs and > audio frames left dangling. > > No, '-ss' & '-to' are disasters. > I usually do not chime in on your emails where people flame you for writing a book or being a troll because I usually learn something from the discussions. Do you have any reaction at all to the news that decimal PTSs & DTSs are > being truncated up? Did you > know that? Why do you think it was done? > Lately you have not posted one example clip or logs from anything you have asked questions about. You're being vague and Gyan just gave you something to try and you refused to try with just more questions. If it not apparent to you yet, the ffmpeg code behaves differently depending on the switches, the options beneath the switches as well as the order of the switches. You keep wanting to recreate the atom bomb where everything is required to be in precision order with precision timing. Ffmpeg as stated by the developers has been cobbled together over the years to accommodate multiple containers and codecs inside them, yet for the last 2 weeks, you want it to be an atom bomb, where the order of switches and codes and their options as well as audio/video modifiers need to be used to accommodate your desired end results "has" to be defined somewhere, then I suggest you quit talking about your 50 year old programming of firmware and learn C so you can read the code and answer your own questions. Like I said, I used to be interested, but lately you are being obtuse and lazy - wanting someone else to teach you when you should be teaching yourself. Sorry, but I find this list valuable and you are starting to put a bad taste in my mouth. And Reindl and Paul - I don't need any smart ass comments. Reindal, I think that we are almost on all the same lists and everyone hates you, and Paul, you're ego would be bad in certain circles of technology people. --Mark. > ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".