Bug #179

ffmpeg produces corrupt output on occasion

Added by n8fr8 over 5 years ago. Updated over 5 years ago.

Status:ResolvedStart date:06/08/2012
Priority:NormalDue date:
Assignee:hans% Done:

0%

Category:-
Target version:v2 (now with Video)
Component:

Description

Not sure if this is related to the redact avfilter but something is definitely breaking in an unclear way.

some videos export/redact without problem, while others do not.

i do not have the source field yet, but perhaps the same config could be run on another file.

output656630428.3gp.txt Magnifier - redact file config (11.2 KB) n8fr8, 06/08/2012 12:10 am

output656630428.3gp - corrupt video file (1.59 MB) n8fr8, 06/08/2012 12:10 am

vf_redact.c Magnifier (21.9 KB) n8fr8, 06/11/2012 04:23 pm

leaktest.mp4 - test video from android device (32.1 MB) n8fr8, 06/28/2012 07:15 pm

leaktest.txt Magnifier - vf_redact input text file (14.8 KB) n8fr8, 06/28/2012 07:15 pm

ffmpeg-v0.9.2-crash.txt Magnifier (36.7 KB) hans, 06/29/2012 03:02 am

ffmpeg-v0.10.4-crash.txt Magnifier (36.1 KB) hans, 06/29/2012 03:02 am

vf_redact.c Magnifier (21.9 KB) andrew, 08/01/2012 08:56 pm

History

#1 Updated by n8fr8 over 5 years ago

[redact 0x14a6060] Failed to parse boxtrack '
' .
[scale
0x14a5b80] w:720 h:480 fmt:yuv420p -> w:480 h:320 fmt:yuv420p flags:0x4
[redact @ 0x14a6060] Redaction with 904 tracks

might have an empty track, but it does seem to get all 904 events.

#2 Updated by n8fr8 over 5 years ago

  • Assignee set to andrew

#3 Updated by n8fr8 over 5 years ago

i have reproduced this at the command line now running on Android. Seems like a memory leak. At some point about 1:08 in to the ffmpeg process, and about 5000kb of video processed, the launcher starts closing and acting weird, then the shell drops, and then when I go back into the device via adb shell, the file exists in the corrupted state.

#4 Updated by n8fr8 over 5 years ago

I have built the latest ffmpeg code, and the memory leak still exists there. Straight conversion of the file or resizing does not cause it. It only occurs when vf_redact is invoked.

I did try using the latest vf_redact code but received an error message about "output2 pad not being assigned". Is there a new command line syntax for invoking the newest redact code?

#5 Updated by n8fr8 over 5 years ago

I am getting a segfault when I run this using the attached vf_refact.c code:

./ffmpeg -y -i ./leaktest.mp4 -b 500k -r 15 -s 480x320 -vcodec libx264 -acodec copy -f mp4 -vf 'redact=./leaktest.txt [d] [out],[d]nullsink' /sdcard/foo8.mp4

#6 Updated by n8fr8 over 5 years ago

and here is the crash dump:

06-11 12:54:19.648: I/DEBUG: Build fingerprint: 'samsung/espressowifiue/espressowifi:4.0.3/IML74K/P3113UEALD3:user/release-keys'
06-11 12:54:19.648: I/DEBUG: pid: 30146, tid: 30146 >>> ./ffmpeg <<<
06-11 12:54:19.648: I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000004
06-11 12:54:19.648: I/DEBUG: r0 00000000 r1 00000001 r2 00000000 r3 00000000
06-11 12:54:19.648: I/DEBUG: r4 02bf1d30 r5 02bf1cc0 r6 000001e0 r7 00000140
06-11 12:54:19.648: I/DEBUG: r8 02bdf420 r9 00000000 10 02ce7a40 fp 00000003
06-11 12:54:19.648: I/DEBUG: ip 02bf1cc0 sp be9f9010 lr 000342a8 pc 00035bc0 cpsr 68000010
06-11 12:54:19.648: I/DEBUG: d0 39b259fe63d53f7f d1 fb3bc684fdff9b4b
06-11 12:54:19.648: I/DEBUG: d2 f22102a3023d04ef d3 11a8628d37148bc5
06-11 12:54:19.648: I/DEBUG: d4 2d0f0417e168aff1 d5 49b6df8e7d14d7a6
06-11 12:54:19.648: I/DEBUG: d6 86094060486df287 d7 95023778ee287db7
06-11 12:54:19.648: I/DEBUG: d8 0000000000000000 d9 0000000000000000
06-11 12:54:19.648: I/DEBUG: d10 0000000000000000 d11 0000000000000000
06-11 12:54:19.648: I/DEBUG: d12 0000000000000000 d13 0000000000000000
06-11 12:54:19.648: I/DEBUG: d14 0000000000000000 d15 0000000000000000
06-11 12:54:19.648: I/DEBUG: d16 a0a1a1a1a17c666b d17 a7a7a7a7a7afaea9
06-11 12:54:19.648: I/DEBUG: d18 a1a1a1a1836d6479 d19 a7a7a7a6a9b0ada3
06-11 12:54:19.648: I/DEBUG: d20 00000000000000a7 d21 909fa0a4a4988a9e
06-11 12:54:19.648: I/DEBUG: d22 0000000000000000 d23 a09fa3a49c939ba2
06-11 12:54:19.648: I/DEBUG: d24 00000000000000a7 d25 81989ba3a1968db0
06-11 12:54:19.648: I/DEBUG: d26 0000000000000000 d27 9899a1a39995acb0
06-11 12:54:19.648: I/DEBUG: d28 00000000000000a7 d29 81989ba3a1968db0
06-11 12:54:19.648: I/DEBUG: d30 0000000000000000 d31 9899a1a39995acb0
06-11 12:54:19.648: I/DEBUG: scr 20000010
06-11 12:54:19.703: I/DEBUG: #00 pc 00035bc0 /data/local/ffmpeg
06-11 12:54:19.703: I/DEBUG: #01 lr 000342a8 /data/local/ffmpeg
06-11 12:54:19.703: I/DEBUG: code around pc:
06-11 12:54:19.703: I/DEBUG: 00035ba0 e5942060 e3a00000 e59a1080 e38bb001 ` ..............
06-11 12:54:19.703: I/DEBUG: 00035bb0 e78a0103 e1a0500c e2413001 e58a3080 .....P...0A..0..
06-11 12:54:19.703: I/DEBUG: 00035bc0 e5827004 e284a004 e5826000 e28c7020 .p.......`.. p..
06-11 12:54:19.703: I/DEBUG: 00035bd0 e584b058 e3a06001 e598303c e2849024 X....`..<0..$...
06-11 12:54:19.703: I/DEBUG: 00035be0 e5843044 e8b5000f e58c6040 e1a0c00a D0......@`......
06-11 12:54:19.703: I/DEBUG: code around lr:
06-11 12:54:19.711: I/DEBUG: 00034288 e1a00008 e28dd08c e8bd83f0 e1a01006 ................
06-11 12:54:19.711: I/DEBUG: 00034298 e1a02005 e1a03007 e1a00004 eb000620 . ...0...... ...
06-11 12:54:19.711: I/DEBUG: 000342a8 e2508000 1affffea eaffffeb e5902014 ..P.......... ..
06-11 12:54:19.711: I/DEBUG: 000342b8 e5903008 e3520000 e92d4ff0 e1a05000 .0....R..O-..P..
06-11 12:54:19.711: I/DEBUG: 000342c8 e24dd0a4 e1a07001 e590600c e5918058 ..M..p...`..X...
06-11 12:54:19.711: I/DEBUG: stack:
06-11 12:54:19.711: I/DEBUG: be9f8fd0 02c1b170 [heap]
06-11 12:54:19.711: I/DEBUG: be9f8fd4 02be0560 [heap]
06-11 12:54:19.711: I/DEBUG: be9f8fd8 be9f9018 [stack]
06-11 12:54:19.711: I/DEBUG: be9f8fdc 00033768 /data/local/ffmpeg
06-11 12:54:19.711: I/DEBUG: be9f8fe0 00000002
06-11 12:54:19.711: I/DEBUG: be9f8fe4 02be0560 [heap]
06-11 12:54:19.711: I/DEBUG: be9f8fe8 be9f9028 [stack]
06-11 12:54:19.711: I/DEBUG: be9f8fec be9f9018 [stack]
06-11 12:54:19.711: I/DEBUG: be9f8ff0 00039800 /data/local/ffmpeg
06-11 12:54:19.711: I/DEBUG: be9f8ff4 000001e0
06-11 12:54:19.711: I/DEBUG: be9f8ff8 40900010
06-11 12:54:19.711: I/DEBUG: be9f8ffc 02be0560 [heap]
06-11 12:54:19.711: I/DEBUG: be9f9000 00039800 /data/local/ffmpeg
06-11 12:54:19.711: I/DEBUG: be9f9004 000001e0
06-11 12:54:19.711: I/DEBUG: be9f9008 df0027ad
06-11 12:54:19.711: I/DEBUG: be9f900c 00000000
06-11 12:54:19.711: I/DEBUG: #00 be9f9010 00000140
06-11 12:54:19.711: I/DEBUG: be9f9014 00000000
06-11 12:54:19.711: I/DEBUG: be9f9018 40900010
06-11 12:54:19.711: I/DEBUG: be9f901c 40925810
06-11 12:54:19.711: I/DEBUG: be9f9020 4092f810
06-11 12:54:19.711: I/DEBUG: be9f9024 00000000
06-11 12:54:19.711: I/DEBUG: be9f9028 000001e0
06-11 12:54:19.711: I/DEBUG: be9f902c 00000100
06-11 12:54:19.711: I/DEBUG: be9f9030 00000100
06-11 12:54:19.711: I/DEBUG: be9f9034 00000000
06-11 12:54:19.711: I/DEBUG: be9f9038 00000017
06-11 12:54:19.711: I/DEBUG: be9f903c 02bdf420 [heap]
06-11 12:54:19.711: I/DEBUG: be9f9040 000001e0
06-11 12:54:19.711: I/DEBUG: be9f9044 00000002
06-11 12:54:19.711: I/DEBUG: be9f9048 00000140
06-11 12:54:19.711: I/DEBUG: be9f904c 00015b51 /data/local/ffmpeg
06-11 12:54:19.719: I/DEBUG: be9f9050 00000000
06-11 12:54:19.719: I/DEBUG: be9f9054 000186a0 /data/local/ffmpeg
06-11 12:54:19.719: I/DEBUG: EET
06-11 12:54:19.719: I/DEBUG: !@dumpstate -k -t -n -z -d -o /data/log/dumpstate_app_native -m 30146
06-11 12:54:19.719: I/BootReceiver(25091): Copying /data/tombstones/tombstone_05 to DropBox (SYSTEM_TOMBSTONE)
06-11 12:54:19.727: I/dumpstate(30148): begin

#7 Updated by n8fr8 over 5 years ago

n8fr8 wrote:

I am getting a segfault when I run this using the attached vf_refact.c code:

./ffmpeg -y -i ./leaktest.mp4 -b 500k -r 15 -s 480x320 -vcodec libx264 -acodec copy -f mp4 -vf 'redact=./leaktest.txt [d] [out],[d]nullsink' /sdcard/foo8.mp4

If I run this with out the -vf section, it converts just fine.

#8 Updated by n8fr8 over 5 years ago

  • File leaktest.mp4 added
  • File leaktest.txtMagnifier added
  • Status changed from New to In Progress
  • Assignee changed from andrew to hans

Hans is working on this now with his ffmpeg build, trying Andrew's latest filter code.

Attached are an actual video shot from my Samsung Galaxy Player, and a test redact txt file.

#9 Updated by hans over 5 years ago

Nathan and I are getting crashes trying to use the latest vf_redact.c with ffmpeg. I've now built ffmpeg v0.9.2 and v0.10.4 with the plugins and both crash, albeit differently. I attached the two backtraces from the crashes to see if that rings any bells.

#10 Updated by n8fr8 over 5 years ago

  • Status changed from In Progress to Resolved

This has been fixed (for now) by removing the two stream redact, and just doing the redact only, with the memory leak fix. Now building against ffmpeg 0.10.4.

Thanks, Andrew and Hans!

#11 Updated by andrew over 5 years ago

Indeed there does seem to be a memory leak.
I don't really understand when ffmpeg increases reference counts and have
to dig deeper.

The attached version can redact OK without leaking:
./ffmpeg -y -i test.mp4 -vframes 999999 -vf 'redact=blurbox.txt [out] [d],
[d]nullsink' -acodec copy outputa.mp4

but crashes if you try to write the unredaction data:
./ffmpeg -y -i test.mp4 -vframes 999999 -vf 'redact=blurbox.txt [d]
[out], [d]nullsink' -acodec copy outputa.mp4

I can't find my password for https://dev.guardianproject.info/login so am
emailing.

On Fri, Jun 8, 2012 at 3:01 PM, wrote:

Issue #179 has been updated by n8fr8.

i have reproduced this at the command line now running on Android. Seems
like a memory leak. At some point about 1:08 in to the ffmpeg process, and
about 5000kb of video processed, the launcher starts closing and acting
weird, then the shell drops, and then when I go back into the device via
adb shell, the file exists in the corrupted state.
----------------------------------------
Bug #179: ffmpeg produces corrupt output on occasion
https://dev.guardianproject.info/issues/179#change-318

Author: n8fr8
Status: New
Priority: Normal
Assignee: andrew
Category:
Target version: v2 (now with Video)
Component:

Not sure if this is related to the redact avfilter but something is
definitely breaking in an unclear way.

some videos export/redact without problem, while others do not.

i do not have the source field yet, but perhaps the same config could be
run on another file.

--
You have received this notification because you have either subscribed to
it, or are involved in it.
To change your notification preferences, please click here:
https://dev.guardianproject.info/my/account

Also available in: Atom PDF