Use of tee output with codec copy
Hello, I've seen various postings related to problems with the use of copy with the tee output format, but not with any real resolution. I'm trying to direct output to both an flv and a UDP output with codec copy, and I've boiled it down to the following test case (run against today's master). I originally assumed it was some failure to automatically insert a BSF when using the tee filter, but I don't see any sign of that. There's something in ffmpeg that converts "h264 (High) ([27][0][0][0]" into "h264 (High) ([7][0][0][0] / 0x0007)" when going directly to flv but not when using tee, but it's not clear to me where in the code that happens. Any suggestions would be greatly appreciated (I'm happy to provide the foo.ts file if you can't reproduce it with any other ts that has h.264 in it). Thanks, Devin Heitmueller ===== ./ffmpeg -i foo.ts -map 0:0 -c:v copy -f tee "[f=mpegts]udp:// 227.1.1.1:6002?pkt_size=1316|[f=flv]whatever.flv" ffmpeg version N-96891-g60b1f85b67 Copyright (c) 2000-2020 the FFmpeg developers built with Apple clang version 11.0.0 (clang-1100.0.33.17) configuration: libavutil 56. 42.100 / 56. 42.100 libavcodec 58. 73.102 / 58. 73.102 libavformat 58. 39.101 / 58. 39.101 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 77.100 / 7. 77.100 libswscale 5. 6.100 / 5. 6.100 libswresample 3. 6.100 / 3. 6.100 Input #0, mpegts, from 'foo.ts': Duration: 00:00:23.90, start: 1.400000, bitrate: 2531 kb/s Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 256 kb/s [flv @ 0x7fe45a804c00] Tag [27][0][0][0] incompatible with output codec id '27' ([7][0][0][0]) [tee @ 0x7fe45a802200] Slave '[f=flv]whatever.flv': error writing header: Invalid data found when processing input [tee @ 0x7fe45a802200] Slave muxer #1 failed, aborting. Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input Stream mapping: Stream #0:0 -> #0:0 (copy) Last message repeated 1 times =================== For reference, this command works fine: ./ffmpeg -i foo.ts -map 0:0 -c:v copy -f flv whatever.flv -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
On Thu, 26 Mar 2020 at 00:27, Devin Heitmueller <dheitmueller@kernellabs.com> wrote:
Hello,
I've seen various postings related to problems with the use of copy with the tee output format, but not with any real resolution. I'm trying to direct output to both an flv and a UDP output with codec copy, and I've boiled it down to the following test case (run against today's master).
I originally assumed it was some failure to automatically insert a BSF when using the tee filter, but I don't see any sign of that.
There's something in ffmpeg that converts "h264 (High) ([27][0][0][0]" into "h264 (High) ([7][0][0][0] / 0x0007)" when going directly to flv but not when using tee, but it's not clear to me where in the code that happens.
Any suggestions would be greatly appreciated (I'm happy to provide the foo.ts file if you can't reproduce it with any other ts that has h.264 in it).
Thanks,
Devin Heitmueller
===== ./ffmpeg -i foo.ts -map 0:0 -c:v copy -f tee "[f=mpegts]udp:// 227.1.1.1:6002?pkt_size=1316|[f=flv]whatever.flv <http://227.1.1.1:6002?pkt_size=1316%7C[f=flv]whatever.flv>" ffmpeg version N-96891-g60b1f85b67 Copyright (c) 2000-2020 the FFmpeg developers built with Apple clang version 11.0.0 (clang-1100.0.33.17) configuration: libavutil 56. 42.100 / 56. 42.100 libavcodec 58. 73.102 / 58. 73.102 libavformat 58. 39.101 / 58. 39.101 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 77.100 / 7. 77.100 libswscale 5. 6.100 / 5. 6.100 libswresample 3. 6.100 / 3. 6.100 Input #0, mpegts, from 'foo.ts': Duration: 00:00:23.90, start: 1.400000, bitrate: 2531 kb/s Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 256 kb/s [flv @ 0x7fe45a804c00] Tag [27][0][0][0] incompatible with output codec id '27' ([7][0][0][0]) [tee @ 0x7fe45a802200] Slave '[f=flv]whatever.flv': error writing header: Invalid data found when processing input [tee @ 0x7fe45a802200] Slave muxer #1 failed, aborting. Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input Stream mapping: Stream #0:0 -> #0:0 (copy) Last message repeated 1 times ===================
For reference, this command works fine: ./ffmpeg -i foo.ts -map 0:0 -c:v copy -f flv whatever.flv
-- Devin J. Heitmueller - Kernel Labs
Hey there, Could you provide the sample file mentioned in the issue above?
Hi Dennis,
Could you provide the sample file mentioned in the issue above?
Sure, you can download it from here: https://www.dropbox.com/s/rhyn751pru4yagb/foo.ts?dl=0 Devin -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
On Thu, 26 Mar 2020 at 02:03, Devin Heitmueller <dheitmueller@kernellabs.com> wrote:
Hi Dennis,
Could you provide the sample file mentioned in the issue above?
Sure, you can download it from here:
https://www.dropbox.com/s/rhyn751pru4yagb/foo.ts?dl=0
Devin
-- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Many thanks, I'll take a look. This *might* be related to an issue I've been tracking internally with the tee muxer.
On Wed, Mar 25, 2020 at 8:05 PM Dennis Mungai <dmngaie@gmail.com> wrote:
Many thanks, I'll take a look. This *might* be related to an issue I've been tracking internally with the tee muxer.
Any further thoughts on this? Regards, Devin -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
On Tue, 31 Mar 2020, Devin Heitmueller wrote:
On Wed, Mar 25, 2020 at 8:05 PM Dennis Mungai <dmngaie@gmail.com> wrote:
Many thanks, I'll take a look. This *might* be related to an issue I've been tracking internally with the tee muxer.
Any further thoughts on this?
It seems like some codec_tag confusion between the input and the output formats... This works by the way: ffmpeg -i foo.ts -map 0:0 -c:v copy -vtag 7 -f tee "[f=mpegts]out.ts|[f=flv]whatever.flv" Regards, Marton
participants (3)
-
Dennis Mungai -
Devin Heitmueller -
Marton Balint