0
votes

I have been using ffmpeg for transcoding for quite some time. Recently i have got a requirement where the ffmpeg output needs not be to a file but to stdout , which will be later captured and then sent back to callingurl. I have got some prelimenary success with flv and avi , but got failure at mp4 when using -f flag. here are my codes and need some serious look at the same

this works well with player :

ffmpeg -loglevel quiet -i cat_dog.mp4 -vbsf h264_mp4toannexb -vcodec copy \
-acodec copy -f mpegts -movflags frag_keyframe+empty_moov -re - 2>&1

this cannot be played by player :

ffmpeg -loglevel quiet -i cat_dog.mp4 -vbsf h264_mp4toannexb -vcodec copy \
-acodec copy -f MP4 -movflags frag_keyframe+empty_moov -re - 2>&1
1
What does "got failure" mean? Error message? No error message but unplayable file?blahdiblah

1 Answers

0
votes

As noted in the docs, the drawback to using -movflags is that it is "less compatible with other applications."

For flv or avi format, the -movflags option would be extraneous and ignored, but with mp4 it would take effect and potentially break compatibility.