3d0c / gmf

Go Media Framework
MIT License
885 stars 170 forks source link

Removing location metadata #131

Open SandroJijavadze opened 3 years ago

SandroJijavadze commented 3 years ago

With ffmpeg I achieve this with: ffmpeg -i in.FORMAT -map_metadata -1 -c:v copy -c:a copy out.FORMAT It leaves width/height/bitrate etc and removes GPS location, which is what I want. Can I achieve the same using gmf?

I tried remuxing with the example, replaced CloseInput()/CloseOutput() with CloseInputAndRelease/CloseOutputAndRelease https://github.com/3d0c/gmf/blob/master/examples/remuxing.go

Which did the job of removing that metadata but created a file 2 mb smaller than original and seems to be corrupt, vlc can't play it properly, video is skippy and vlc shows errors: [h264 @ 0x7fe894004e80] get_buffer() failed [h264 @ 0x7fe894004e80] thread_get_buffer() failed [h264 @ 0x7fe894004e80] decode_slice_header error [h264 @ 0x7fe894004e80] no frame!

I'm trying to figure it out myself but if anyone could point me in the right direction it would be very helpful.

SandroJijavadze commented 3 years ago

ffmpeg -v error -i videoOutput.mp4 -f null - 2>error.log

On original file this logs no errors, but on remuxed one I get:

[h264 @ 0x561df75da4c0] decode_slice_header error [h264 @ 0x561df75da4c0] no frame! [h264 @ 0x561df75da4c0] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x561df75da4c0] decode_slice_header error [h264 @ 0x561df75da4c0] no frame! [h264 @ 0x561df75da4c0] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x561df75da4c0] decode_slice_header error [h264 @ 0x561df75da4c0] no frame! [h264 @ 0x561df75da4c0] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x561df75da4c0] decode_slice_header error [h264 @ 0x561df75da4c0] no frame! [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 702 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 703 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 704 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 705 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 706 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 707 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 708 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 709 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 710 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 711 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 712 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 713 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 714 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 715 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 716 [null @ 0x561df77f3bc0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1001 >= 717

error.log

BTW, thanks for the package :pray: I'll look into transcode.go, might get better idea