On 12/10/11 08:53, Da Rock wrote:
Hi all - latest defector from ffmpeg here, and already the whole kit seems to be a lot cleaner and smoother to to run.

However, I have new problems (or old ones that didn't appear through cruft). I have been on the irc while I waited to get on to the list, and this has been the notes so far:

I started with the latest release 0.7.2. I was using -map_metadata to pick the individual programs out of a mpegts stream, and that worked while writing to file, but wouldn't work for an avserver/ffserver feed. I'd only get audio (already one better than ffmpeg- it errored and wouldn't do a thing there).

So I went looking for help on irc and I was told that I could use -map 0:p:pid instead. That refused to work sending to ffserver as well, but it did work to file. The stream mapping actually looked screwed up: 0.1 -> 0.0, etc.

I was then advised to use the latest in the git repo as that last command wouldn't work except on avconv exclusively. So I picked up v0.7-2134-g12dca02 from git and built, and I got accurate stream mapping but a seg fault:

Stream mapping:
  Stream #0:0 -> #0:0Segmentation fault (core dumped)

This happens in both splitting the stream and sending it whole to avserver as ffm.

So the guru on the list had a look at this, and found in the code that when sending a feed to avserver, avconv actually gets the stream mapping from avserver.

In the next day I have tried using truss and gdb to get more information to help.

truss output: http://pastebin.com/h0j2pva6
gdb wouldn't work with all the options for me (but I'm not very good with it)

Further testing confirmed no other problems:

mkv (x264/vorbis) transcoded to flv no problems.
Copying directly to ts had no problems.
Feeding to avserver with feed set as ts (in the server and on the avconv options) showed perfect mapping, avserver didn't barf, but ended in broken pipe (ffserver did say incompatible file type, though; so it might be a bug). Tried copying to ffm with sending to avserver and got a new error: Data stream encoding not supported yet (only streamcopy).

I then tried cloning a new git head and build, and still got the same error. At this point I received a patch from elenril which I patched 0.7-2134 with and rebuilt: still got a seg fault.

So that is the results of my investigations so far, and I'm still hunting.

Any ideas on what I should try now?

My platform: 8.1-RELEASE-p1 FreeBSD 8.1-RELEASE-p1 #1: Sun Mar 13 08:45:42 EST 2011 Avconv: avconv version v0.7-2134-g12dca02, Copyright (c) 2000-2011 the Libav developers
  built on Dec  9 2011 23:08:48 with gcc 4.6.3 20111125 (prerelease)
and: avconv version v0.7-2142-gb73a01e, Copyright (c) 2000-2011 the Libav developers
  built on Dec  9 2011 22:42:56 with gcc 4.6.3 20111125 (prerelease)
Ok. Despite recent diversions of this thread, here is the latest update:

git head clone (avconv version v0.7-2192-g5695ae4): Yay! No seg fault.

$ ./avconv -debug 9 -f mpegts -i testpipe -vsync 0 -vcodec copy -acodec copy -map 0:p:1601 http://127.0.0.1:8090/stream1.ffm -vsync 0 -vcodec copy -acodec copy -map 0:p:1605 http://127.0.0.1:8090/stream2.ffm -vsync 0 -vcodec copy -acodec copy -map 0:p:1608 http://127.0.0.1:8090/stream3.ffm

Output:
Data stream encoding not supported yet (only streamcopy).

Adding a "-map -0:3" to remove the data stream didn't help this.

$ ./avconv -debug 99 -f mpegts -i testpipe -vsync 0 -vcodec copy -acodec copy -map 0:0 -map 0:1 http://127.0.0.1:8090/stream1.ffm -vsync 0 -vcodec copy -acodec copy -map 0:6 -map 0:7 http://127.0.0.1:8090/stream2.ffm -vsync 0 -vcodec copy -acodec copy -map 0:8 -map 0:9 http://127.0.0.1:8090/stream3.ffm

Output:
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:6 -> #1:0 (copy)
  Stream #0:7 -> #1:1 (copy)
  Stream #0:8 -> #2:0 (copy)
  Stream #0:9 -> #2:1 (copy)
Press ctrl-c to stop encoding
Broken pipe

As you can see the new code is a beautiful thing- the stream mapping is perfect.

Trying a single feed:

$ ./avconv -debug 9 -f mpegts -i testpipe -vsync 0 -vcodec copy -acodec copy -map 0:v -map 0:a http://127.0.0.1:8090/stream1.ffm

or mapping the streams individually as far as I could tell- got painful trying to match the right streams like moving targets. The output:

Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:6 -> #0:1 (copy)
  Stream #0:8 -> #0:2 (copy)
  Stream #0:1 -> #0:3 (copy)
  Stream #0:7 -> #0:4 (copy)
  Stream #0:9 -> #0:5 (copy)
Press ctrl-c to stop encoding
frame= 57 fps= 0 q=-1.0 q=-1.0 q=-1.0 size= 3120kB time=2.82 bitrate=9076.frame= 68 fps= 67 q=-1.0 q=-1.0 q=-1.0 size= 3960kB time=3.33 bitrate=9747.frame= 81 fps= 53 q=-1.0 q=-1.0 q=-1.0 size= 4888kB time=3.87 bitrate=10341frame= 95 fps= 47 q=-1.0 q=-1.0 q=-1.0 size= 5612kB time=4.29 bitrate=10721frame= 107 fps= 42 q=-1.0 q=-1.0 q=-1.0 size= 6420kB time=4.80 bitrate=10956frame= 119 fps= 39 q=-1.0 q=-1.0 q=-1.0 size= 7380kB time=5.34 bitrate=11313frame= 134 fps= 38 q=-1.0 q=-1.0 q=-1.0 size= 8236kB time=5.86 bitrate=11521frame= 146 fps= 36 q=-1.0 q=-1.0 q=-1.0 size= 8796kB time=6.27 bitrate=11488frame= 158 fps= 35 q=-1.0 q=-1.0 q=-1.0 size= 9652kB time=6.82 bitrate=11600frame= 170 fps= 34 q=-1.0 q=-1.0 q=-1.0 size= 10384kB time=7.33 bitrate=11608

and so on....

avserver logs:

Mon Dec 12 11:42:26 2011 Opening file '/home/share/movies/test.mkv'
Mon Dec 12 11:42:26 2011 [matroska,webm @ 0x80448a620]Probed with size=2048 and score=100
Mon Dec 12 11:42:26 2011 st:0 removing common factor 1000000 from timebase
Mon Dec 12 11:42:26 2011 st:1 removing common factor 1000000 from timebase
Mon Dec 12 11:42:26 2011 [vorbis @ 0x804418420]err{or,}_recognition separate: 1; 1 Mon Dec 12 11:42:26 2011 [vorbis @ 0x804418420]err{or,}_recognition combined: 1; 1
Mon Dec 12 11:42:26 2011 [vorbis @ 0x804418420]Unsupported bit depth: 0
Mon Dec 12 11:42:26 2011 [h264 @ 0x804418920]err{or,}_recognition separate: 1; 1 Mon Dec 12 11:42:26 2011 [h264 @ 0x804418920]err{or,}_recognition combined: 1; 1
Mon Dec 12 11:42:26 2011 [h264 @ 0x804418920]Unsupported bit depth: 0
Mon Dec 12 11:42:26 2011 [matroska,webm @ 0x80448a620]All info found
Mon Dec 12 11:42:26 2011 [matroska,webm @ 0x80448a620]Estimating duration from bitrate, this may be inaccurate Mon Dec 12 11:42:26 2011 [ffm @ 0x80448a620]Probed with size=2048 and score=101 Mon Dec 12 11:42:26 2011 [ffm @ 0x80448a620]Probed with size=2048 and score=101 Mon Dec 12 11:42:26 2011 [ffm @ 0x80448a620]Probed with size=2048 and score=101 Mon Dec 12 11:42:26 2011 [ffm @ 0x80448a620]Probed with size=2048 and score=101
Mon Dec 12 11:42:26 2011 AVserver started.
Mon Dec 12 11:50:19 2011 127.0.0.1 - - [POST] "/stream3.ffm HTTP/1.1" 200 0
Mon Dec 12 11:50:19 2011 127.0.0.1 - - [POST] "/stream2.ffm HTTP/1.1" 200 0
Mon Dec 12 11:50:19 2011 127.0.0.1 - - [POST] "/stream1.ffm HTTP/1.1" 200 0
Mon Dec 12 11:50:50 2011 127.0.0.1 - - [POST] "/stream1.ffm HTTP/1.1" 200 0
Mon Dec 12 11:50:50 2011 127.0.0.1 - - [POST] "/stream3.ffm HTTP/1.1" 200 0
Mon Dec 12 11:50:50 2011 127.0.0.1 - - [POST] "/stream2.ffm HTTP/1.1" 200 0
Mon Dec 12 11:51:46 2011 Feed '/home/share/stream1.ffm' stream number does not match registered feed Mon Dec 12 11:51:46 2011 127.0.0.1 - - [POST] "/stream1.ffm HTTP/1.1" 200 4096 Mon Dec 12 11:51:46 2011 Feed '/home/share/stream3.ffm' stream number does not match registered feed Mon Dec 12 11:51:46 2011 127.0.0.1 - - [POST] "/stream3.ffm HTTP/1.1" 200 4096 Mon Dec 12 11:51:46 2011 Feed '/home/share/stream2.ffm' stream number does not match registered feed Mon Dec 12 11:51:46 2011 127.0.0.1 - - [POST] "/stream2.ffm HTTP/1.1" 200 4096
Mon Dec 12 16:41:40 2011 127.0.0.1 - - [POST] "/stream1.ffm HTTP/1.1" 200 0
Mon Dec 12 16:42:34 2011 Feed '/home/share/stream1.ffm' stream number does not match registered feed Mon Dec 12 16:42:34 2011 127.0.0.1 - - [POST] "/stream1.ffm HTTP/1.1" 200 4096 Mon Dec 12 16:43:46 2011 192.168.0.179 - - [GET] "/stat.html HTTP/1.1" 200 3613
Mon Dec 12 16:44:36 2011 File '/stream1.mpg' not found
Mon Dec 12 16:44:36 2011 192.168.0.179 - - [GET] "/stream1.mpg HTTP/1.0" 404 147
Mon Dec 12 16:44:36 2011 File '/stream1.mpg' not found
Mon Dec 12 16:44:36 2011 192.168.0.179 - - [GET] "/stream1.mpg HTTP/1.0" 404 147
Mon Dec 12 16:44:36 2011 File '/stream1.mpg' not found
Mon Dec 12 16:44:36 2011 192.168.0.179 - - [GET] "/stream1.mpg HTTP/1.0" 404 147

avserver stat.html:


 avserver Status


   Available Streams

Path    Served
Conns   
bytes   Format  Bit rate
kbits/s         Video
kbits/s         
Codec   Audio
kbits/s         
Codec   Feed
test1.mpg <http://fbsd-test-tv-server:8090/test1.mpg> 0 0 mpeg 1192 1000 mpeg1video 192 mp2 feed1.ffm test.swf <http://fbsd-test-tv-server:8090/test.swf> 0 0 swf 1400 1200 libx264 200 libmp3lame feed1.ffm
stream2.mpg <http://fbsd-test-tv-server:8090/ten.mpg>     0       0       mp2   
  200     0       
        200     mp2     stream2.ffm
stream3.mpg <http://fbsd-test-tv-server:8090/eleven.mpg> 0 0 mp2 200 0
        200     mp2     stream3.ffm
stream1.mpg <http://fbsd-test-tv-server:8090/one.mpg>     0       0       mp2   
  200     0       
        200     mp2     stream1.ffm
testfile.flv <http://fbsd-test-tv-server:8090/testfile.flv> 0 0 flv 0 0 libx264 0 libvorbis /home/share/movies/test.mkv
stat.html <http://fbsd-test-tv-server:8090/stat.html>     1       0       -     
  -       -       
        -       
index.html <http://fbsd-test-tv-server:8090/index.html>   0       0       -     
  -       -       
        -       


   Feed feed1.ffm

Stream  type    kbits/s         codec   Parameters
0       audio   192     mp2     2 channel(s), 44100 Hz
1       video   1000    mpeg1video      160x128, q=2-31, fps=25
2       audio   200     libmp3lame      1 channel(s), 22050 Hz
3       video   1200    libx264         1280x720, q=2-31, fps=25


   Feed stream2.ffm

Stream  type    kbits/s         codec   Parameters
0       audio   200     mp2     1 channel(s), 22050 Hz


   Feed stream3.ffm

Stream  type    kbits/s         codec   Parameters
0       audio   200     mp2     1 channel(s), 22050 Hz


   Feed stream1.ffm

Stream  type    kbits/s         codec   Parameters
0       audio   200     mp2     1 channel(s), 22050 Hz


   Connection Status

Number of connections: 1 / 1000
Bandwidth in use: 0k / 500000k
# File IP Proto State Target bits/sec Actual bits/sec Bytes transferred
*1*     stat.html       192.168.0.179   HTTP/1.1        HTTP_WAIT_REQUEST       
0       0       0

------------------------------------------------------------------------
Generated at Mon Dec 12 16:43:46 2011

Its a beautiful thing to see- thanks guys. Now we can see the problem with avserver. I'm 100% sure where to start looking but I'll see if I can spot something, and if someone can provide some pointers it'd be appreciated.

I have a question or two regarding avserver/ffserver:

Has it ever worked as expected? In the docs and man pages it says streaming from file has never worked, and yet that has worked for me. I've never got the live feed happening though...

Cheers
_______________________________________________
libav-tools mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-tools

Reply via email to