Локально, с моей машины Windows с ffmpeg 3.3.2 от Zeranoe ( тот же результат с 4.0.2 )
ffmpeg версия 3.2.2 Copyright (c) 2003-2016 разработчики FFmpeg, созданные с конфигурацией gcc 5.4.0 (GCC):--enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr - -enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable- libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib--enable-libzimg --enable-lzma --enable-decklink --enable-zlib--enable-libzimg --enable-lzma --enable-decklink --enable-zlib
Серверная сторона
Запустите многоадресную передачу udp.
ffmpeg -re -i video.ts -an -f mpegts -c copy udp://224.1.1.1:5000
Сторона клиента
Игра с ffplay корректна, артефакты не отображаются, видео плавное
ffplay udp://224.1.1.1:5000
Воспроизведение после декодирования вызывает артефакты, видео повреждено
ffmpeg -i udp://224.1.1.1:5000 -pix_fmt gray -f avi - | ffplay -
или же
ffmpeg -f mpegts -i udp://224.1.1.1:5000 -pix_fmt gray -c:v rawvideo -f avi out.avi
У кого-нибудь есть объяснение?
Вот вывод консоли FFmpeg:
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
[h264 @ 0000000000c23f40] Invalid NAL unit 1, skipping.
[h264 @ 0000000000c23f40] cabac decode of qscale diff failed at 52 23
[h264 @ 0000000000c23f40] error while decoding MB 52 22, bytestream -16
[h264 @ 0000000000c23f40] concealing 5517 DC, 5517 AC, 5517 MV errors in P frame
[h264 @ 0000000000c23f40] Invalid NAL unit 1, skipping.
[h264 @ 0000000000c23f40] concealing 6939 DC, 6939 AC, 6939 MV errors in B frame
Input #0, mpegts, from 'udp://224.1.1.1:5000':
Duration: N/A, start: 1.520000, bitrate: N/A
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], 25 fps, 25 tbr, 90k tbn, 50 tbc
File 'out.avi' already exists. Overwrite ? [y/N] y
Output #0, avi, to 'out.avi':
Metadata:
ISFT : Lavf57.56.100
Stream #0:0: Video: rawvideo (Y800 / 0x30303859), gray, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc57.64.101 rawvideo
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
[h264 @ 0000000000c330e0] Invalid NAL unit 0, skipping.
[h264 @ 0000000003ba8260] Invalid NAL unit 0, skipping.
[h264 @ 0000000003ba8260] concealing 6939 DC, 6939 AC, 6939 MV errors in B frame
[h264 @ 0000000000c330e0] cabac decode of qscale diff failed at 52 23
[h264 @ 0000000000c330e0] error while decoding MB 52 22, bytestream -16
[h264 @ 0000000000c330e0] concealing 5517 DC, 5517 AC, 5517 MV errors in P frame
[h264 @ 0000000005990380] Invalid NAL unit 1, skipping.
[h264 @ 0000000000c32c40] Reference 2 >= 2
[h264 @ 0000000000c32c40] error while decoding MB 56 22, bytestream 503
[h264 @ 0000000000c32c40] concealing 5513 DC, 5513 AC, 5513 MV errors in B frame
[h264 @ 0000000005990380] error while decoding MB 14 64, bytestream -10
[h264 @ 0000000005990380] concealing 515 DC, 515 AC, 515 MV errors in P frame
[h264 @ 0000000003ba8260] Invalid NAL unit 6, skipping.2.68 bitrate=402359.1kbits/s speed=5.31x
[h264 @ 0000000003ba8260] error while decoding MB 81 34, bytestream -10
[h264 @ 0000000003ba8260] concealing 4048 DC, 4048 AC, 4048 MV errors in P frame
[h264 @ 0000000003ba8b00] Reference 2 >= 2
[h264 @ 0000000003ba8b00] error while decoding MB 7 0, bytestream 72352
[h264 @ 0000000003ba8b00] concealing 8160 DC, 8160 AC, 8160 MV errors in P frame
[h264 @ 000000000599a860] Invalid NAL unit 0, skipping.
[h264 @ 000000000599a860] error while decoding MB 68 18, bytestream -25147.9kbits/s speed=4.75x
[h264 @ 000000000599a860] concealing 5981 DC, 5981 AC, 5981 MV errors in I frame
[h264 @ 00000000056c8f00] Reference 2 >= 2
[h264 @ 00000000056c8f00] error while decoding MB 94 10, bytestream 2535
[h264 @ 00000000056c8f00] concealing 6915 DC, 6915 AC, 6915 MV errors in B frame
[h264 @ 0000000000c32c40] Invalid NAL unit 1, skipping.
[h264 @ 0000000000c32c40] error while decoding MB 73 24, bytestream -10
[h264 @ 0000000000c32c40] concealing 5256 DC, 5256 AC, 5256 MV errors in P frame
[h264 @ 0000000000c330e0] Reference 3 >= 2
[h264 @ 0000000000c330e0] error while decoding MB 30 16, bytestream 1562
[h264 @ 0000000000c330e0] concealing 6259 DC, 6259 AC, 6259 MV errors in B frame
[h264 @ 0000000003ba8b00] Invalid NAL unit 0, skipping.8.56 bitrate=267443.2kbits/s speed=5.44x
[h264 @ 0000000003ba8b00] error while decoding MB 1 16, bytestream -15
[h264 @ 0000000003ba8b00] concealing 6288 DC, 6288 AC, 6288 MV errors in I frame
ffmpeg
3.3.2 довольно старый, желательно использовать современную сборку. Пожалуйста, также поделитесь полным, неразрезанным выводом консоли команды, с которой уffmpeg
вас проблемы. Спасибо!