playing h264 from stdin vs file shows no video
Posted: 28 Apr 2017 21:13
I have an annex B stream starting with 00 00 00 01 67 that plays fine with:
cvlc xxx.h264
but when I try with
cvlc - < xxx.h264
or
cat xxx.h264 | cvlc -
I get a black window of the correct size (1080p) for several seconds, then it closes.
WIth verbose logging, this appears to be the difference:
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
vs
main input debug: Buffering 0%
main input debug: Buffering 13%
main input debug: Buffering 26%
main input debug: Buffering 40%
main input debug: Buffering 53%
main input debug: Buffering 66%
main input debug: Buffering 80%
I tried adding things like --codec h264 but they have no effect. It's not my video file, I get the same results with a reference video made with avconv, eg
ppmmake white 640 480 > white.ppm
ppmmake red 100 100 > red.ppm
for n in $(seq 0 540); do
pnmpaste red.ppm $n 240 < white.ppm | ppmtojpeg
done | avconv -f image2pipe -c:v mjpeg -i - -r 25 -map 0 xxx.h264
What are the correct args to cvlc to make it play a file like this from stdin? Thanks! --ed
cvlc xxx.h264
but when I try with
cvlc - < xxx.h264
or
cat xxx.h264 | cvlc -
I get a black window of the correct size (1080p) for several seconds, then it closes.
WIth verbose logging, this appears to be the difference:
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
vs
main input debug: Buffering 0%
main input debug: Buffering 13%
main input debug: Buffering 26%
main input debug: Buffering 40%
main input debug: Buffering 53%
main input debug: Buffering 66%
main input debug: Buffering 80%
I tried adding things like --codec h264 but they have no effect. It's not my video file, I get the same results with a reference video made with avconv, eg
ppmmake white 640 480 > white.ppm
ppmmake red 100 100 > red.ppm
for n in $(seq 0 540); do
pnmpaste red.ppm $n 240 < white.ppm | ppmtojpeg
done | avconv -f image2pipe -c:v mjpeg -i - -r 25 -map 0 xxx.h264
What are the correct args to cvlc to make it play a file like this from stdin? Thanks! --ed