I've mp4 file what uploaded by user, when play it with some player, where will popup some warn.
I check the video and found something like Unsupported codec with id 0 for input stream 2
. So I want to drop it.
I use -map 0:a -map 0:v
to only select the video and audio stream, but it not works(not drop the data stream).
Here is the source mp4 info
$ ffprobe.exe 9846ad1fbce094023e5978b090699d46.mp4
ffprobe version git-2019-12-08-9f7b2b3 Copyright (c) 2007-2019 the FFmpeg developers
built with gcc 9.2.1 (GCC) 20191125
...........
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '9846ad1fbce094023e5978b090699d46.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Duration: 00:02:59.08, start: 0.000000, bitrate: 4867 kb/s
Stream #0:0(eng): Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p10le, 856x480 [SAR 320:321 DAR 16:9], 4728 kb/s, 50 fps, 50 tbr, 12800 tbn, 100 tbc (default)
Metadata:
handler_name : VideoHandler
timecode : 01:00:00:00
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
Metadata:
handler_name : TimeCodeHandler
timecode : 01:00:00:00
Unsupported codec with id 0 for input stream 2
Here is what I've tried
$ ffprobe -v error -show_entries stream=index,codec_type,codec_name -of csv -i 9846ad1fbce094023e5978b090699d46.mp4
stream,0,h264,video
stream,1,aac,audio
stream,2,unknown,data
$ ffmpeg -v error -i 9846ad1fbce094023e5978b090699d46.mp4 -map 0:a -map 0:v -y out.mp4
$ ffprobe -v error -show_entries stream=index,codec_type,codec_name -of csv -i out.mp4
stream,0,aac,audio
stream,1,h264,video
stream,2,unknown,data
I've also tried(Neither works)
ffmpeg -i 9846ad1fbce094023e5978b090699d46.mp4 -c:v copy -c:a copy -map_chapters -1 out.mp4
ffmpeg -i 9846ad1fbce094023e5978b090699d46.mp4 -c copy -dn -map_metadata:c -1 out.mp4