save a MJPG stream to MP4 file @ from Raspberry2 to Android
Posted: 30 Jan 2016 12:59
Hi all !
I hope this is the right section for my question, if it's not: I'm sorry could you please tell me the right one ? (or move the post) Tnx
I'm trying to record a MJPG video on my raspberry 2 grabbing it from a 'mjpg_streamer' http stream and saving it to file in order to deliver the recorded file to an android device in a second time.
i was able to do it as .avi, it works like a charm, but android do not play avi files (I need it to be stock video player compatible);
this is the AVI example:
The first test i've made (a very simple one) was to switch the mux into "mp4" ..this is working, but android stock player still doesn't like the video (VLC for android does)
the real problem starts when i try to transcode, vlc quits after a couple of seconds, no real errors (if compared to the working AVI out), and the output file is just 40 bytes long...
I've tested almost anything I've found on the net !! Depending on the --sout / transcode combination I can have 3 different behaviours:
1) as described, no errors, 40 bytes output file
2) no errors, 0 bytes output file (but present)
3) or even "floating point error"
I really cannot record in avi and re-encode on a second time, i need to directly record in android-compatible format.
On the next post ill post a -vvv output
please help ! I'm loosing my mind on it !
tnx, Marco.
I hope this is the right section for my question, if it's not: I'm sorry could you please tell me the right one ? (or move the post) Tnx
I'm trying to record a MJPG video on my raspberry 2 grabbing it from a 'mjpg_streamer' http stream and saving it to file in order to deliver the recorded file to an android device in a second time.
i was able to do it as .avi, it works like a charm, but android do not play avi files (I need it to be stock video player compatible);
this is the AVI example:
Code: Select all
vlc -I dummy http://127.0.0.1:8080/?action=stream \
--sout file/avi:/tmp/file.avi --start-time=00 --run-time=10 vlc://quit
Code: Select all
--sout file/mp4:/tmp/file.avi
Code: Select all
--sout "#transcode{vcodec=h264,venc=x264}:standard{mux=mp4,dst=/tmp/file.mp4,access=file}"
1) as described, no errors, 40 bytes output file
2) no errors, 0 bytes output file (but present)
3) or even "floating point error"
I really cannot record in avi and re-encode on a second time, i need to directly record in android-compatible format.
On the next post ill post a -vvv output
please help ! I'm loosing my mind on it !
tnx, Marco.