Форум русскоязычного сообщества Ubuntu


Хотите сделать посильный вклад в развитие Ubuntu и русскоязычного сообщества?
Помогите нам с документацией!

Автор Тема: ffmpeg filter movie -- помогите понять причину  (Прочитано 3001 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн NewUse

  • Автор темы
  • Новичок
  • *
  • Сообщений: 44
    • Просмотр профиля
Задача из четырёх источнеков изображений сделать однин поток, разместив изображения матрицей 2х2 затем передать его в ffserver
ffmpeg собран из гита, т.к. из реозитория (ppa:jon-severinsson/ffmpeg) не ставится: ругается на внутренние функции при попытки запуска и вылетает
Решаю так:
ffmpeg -i test.avi -async -1 -vf "[in]scale=360:288,setpts=PTS-STARTPTS,pad=720:576:0:0,[T1]overlay=360:0,[T2]overlay=0:288,[T3]overlay=360:288[out]\
;movie=test.avi,scale=360:288,setpts=PTS-STARTPTS[T1]\
;movie=test.avi,scale=360:288,setpts=PTS-STARTPTS[T2]\
;movie=test.avi,scale=360:288,setpts=PTS-STARTPTS[T3]" -y test2.avi

вылетает с ошибкой:
Цитировать
ffmpeg version N-39184-gadb98a3 Copyright (c) 2000-2012 the FFmpeg developers
  built on Mar 24 2012 01:09:10 with gcc 4.4.3
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-libmp3lame --enable-libtheora --enable-libv4l2 --enable-libx264 --enable-libxvid --enable-openssl
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  2.100 / 54.  2.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 65.102 /  2. 65.102
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  7.100 /  0.  7.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.avi':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isomavc1mp42
    creation_time   : 2008-09-04 09:15:28
  Duration: 00:02:24.32, start: 0.000000, bitrate: 454 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 125 kb/s
    Metadata:
      creation_time   : 2008-09-04 09:15:28
      handler_name    : (C) 2007 Google Inc. v06.24.2007.
    Stream #0:1(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 384x288 [SAR 1:1 DAR 4:3], 323 kb/s, 24.98 fps, 24.98 tbr, 24979 tbn, 49958 tbc
    Metadata:
      creation_time   : 2008-09-04 09:15:28
      handler_name    :
[buffer @ 0x2f09580] w:384 h:288 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[movie @ 0x2f082e0] seek_point:0 format_name:(null) file_name:test.avi stream_index:1
[movie @ 0x30022a0] seek_point:0 format_name:(null) file_name:test.avi stream_index:1
[movie @ 0x2edf8e0] seek_point:0 format_name:(null) file_name:test.avi stream_index:1
[scale @ 0x2f11420] w:384 h:288 fmt:yuv420p sar:1/1 -> w:360 h:288 fmt:yuv420p sar:16/15 flags:0x4
[scale @ 0x2f11420] TB:0.000001
[pad @ 0x2edec80] w:360 h:288 -> w:720 h:576 x:0 y:0 color:0x000000FF
[scale @ 0x2f081a0] w:384 h:288 fmt:yuv420p sar:1/1 -> w:360 h:288 fmt:yuva420p sar:16/15 flags:0x4
[scale @ 0x2f081a0] TB:0.000040
[overlay @ 0x2f11ae0] main w:720 h:576 fmt:yuv420p overlay x:360 y:0 w:360 h:288 fmt:yuva420p
[overlay @ 0x2f11ae0] main_tb:1/1000000 overlay_tb:1/24979 -> tb:0/1 exact:0
[overlay @ 0x2f11ae0] Timestamp conversion inexact, timestamp information loss may occurr
[scale @ 0x2f4b820] w:384 h:288 fmt:yuv420p sar:1/1 -> w:360 h:288 fmt:yuva420p sar:16/15 flags:0x4
[scale @ 0x2f4b820] TB:0.000040
[overlay @ 0x2edfbc0] main w:720 h:576 fmt:yuv420p overlay x:0 y:288 w:360 h:288 fmt:yuva420p
[overlay @ 0x2edfbc0] main_tb:0/1 overlay_tb:1/24979 -> tb:1/24979 exact:1
[scale @ 0x321cb80] w:384 h:288 fmt:yuv420p sar:1/1 -> w:360 h:288 fmt:yuva420p sar:16/15 flags:0x4
[scale @ 0x321cb80] TB:0.000040
[overlay @ 0x2f076e0] main w:720 h:576 fmt:yuv420p overlay x:360 y:288 w:360 h:288 fmt:yuva420p
[overlay @ 0x2f076e0] main_tb:1/24979 overlay_tb:1/24979 -> tb:1/24979 exact:1
Output #0, avi, to 'test2.avi':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isomavc1mp42
    creation_time   : 2008-09-04 09:15:28
    ISFT            : Lavf54.2.100
    Stream #0:0(und): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 720x576 [SAR 16:15 DAR 4:3], q=2-31, 200 kb/s, 24.98 tbn, 24.98 tbc
    Metadata:
      creation_time   : 2008-09-04 09:15:28
      handler_name    :
    Stream #0:1(und): Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16
    Metadata:
      creation_time   : 2008-09-04 09:15:28
      handler_name    : (C) 2007 Google Inc. v06.24.2007.
Stream mapping:
  Stream #0:1 -> #0:0 (h264 -> mpeg4)
  Stream #0:0 -> #0:1 (aac -> libmp3lame)
Press [q] to stop, [?] for help
Исключение в операции с плавающей точкой

а при опытки вывести в feed1 :
ffmpeg -i test.avi -async -1 -vf "[in]scale=360:288,setpts=PTS-STARTPTS,pad=720:576:0:0,[T1]overlay=360:0,[T2]overlay=0:288,[T3]overlay=360:288[out]\
;movie=test.avi,scale=360:288,setpts=PTS-STARTPTS[T1]\
;movie=test.avi,scale=360:288,setpts=PTS-STARTPTS[T2]\
;movie=test.avi,scale=360:288,setpts=PTS-STARTPTS[T3]" -y http://localhost:8090/feed1.ffm

выводит test.avi без каких бы то небыло изменений,
Подскажите, ллз, что я делаю не так, я чайник, ubuntu 10.04 LTS(пробовал обе и i386 и x86_64), и 12.04 i386

Оффлайн start733

  • Участник
  • *
  • Сообщений: 248
    • Просмотр профиля
Re: ffmpeg filter movie -- помогите понять причину
« Ответ #1 : 25 Марта 2012, 12:40:07 »
Не вижу до конца строчку configuration или это всё?
В терминале запусти
ffmpeg -filtersПроверь какие фильтры он поддерживает.Может он собран без поддержки видео фильтров?
« Последнее редактирование: 25 Марта 2012, 12:43:30 от start733 »

Оффлайн NewUse

  • Автор темы
  • Новичок
  • *
  • Сообщений: 44
    • Просмотр профиля
Re: ffmpeg filter movie -- помогите понять причину
« Ответ #2 : 25 Марта 2012, 13:03:15 »
Не вижу до конца строчку configuration или это всё?
Всё


Проверь какие фильтры он поддерживает.Может он собран без поддержки видео фильтров?


$ ffmpeg -filters
ffmpeg version N-39184-gadb98a3 Copyright (c) 2000-2012 the FFmpeg developers
  built on Mar 24 2012 01:09:10 with gcc 4.4.3
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-libmp3lame --enable-libtheora --enable-libv4l2 --enable-libx264 --enable-libxvid --enable-openssl
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  2.100 / 54.  2.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 65.102 /  2. 65.102
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  7.100 /  0.  7.100
  libpostproc    52.  0.100 / 52.  0.100
Filters:
aconvert         A->A       Convert the input audio to sample_fmt:channel_layout:packed_fmt.
aformat          A->A       Convert the input audio to one of the specified formats.
amerge           AA->A      Merge two audio streams into a single multi-channel stream.
anull            A->A       Pass the source unchanged to the output.
aresample        A->A       Resample audio data.
ashowinfo        A->A       Show textual information for each audio frame.
asplit           A->AA      Pass on the audio input to two outputs.
astreamsync      AA->AA     Copy two streams of audio data in a configurable order.
earwax           A->A       Widen the stereo image.
pan              A->A       Remix channels with coefficients (panning).
silencedetect    A->A       Detect silence.
volume           A->A       Change input volume.
abuffer          |->A       Buffer audio frames, and make them accessible to the filterchain.
aevalsrc         |->A       Generate an audio signal generated by an expression.
amovie           |->A       Read audio from a movie source.
anullsrc         |->A       Null audio source, return empty audio frames.
abuffersink      A->|       Buffer audio frames, and make them available to the end of the filter graph.
anullsink        A->|       Do absolutely nothing with the input audio.
bbox             V->V       Compute bounding box for each frame.
blackdetect      V->V       Detect video intervals that are (almost) black.
blackframe       V->V       Detect frames that are (almost) black.
boxblur          V->V       Blur the input.
copy             V->V       Copy the input video unchanged to the output.
crop             V->V       Crop the input video to width:height:x:y.
cropdetect       V->V       Auto-detect crop size.
delogo           V->V       Remove logo from input video.
deshake          V->V       Stabilize shaky video.
drawbox          V->V       Draw a colored box on the input video.
fade             V->V       Fade in/out input video.
fieldorder       V->V       Set the field order.
fifo             V->V       Buffer input images and send them when they are requested.
format           V->V       Convert the input video to one of the specified pixel formats.
gradfun          V->V       Debands video quickly using gradients.
hflip            V->V       Horizontally flip the input video.
hqdn3d           V->V       Apply a High Quality 3D Denoiser.
lut              V->V       Compute and apply a lookup table to the RGB/YUV input video.
lutrgb           V->V       Compute and apply a lookup table to the RGB input video.
lutyuv           V->V       Compute and apply a lookup table to the YUV input video.
mp               V->V       Apply a libmpcodecs filter to the input video.
negate           V->V       Negate input video.
noformat         V->V       Force libavfilter not to use any of the specified pixel formats for the input to the next filter.
null             V->V       Pass the source unchanged to the output.
overlay          VV->V      Overlay a video source on top of the input.
pad              V->V       Pad input image to width:height[:x:y[:color]] (default x and y: 0, default color: black).
pixdesctest      V->V       Test pixel format definitions.
scale            V->V       Scale the input video to width:height size and/or convert the image format.
select           V->V       Select frames to pass in output.
setdar           V->V       Set the frame display aspect ratio.
setfield         V->V       Force field for the output video frame.
setpts           V->V       Set PTS for the output video frame.
setsar           V->V       Set the pixel sample aspect ratio.
settb            V->V       Set timebase for the output link.
showinfo         V->V       Show textual information for each video frame.
slicify          V->V       Pass the images of input video on to next video filter as multiple slices.
split            V->VV      Pass on the input to two outputs.
swapuv           V->V       Swap U and V components.
thumbnail        V->V       Select the most representative frame in a given sequence of consecutive frames.
tile             V->V       Tile several successive frames together.
tinterlace       V->V       Perform temporal field interlacing.
transpose        V->V       Transpose input video.
unsharp          V->V       Sharpen or blur the input video.
vflip            V->V       Flip the input video vertically.
yadif            V->V       Deinterlace the input image.
cellauto         |->V       Create pattern generated by an elementary cellular automaton.
color            |->V       Provide an uniformly colored input, syntax is: [color[:size[:rate]]].
life             |->V       Create life.
mandelbrot       |->V       Render a Mandelbrot fractal.
movie            |->V       Read from a movie source.
mptestsrc        |->V       Generate various test pattern.
nullsrc          |->V       Null video source, return unprocessed video frames.
rgbtestsrc       |->V       Generate RGB test pattern.
testsrc          |->V       Generate test pattern.
buffersink       V->|       Buffer video frames, and make them available to the end of the filter graph.
nullsink         V->|       Do absolutely nothing with the input video.
buffer           |->V       Buffer video frames, and make them accessible to the filterchain.

Пользователь решил продолжить мысль 25 Марта 2012, 13:54:53:
Чёрт, похоже ffserver не поддерживает поток после фильтров:
http://ffmpeg-users.933282.n4.nabble.com/ffserver-ignores-filters-td4310672.html

Тогда следующий вопрос, каким ПО можно оргаизовать подобное?
Нужна консольная утилита, позволяющая обрбатыать(микшировать) 5-8 идеопотоков (в виде матрицы 2x2 и PictreInPicture для каждого) и вещать в реальном времени(желательно в виде мультикаста, но для начала и юникаст сойдёт)

Подскажите плз, все мои надежды были связаны стаким монстром, как ffmpeg, а он подвёл :((((((((((((((((((
Нужна ваша помощь гуру....
« Последнее редактирование: 25 Марта 2012, 13:54:53 от NewUse »

Оффлайн alexander.pronin

  • Старожил
  • *
  • Сообщений: 2539
    • Просмотр профиля
Re: ffmpeg filter movie -- помогите понять причину
« Ответ #3 : 26 Марта 2012, 10:24:41 »
Решаю так:
ffmpeg -i test.avi -async -1 -vf "[in]scale=360:288,setpts=PTS-STARTPTS,pad=720:576:0:0,[T1]overlay=360:0,[T2]overlay=0:288,[T3]overlay=360:288[out]\
;movie=test.avi,scale=360:288,setpts=PTS-STARTPTS[T1]\
;movie=test.avi,scale=360:288,setpts=PTS-STARTPTS[T2]\
;movie=test.avi,scale=360:288,setpts=PTS-STARTPTS[T3]" -y test2.avi
Попробуйте убрать ;
перед movie.

Оффлайн honeybeer

  • Любитель
  • *
  • Сообщений: 92
    • Просмотр профиля
Re: ffmpeg filter movie -- помогите понять причину
« Ответ #4 : 26 Марта 2012, 12:54:06 »
NewUse,
я запустил ваш первый пример - всё отлично работает (h264-> mpeg4, только видео)!  Но у меня Libav
ffmpeg version v0.7-2120-g7efea2a, Copyright (c) 2000-2011 the Libav developers
  built on Dec  7 2011 21:02:55 with gcc 4.4.3
This program is not developed anymore and is only provided for compatibility. Use avconv instead (see Changelog for the list of incompatible changes).
ffmpeg v0.7-2120-g7efea2a
libavutil    51. 19. 1 / 51. 19. 1
libavcodec   53. 26. 0 / 53. 26. 0
libavformat  53. 16. 0 / 53. 16. 0
libavdevice  53.  2. 0 / 53.  2. 0
libavfilter   2. 13. 1 /  2. 13. 1
libswscale    2.  1. 0 /  2.  1. 0
libpostproc  52.  0. 0 / 52.  0. 0
Можете дать конкретный пример видеопотока, на котором кодирование падает?
ASUS Sandy/Ivy Bridge + PCI = Nobody cares
Ciao mina-san

Оффлайн NewUse

  • Автор темы
  • Новичок
  • *
  • Сообщений: 44
    • Просмотр профиля
Re: ffmpeg filter movie -- помогите понять причину
« Ответ #5 : 26 Марта 2012, 23:10:20 »
Цитировать
я запустил ваш первый пример - всё отлично работает (h264-> mpeg4, только видео)!  Но у меня Libav
у меня похоже что-то с фильтрами (оверлей не так собрался), но влюбом случае это не решает поставленной задачи:
вывод в четыре квадрата через ffserver не происходит, опция -vf не имеет влияния на вывод в feed1.ffm, или Вам удалось?, тогда расскажите как...
клип был первый опавшийся с Ютуба, выложил на сякий случай :) http://share.netbynet.ru/132test.avi

Цитировать
Попробуйте убрать ;
перед movie.
заменил на запятые -- резалт тот же:( Хотя согласно документации там должна быть точка-с-запятой...
« Последнее редактирование: 30 Марта 2012, 01:36:05 от NewUse »

Оффлайн honeybeer

  • Любитель
  • *
  • Сообщений: 92
    • Просмотр профиля
Re: ffmpeg filter movie -- помогите понять причину
« Ответ #6 : 29 Марта 2012, 23:59:56 »
Выводил в red5, смотрел в браузере 4 квадрата. Когда-то давно пытался ислользовать ffserver, но безуспешно
ASUS Sandy/Ivy Bridge + PCI = Nobody cares
Ciao mina-san

 

Страница сгенерирована за 0.034 секунд. Запросов: 25.