Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Video 如何使用gst launch(gstreamer)将.mp4文件转换为不丢失帧的.yuv(原始视频i420)?_Video_Gstreamer_Yuv - Fatal编程技术网

Video 如何使用gst launch(gstreamer)将.mp4文件转换为不丢失帧的.yuv(原始视频i420)?

Video 如何使用gst launch(gstreamer)将.mp4文件转换为不丢失帧的.yuv(原始视频i420)?,video,gstreamer,yuv,Video,Gstreamer,Yuv,我在gstreamer截断gst启动管道的yuv输出时遇到问题。简化的例子是 gst-launch-1.0 filesrc location="$input" \ ! decodebin \ ! 'video/x-raw, format=I420' \ ! rawvideoparse \ ! filesink location="$output&q

我在gstreamer截断gst启动管道的yuv输出时遇到问题。简化的例子是

gst-launch-1.0 filesrc location="$input" \
               ! decodebin \
               ! 'video/x-raw, format=I420' \
               ! rawvideoparse \
               ! filesink location="$output" buffer-mode=2
当我在带有H.264视频的MP4文件上以7680x3840运行600帧时,它会给我一个6280934400字节长的文件。算术6280934400/7680/3840/600的快速位=0.3549609375。这是每像素1/3字节多一点

Setting pipeline to PAUSED ...
0:00:00.354592385 16438 0x555e06766b30 WARN                 basesrc gstbasesrc.c:3600:gst_base_src_start_complete:<filesrc0> pad not activated yet
Pipeline is PREROLLING ...
0:00:00.536788393 16438 0x7f3f90073680 WARN                 qtdemux qtdemux_types.c:239:qtdemux_type_get: unknown QuickTime node type uuid
0:00:00.536830878 16438 0x7f3f90073680 WARN                 qtdemux qtdemux.c:3237:qtdemux_parse_trex:<qtdemux0> failed to find fragment defaults for stream 1
0:00:00.536861715 16438 0x7f3f90073680 WARN                 qtdemux qtdemux.c:3237:qtdemux_parse_trex:<qtdemux0> failed to find fragment defaults for stream 2
Redistribute latency...
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:01:11.471563917 16438 0x7f3f8000d4a0 WARN                   libav gstavauddec.c:628:gst_ffmpegauddec_drain:<avdec_aac0> send packet failed, could not drain decoder
Got EOS from element "pipeline0".
Execution ended after 0:01:10.085660675
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
正在将管道设置为暂停。。。
0:00:00.354592385 16438 0x555e06766b30 WARN basesrc gstbasesrc.c:3600:gst_base_src_start_complete:pad尚未激活
管道正在预滚。。。
0:00:00.536788393 16438 0x7f3f90073680警告qtdemux qtdemux_类型。c:239:qtdemux_类型_获取:未知QuickTime节点类型uuid
0:00:00.536830878 16438 0x7f3f90073680警告qtdemux qtdemux。c:3237:qtdemux_parse_trex:未能找到流1的片段默认值
0:00:00.536861715 16438 0x7f3f90073680警告qtdemux qtdemux。c:3237:qtdemux_parse_trex:未能找到流2的片段默认值
重新分配延迟。。。
重新分配延迟。。。
管道已预卷。。。
正在将管道设置为播放。。。
新时钟:GstSystemClock
0:01:11.471563917 16438 0x7f3f8000d4a0警告libav gstavauddec.c:628:gst\u ffmpegauddec\u漏失:发送数据包失败,无法漏失解码器
从元素“pipeline0”获取EOS。
执行在0:01:10.085660675后结束
正在将管道设置为暂停。。。
正在将管道设置为就绪。。。
正在将管道设置为空。。。
释放管道。。。
我期望每像素1.5字节(因为format=I420)

如果我改为运行
ffmpeg-I$input-c:v rawvideo-pix_fmt yuv420p$output
,那么我会得到26542080000字节,这是7680*3840*600*1.5,正如预期的那样

我的目标管道比这更复杂(使用GLSL进行投影重映射),但我希望如果有人能够修复这个小例子,它也能修复我的真实管道

我如何才能建立一个gst启动管道,将文件正确地转换为原始视频,而不需要默默放弃20%的工作?

我认为:

gst-launch-1.0 filesrc location="$input" \
               ! decodebin \
               ! filesink location="$output"

应该足够了。因为解码器在默认情况下应该输出I420(除非它是一个特殊的配置文件)。之后无需解析数据(实际上可能是问题的根源,因为该元素的内部宽度和高度属性设置为320x240)。您只需要将来自解码器的内容转储到磁盘。

这提供了显著的改进。我现在得到26497843200字节,看起来是599帧。我不确定这是
gst启动
行为中的缺陷,还是ffmpeg输出中的错误。可能是解码器出了故障?可能比特流被提前终止,导致未定义的行为,帧在最后被刷新。