'Using ffmpeg to copy file with all streams intact (to fix any issues)
I am trying to use ffmpeg to copy files with all streams intact to fix various issues with files. ffmpeg is pretty good at reconstructing files and can remove various strangeness various encoders insert. The issue is that it fails on files with covers.
I am currently using:
ffmpeg -i input.ogg -map 0 -c copy output.ogg
But for example on this file it fails with:
Input #0, ogg, from 'KR369.ogg':
Duration: 01:32:53.80, start: 0.000000, bitrate: 164 kb/s
Stream #0:0: Audio: vorbis, 44100 Hz, stereo, fltp, 152 kb/s
Metadata:
ALBUM : Küchenradio.org
ENCODED-BY : auphonic.com
ARTIST : Philip Banse
TITLE : KR369 Hotel Berlin
PUBLISHER : Küchenstud.io
URL : http://kuechenstud.io/
DATE : 2014
GENRE : Podcast
RIGHTS-DATE : 2014
RIGHTS : 2014 CC BY SA
LICENSE : http://creativecommons.org/licenses/by-sa/3.0/de/
RIGHTS-URI : http://creativecommons.org/licenses/by-sa/3.0/de/
ENCODED_BY : auphonic.com
comment : DocPhil, Cindy, Frau Katja und Onkel Andi zu Besuch bei Susanne DeOcampo-Herrmann, der Chefköchin im Hotel Berlin. Wir waren lange nicht mehr zusammen und hatten wie gewohnt alle auf einmal viele Fragen zur: Küchenplanung, Hotelgeschichte, Filetier-Tech
Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 500x500 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
Metadata:
comment : Cover (front)
[ogg @ 0x55db241c2e80] Unsupported codec id in stream 1
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Last message repeated 1 times
There seems to be a known issue about it but I am trying to see if there is any workaround. Maybe to do something with multiple passes, first manually extracting everything and then reconstructing? Or if there is another tool to use?
Solution 1:[1]
You need to "unmap" the video stream, I believe using -map 0 -map -0:v will un-map the "video stream" (cover) so that you're left with only the audio.
See https://trac.ffmpeg.org/wiki/Map for more information.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ronald S. Bultje |
