i am able to named pipe my stream to a file and then CLI ffmpeg it from
h264es to mp4 no problem,
but when i launch the same ffmpeg command using execv()
char* execargs[]={PATH_TO_FFMPEG,"-loglevel","debug","-framerate","30","-y",
"-f","h264","-i","/tmp/fifocam1.h264","-c:v","copy","-an","-video_size",
"1920x1080","-f","mp4",pathname, (char*)0};
i get this error
(well the logs come from two ffmpeg in two threads. little convoluted)
i'm hoping closing the pipes causes ffmpeg to close out it's file. then do
i need to kill ffmpeg?
i keep getting empty files.
thanks,
Stream #0:0Opening an output file: /media/sd-card/orbi_0145.cam1.mp4.
Successfully opened the file.
, 0, 1/1200000: Video: h264, 1 reference frame ([33][0][0][0] / 0x0021),
yuv420p(left), 1920x1080 (0x0), 1/1200000, q=2-31, 29.97 fps, 29.97 tbr,
1200k tbn, 1200k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Could not write header for output file #0 (incorrect codec parameters ?):
Immediate exit requested
[AVIOContext @ 0x8c4ee0] Statistics: 0 seeks, 1 writeouts
[AVIOContext @ 0x8aefc0] [mp4 @ 0x1017f50] Statistics: 32768 bytes read, 0
seeks
Exiting normally, received signal 15.
Codec for stream 0 does not use global headers but container format
requires global headers
Output #0, mp4, to '/media/sd-card/orbi_0145.cam1.mp4':
Metadata:
encoder : Lavf56.40.101
Stream #0:0, 0, 1/1200000: Video: h264, 1 reference frame ([33][0][0][0]
/ 0x0021), yuv420p(left), 1920x1080 (0x0), 1/1200000, q=2-31, 29.97 fps,
29.97 tbr, 1200k tbn, 1200k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Could not write header for output file #0 (incorrect codec parameters ?):
Immediate exit requested
[AVIOContext @ 0x1020ee0] Statistics: 0 seeks, 1 writeouts
[AVIOContext @ 0x100afc0] [h264 @ 0x1e9d800] Statistics: 32768 bytes read,
0 seeks
Exiting normally, received signal 15.
On Monday, May 8, 2017 at 11:05:03 AM UTC-7, michael c wrote:
>
> i have a raw h264 stream coming in from cameras with a custom API. data
> gets put into a callback function in my c code.
>
> i need to wrap this as mp4. i'm using ffmpeg to do this now, but only
> after the h264es file has been written and closed, so very time consuming
> on a beaglebone-like processor.
>
> i have been trying to write this data to a named pipe and feed that to
> ffmpeg but can not get this to work. maybe i'm not opening/closing pipes
> properly, it hangs. or not specifying the piping properly for ffmpeg.
>
> is it possible to feed the buffered data more directly to ffmpeg? or, how
> do i set up the named pipe to work properly?
>
> first i'm opening the fifo like this
>
> g_fifoname="/tmp/fifocam1.h264";
> mkfifo(g_fifoname, 0666); // make the fifos
> fd_fifo[ch+brd*2] = open(g_fifoname, O_RDWR);
>
> then, i'm calling ffmpeg like this, at this moment anyway. trying many
> things.
>
> char*
> execargs[]={PATH_TO_FFMPEG,"-re","-y","-framerate","30","-f","h264","-video_size","1920x1080","-i",g_fifname,"-c:v","copy","-an",pathname,
> (char*)0};
>
> i probably got the ffmpeg call wrong. argh. i open the fifo first, then
> start ffmpeg. when streaming is stopped i close fifo's, then close ffmpeg
> output file.
>
> send my buffer to stdin and get ffmpeg to read stdout?
>
> make the named fifo work?
>
> thanks all,
>
> Michael
>
>
>
>
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/b835dfe2-7470-4a3b-b23a-01be78afe8f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.